VAPoR  0.1
DataMgrWC.h
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 
5 #ifndef _DataMgrWC_h_
6 #define _DataMgrWC_h_
7 
8 
9 #include <vector>
10 #include <string>
11 #include <vapor/DataMgr.h>
12 #include <vapor/WaveCodecIO.h>
13 #include <vapor/common.h>
14 
15 namespace VAPoR {
16 
17 //
29 //
30 class VDF_API DataMgrWC : public DataMgr, public WaveCodecIO {
31 
32 public:
33 
34  DataMgrWC(
35  const string &metafile,
36  size_t mem_size
37  );
38 
39  DataMgrWC(
40  const MetadataVDC &metadata,
41  size_t mem_size
42  );
43 
44 
45  virtual ~DataMgrWC() {};
46 
47 protected:
48 
49 
50  //
51  // Metadata methods
52  //
53 
54  virtual void _GetDim(size_t dim[3], int reflevel) const {
55  return(WaveCodecIO::GetDim(dim, reflevel));
56  };
57 
58  virtual void _GetBlockSize(size_t bs[3], int reflevel) const {
59  WaveCodecIO::GetBlockSize(bs, reflevel);
60  }
61 
62  virtual int _GetNumTransforms() const {
64  };
65 
66  virtual vector <size_t> _GetCRatios() const {
67  return(WaveCodecIO::GetCRatios());
68  };
69 
70  virtual string _GetCoordSystemType() const {
72  };
73 
74  virtual string _GetGridType() const {
75  return(WaveCodecIO::GetGridType());
76  };
77 
78  virtual vector<double> _GetExtents(size_t ts) const {
79  return(WaveCodecIO::GetExtents(ts));
80  };
81 
82  virtual vector <double> _GetTSXCoords(size_t ts) const {
83  return(WaveCodecIO::GetTSXCoords(ts));
84  }
85 
86  virtual vector <double> _GetTSYCoords(size_t ts) const {
87  return(WaveCodecIO::GetTSYCoords(ts));
88  }
89 
90  virtual vector <double> _GetTSZCoords(size_t ts) const {
91  return(WaveCodecIO::GetTSZCoords(ts));
92  }
93 
94  virtual long _GetNumTimeSteps() const {
96  };
97 
98  virtual string _GetMapProjection() const {
100  };
101 
102  virtual vector <string> _GetVariables3D() const {
103  return(WaveCodecIO::GetVariables3D());
104  };
105 
106  virtual vector <string> _GetVariables2DXY() const {
108  };
109 
110  virtual vector <string> _GetVariables2DXZ() const {
112  };
113 
114  virtual vector <string> _GetVariables2DYZ() const {
116  };
117 
118  virtual vector <string> _GetCoordinateVariables() const {
120  };
121 
122  virtual vector<long> _GetPeriodicBoundary() const {
124  };
125 
126  virtual vector<long> _GetGridPermutation() const {
128  };
129 
130  virtual double _GetTSUserTime(size_t ts) const {
131  return(WaveCodecIO::GetTSUserTime(ts));
132  };
133 
134  virtual void _GetTSUserTimeStamp(size_t ts, string &s) const {
136  };
137 
138 
139  virtual int _VariableExists(
140  size_t ts,
141  const char *varname,
142  int reflevel = 0,
143  int lod = 0
144  ) const {
145  return (WaveCodecIO::VariableExists(ts,varname,reflevel, lod));
146  };
147 
148 
149  virtual int _OpenVariableRead(
150  size_t timestep,
151  const char *varname,
152  int reflevel = 0,
153  int lod = 0
154  ) {
155  _ts = timestep; _varname = varname;
156  return(WaveCodecIO::OpenVariableRead(timestep, varname, reflevel, lod));
157  };
158 
159  virtual void _GetValidRegion(
160  size_t min[3], size_t max[3], int reflevel
161  ) const {
162  return(WaveCodecIO::GetValidRegion( min, max, reflevel));
163  };
164 
165  virtual const float *_GetDataRange() const {
166  return(WaveCodecIO::GetDataRange());
167  }
168 
169  virtual bool _GetMissingValue(string varname, float &value) const;
170 
171 
172  virtual int _BlockReadRegion(
173  const size_t bmin[3], const size_t bmax[3],
174  float *region
175  ) {
176  return(WaveCodecIO::BlockReadRegion(bmin, bmax, region, false));
177  };
178 
179  virtual int _CloseVariable() {
180  return (WaveCodecIO::CloseVariable());
181  };
182 
183 
184  size_t _ts;
185  string _varname;
186 };
187 
188 };
189 
190 #endif // _DataMgrWC_h_
virtual void _GetBlockSize(size_t bs[3], int reflevel) const
Definition: DataMgrWC.h:58
virtual int _GetNumTransforms() const
Definition: DataMgrWC.h:62
virtual int BlockReadRegion(const size_t bmin[3], const size_t bmax[3], float *region, bool unblock=true)
vector< string > GetVariables2DYZ() const
Definition: MetadataVDC.h:553
void GetTSUserTimeStamp(size_t ts, string &s) const
Definition: MetadataVDC.h:730
virtual double _GetTSUserTime(size_t ts) const
Definition: DataMgrWC.h:130
const float * GetDataRange() const
Definition: WaveCodecIO.h:332
void GetValidRegion(size_t min[3], size_t max[3], int reflevel) const
vector< long > GetPeriodicBoundary() const
Definition: MetadataVDC.h:601
#define VDF_API
Definition: common.h:61
virtual vector< string > _GetCoordinateVariables() const
Definition: DataMgrWC.h:118
A cache based data reader.
Definition: DataMgr.h:39
virtual vector< string > _GetVariables2DYZ() const
Definition: DataMgrWC.h:114
virtual int _OpenVariableRead(size_t timestep, const char *varname, int reflevel=0, int lod=0)
Definition: DataMgrWC.h:149
virtual int CloseVariable()
virtual vector< double > _GetTSYCoords(size_t ts) const
Definition: DataMgrWC.h:86
vector< double > GetTSXCoords(size_t ts) const
Definition: MetadataVDC.h:805
virtual vector< size_t > GetCRatios() const
Definition: MetadataVDC.h:343
virtual string _GetMapProjection() const
Definition: DataMgrWC.h:98
virtual int GetNumTransforms() const
virtual vector< double > _GetTSXCoords(size_t ts) const
Definition: DataMgrWC.h:82
virtual vector< double > _GetTSZCoords(size_t ts) const
Definition: DataMgrWC.h:90
virtual int _CloseVariable()
Definition: DataMgrWC.h:179
virtual int _BlockReadRegion(const size_t bmin[3], const size_t bmax[3], float *region)
Definition: DataMgrWC.h:172
virtual void GetDim(size_t dim[3], int reflevel=0) const
A class for managing data set metadata.
Definition: MetadataVDC.h:92
virtual vector< string > _GetVariables3D() const
Definition: DataMgrWC.h:102
virtual vector< string > _GetVariables2DXZ() const
Definition: DataMgrWC.h:110
virtual vector< double > _GetExtents(size_t ts) const
Definition: DataMgrWC.h:78
virtual int _VariableExists(size_t ts, const char *varname, int reflevel=0, int lod=0) const
Definition: DataMgrWC.h:139
virtual const float * _GetDataRange() const
Definition: DataMgrWC.h:165
virtual const size_t * GetBlockSize() const
Definition: MetadataVDC.h:264
virtual vector< size_t > _GetCRatios() const
Definition: DataMgrWC.h:66
A cache based data reader.
Definition: DataMgrWC.h:30
vector< double > GetTSZCoords(size_t ts) const
Definition: MetadataVDC.h:819
vector< double > GetTSYCoords(size_t ts) const
Definition: MetadataVDC.h:812
A sub-region reader for VDF files.
Definition: WaveCodecIO.h:38
string GetCoordSystemType() const
Definition: MetadataVDC.h:406
virtual int OpenVariableRead(size_t timestep, const char *varname, int reflevel=0, int lod=0)
virtual string _GetGridType() const
Definition: DataMgrWC.h:74
virtual void _GetDim(size_t dim[3], int reflevel) const
Definition: DataMgrWC.h:54
virtual void _GetValidRegion(size_t min[3], size_t max[3], int reflevel) const
Definition: DataMgrWC.h:159
double GetTSUserTime(size_t ts) const
Definition: MetadataVDC.h:720
virtual long _GetNumTimeSteps() const
Definition: DataMgrWC.h:94
vector< string > GetCoordinateVariables() const
Definition: MetadataVDC.h:506
virtual string GetMapProjection() const
virtual void _GetTSUserTimeStamp(size_t ts, string &s) const
Definition: DataMgrWC.h:134
long GetNumTimeSteps() const
vector< double > GetExtents(size_t ts=0) const
virtual vector< string > _GetVariables2DXY() const
Definition: DataMgrWC.h:106
vector< string > GetVariables2DXY() const
Definition: MetadataVDC.h:543
vector< string > GetVariables3D() const
Definition: MetadataVDC.h:498
virtual ~DataMgrWC()
Definition: DataMgrWC.h:45
string GetGridType() const
Definition: MetadataVDC.h:377
virtual string _GetCoordSystemType() const
Definition: DataMgrWC.h:70
virtual vector< long > _GetGridPermutation() const
Definition: DataMgrWC.h:126
virtual vector< long > _GetPeriodicBoundary() const
Definition: DataMgrWC.h:122
vector< string > GetVariables2DXZ() const
Definition: MetadataVDC.h:548
virtual int VariableExists(size_t ts, const char *varname, int reflevel=0, int lod=0) const
vector< long > GetGridPermutation() const
Definition: MetadataVDC.h:662