41 virtual int initialize(
const vector<string> &paths,
const std::vector<string> &options);
104 virtual bool getAtt(
string varname,
string attname, vector<double> &values)
const;
105 virtual bool getAtt(
string varname,
string attname, vector<long> &values)
const;
106 virtual bool getAtt(
string varname,
string attname,
string &values)
const;
118 virtual int getDimLensAtLevel(
string varname,
int level, std::vector<size_t> &dims_at_level, std::vector<size_t> &bs_at_level)
const;
119 virtual int getDimLensAtLevel(
string varname,
int level, std::vector<size_t> &dims_at_level, std::vector<size_t> &bs_at_level,
long ts)
const;
124 virtual int openVariableRead(
size_t ts,
string varname,
int,
int) {
return (DCRAM::openVariableRead(ts, varname)); }
135 virtual int readRegion(
int fd,
const vector<size_t> &min,
const vector<size_t> &max,
float *region) {
return (_readRegionTemplate(fd, min, max, region)); }
136 virtual int readRegion(
int fd,
const vector<size_t> &min,
const vector<size_t> &max,
int *region) {
return (_readRegionTemplate(fd, min, max, region)); }
137 virtual int readRegion(
int fd,
const vector<size_t> &min,
const vector<size_t> &max,
double *region) {
VAssert(!
"DCRAM: double data not supported");
return -1; }
141 virtual int readRegionBlock(
int fd,
const vector<size_t> &min,
const vector<size_t> &max,
float *region) {
return (_readRegionTemplate(fd, min, max, region)); };
142 virtual int readRegionBlock(
int fd,
const vector<size_t> &min,
const vector<size_t> &max,
int *region) {
return (_readRegionTemplate(fd, min, max, region)); }
143 virtual int readRegionBlock(
int fd,
const vector<size_t> &min,
const vector<size_t> &max,
double *region) {
VAssert(!
"DCRAM: double data not supported");
return -1; }
147 virtual bool variableExists(
size_t ts,
string varname,
int reflevel = 0,
int lod = 0)
const;
150 std::map<string, DC::Dimension> _dimsMap;
151 std::map<string, DC::CoordVar> _coordVarsMap;
152 std::map<string, DC::AuxVar> _auxVarsMap;
153 std::map<string, DC::Mesh> _meshMap;
154 std::map<string, DC::DataVar> _dataVarsMap;
156 int _fakeVarsFileCounterStart = 10000;
157 int _fakeVarsFileCounter = _fakeVarsFileCounterStart;
158 std::map<int, string> _fdMap;
161 template<
class T>
int _readRegionTemplate(
int fd,
const vector<size_t> &min,
const vector<size_t> &max, T *region);
163 template<
class T>
bool _getAttTemplate(
string varname,
string attname, T &values)
const;
DCRAM is a virtual data collection used to allow data to be loaded from ram. Specifically,...
virtual int readRegion(int fd, const vector< size_t > &min, const vector< size_t > &max, int *region)
virtual string getMapProjection() const
virtual bool getMesh(string mesh_name, DC::Mesh &mesh) const
virtual bool getDimension(string dimname, DC::Dimension &dimension, long ts) const
virtual bool getDimension(string dimname, DC::Dimension &dimension) const
virtual std::vector< string > getAuxVarNames() const
virtual bool getAtt(string varname, string attname, vector< double > &values) const
virtual int readRegionBlock(int fd, const vector< size_t > &min, const vector< size_t > &max, double *region)
virtual int readRegionBlock(int fd, const vector< size_t > &min, const vector< size_t > &max, float *region)
virtual int openVariableRead(size_t ts, string varname, int, int)
map< string, float * > _dataMap
virtual size_t getNumRefLevels(string varname) const
virtual int readRegionBlock(int fd, const vector< size_t > &min, const vector< size_t > &max, int *region)
virtual bool getAtt(string varname, string attname, vector< long > &values) const
virtual int readRegion(int fd, const vector< size_t > &min, const vector< size_t > &max, double *region)
virtual int initialize(const vector< string > &paths, const std::vector< string > &options)
virtual int getDimLensAtLevel(string varname, int level, std::vector< size_t > &dims_at_level, std::vector< size_t > &bs_at_level) const
virtual bool getAtt(string varname, string attname, string &values) const
std::vector< string > getMeshNames() const
virtual bool getAuxVarInfo(string varname, DC::AuxVar &var) const
virtual std::vector< string > getCoordVarNames() const
virtual std::vector< string > getAttNames(string varname) const
virtual bool getCoordVarInfo(string varname, DC::CoordVar &cvar) const
void AddMesh(const DC::Mesh &mesh)
void copyVarData(const DC::BaseVar &var, const float *buf, const size_t size)
virtual bool getDataVarInfo(string varname, DC::DataVar &datavar) const
virtual int readRegion(int fd, const vector< size_t > &min, const vector< size_t > &max, float *region)
void AddCoordVar(const DC::CoordVar &var, const float *buf)
virtual std::vector< string > getDimensionNames() const
virtual bool getBaseVarInfo(string varname, DC::BaseVar &var) const
virtual int closeVariable(int fd)
void AddDataVar(const DC::DataVar &var, const float *buf)
virtual int openVariableRead(size_t ts, string varname)
virtual int getDimLensAtLevel(string varname, int level, std::vector< size_t > &dims_at_level, std::vector< size_t > &bs_at_level, long ts) const
void AddDimension(const DC::Dimension &dim)
virtual std::vector< string > getDataVarNames() const
virtual XType getAttType(string varname, string attname) const
virtual bool variableExists(size_t ts, string varname, int reflevel=0, int lod=0) const
Auxiliary variable metadata.
Base class for storing variable metadata.
Coordinate variable metadata.
Metadata describing a named dimension length.
Metadata describing a computational mesh.
A Template Method design pattern for reading a collection of data.
XType
External storage types for primitive data.