File: gaReports.h

package info (click to toggle)
gadap 2.0-11
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 748 kB
  • sloc: cpp: 2,135; sh: 950; makefile: 26
file content (91 lines) | stat: -rw-r--r-- 2,515 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/* Copyright (C) 2003-2008 by the 
 * Institute of Global Environment and Society (IGES)
 * See the file COPYRIGHT for more information.   
 *
 *
 * gaReports.h  - The library's container for station data reports
 *
 * Last modified: $Date: 2008/07/25 20:43:25 $ 
 * Revision for this file: $Revision: 1.4 $
 * Release name: $Name: gadods-2_0 $
 * Original for this file: $Source: /homes/cvsroot/gadods/gadods/src/gaReports.h,v $
 */

#ifndef _gaReports_h_
#define _gaReports_h_

#include "gadap.h"
#include <DDS.h>
#include <Sequence.h>
#include "gaUtils.h"

class gaReports {

 public: 
  
  gaReports(libdap::DDS *_data, string url);

  ~gaReports();

  /* Returns handle to the dataset from which these reports were obtained */
  GADAP_DATASET getDataset();
  void setDataset(GADAP_DATASET _dataset);

  /* Returns the query that was used to generate this report */
  GADAP_STN_QUERY *getQuery();
  void setQuery(GADAP_STN_QUERY *_query);
  
  /* Returns the URL that was sent to the server to generate this report */
  const char * getURL();

  /* Total number of variables used by this report collection */
  int getNumVars();
  
  /* Total number of level-dependent variables in the dataset */
  int getNumLIVars();
  
  /* Name of the nth variable in this report collection  */
  const char *getVarName(int index);

  /* Name of the nth variable in this report collection  */
  int getVarLen(int index);
  
  /* Name of the nth variable in this report collection  */
  int getVarType(int index);

  /* Returns the index of the given variable, or -1 if not found */
  int getVarIndex(const char *varname);

  int getNumReports();

  int getNumLevels(int rpt_index);
  
  /* Returns the numeric value of the given variable in the given report */
  GADAP_STATUS getVarDbl(int rpt_index, int lev_index, int var_index, int array_index,
			  double *value);
  
  /* Returns the string value of the given variable in the given report */
  const char * getVarStr(int rpt_index, int lev_index, int var_index, int array_index);
  
 private:

  libdap::BaseType * unpackArray(libdap::BaseType * var, int array_index);
  
  libdap::BaseType * getVarPtr(int rpt_index, int lev_index, int var_index);
    
  libdap::Sequence *getLevels(int rpt_index);
  
  GADAP_DATASET dataset;
  string url;
  vector<gadap_varinfo> variables;
  libdap::DDS *data;
  libdap::Sequence *reports, *levels;
  bool hasLevels;
  GADAP_STN_QUERY *query;
  int stidIndex, timeIndex, latIndex, lonIndex, levIndex;
  int numIVars;

};

  
#endif