229 virtual int initialize(
const std::vector<string> &paths,
const std::vector<string> &options,
AccessMode mode, vector<size_t> bs);
230 virtual int initialize(
const std::vector<string> &paths,
const std::vector<string> &options) {
return (
initialize(paths, options, R, vector<size_t>())); }
302 _periodic = periodic;
303 for (
int i = _periodic.size(); i < 3; i++) _periodic.push_back(
false);
396 virtual std::vector<string>
getAuxVarNames()
const {
return (vector<string>()); }
404 bool getAtt(
string varname,
string attname, vector<double> &values)
const;
405 bool getAtt(
string varname,
string attname, vector<long> &values)
const;
406 bool getAtt(
string varname,
string attname,
string &values)
const;
414 virtual int getDimLensAtLevel(
string varname,
int level, std::vector<size_t> &dims_at_level, std::vector<size_t> &bs_at_level)
const = 0;
426 virtual int readRegion(
int fd,
const vector<size_t> &min,
const vector<size_t> &max,
float *region) = 0;
427 virtual int readRegion(
int fd,
const vector<size_t> &min,
const vector<size_t> &max,
double *region) = 0;
474 int DefineCoordVar(
string varname, std::vector<string> dimnames,
string time_dim_name,
string units,
int axis,
XType type,
bool compressed);
518 int DefineCoordVarUniform(
string varname, std::vector<string> dimname,
string time_dim_name,
string units,
int axis,
XType type,
bool compressed);
551 int DefineDataVar(
string varname, std::vector<string> dimnames, std::vector<string> coordvars,
string units,
XType type,
bool compressed);
577 int DefineDataVar(
string varname, std::vector<string> dimnames, std::vector<string> coordvars,
string units,
XType type,
double missing_value,
string maskvar);
597 int PutAtt(
string varname,
string attname,
XType type,
const vector<double> &values);
598 int PutAtt(
string varname,
string attname,
XType type,
const vector<long> &values);
599 int PutAtt(
string varname,
string attname,
XType type,
const string &values);
617 int CopyAtt(
const DC &src,
string varname,
string attname);
695 virtual int GetPath(
string varname,
size_t ts,
string &path,
size_t &file_ts,
size_t &max_ts
748 virtual int Write(
int fd,
const float *data) = 0;
749 virtual int Write(
int fd,
const int *data) = 0;
774 virtual int WriteSlice(
int fd,
const unsigned char *slice) = 0;
798 virtual int PutVar(
string varname,
int lod,
const float *data) = 0;
799 virtual int PutVar(
string varname,
int lod,
const int *data) = 0;
825 virtual int PutVar(
size_t ts,
string varname,
int lod,
const float *data) = 0;
826 virtual int PutVar(
size_t ts,
string varname,
int lod,
const int *data) = 0;
841 virtual int CopyVar(
DC &dc,
string varname,
int srclod,
int dstlod) = 0;
846 virtual int CopyVar(
DC &dc,
size_t ts,
string varname,
int srclod,
int dstlod) = 0;
867 virtual bool CompressionInfo(vector<size_t> bs,
string wname,
size_t &nlevels,
size_t &maxcratio)
const = 0;
882 virtual bool variableExists(
size_t ts,
string varname,
int reflevel = 0,
int lod = 0)
const = 0;
887 string _proj4StringOption;
888 std::vector<string> _newUniformVars;
906 #ifndef DOXYGEN_SKIP_THIS
908 bool _ValidDefineDimension(
string name,
size_t length)
const;
910 bool _ValidDefineCoordVar(
string varname, vector<string> dimnames,
string time_dim_name,
string units,
int axis,
XType type,
bool compressed)
const;
912 bool _valid_blocking(
const vector<DC::Dimension> &dimensions,
const vector<size_t> &bs,
const vector<string> &coordvars)
const;
914 bool _valid_mask_var(
string varname, vector<DC::Dimension> dimensions, vector<size_t> bs,
bool compressed,
string maskvar)
const;
916 bool _ValidDefineDataVar(
string varname, vector<string> dimnames, vector<string> coordnames,
string units,
XType type,
bool compressed,
bool has_missing,
string maskvar)
const;
918 bool _ValidCompressionBlock(vector<size_t> bs,
string wname, vector<size_t> cratios)
const;
920 bool _valid_dims(
const vector<DC::Dimension> &dims0,
const vector<size_t> &bs0,
const vector<DC::Dimension> &dims1,
const vector<size_t> &bs1)
const;
922 virtual int _WriteMasterMeta() = 0;
923 virtual int _ReadMasterMeta() = 0;
925 void _DefineMesh(
string meshname, vector<string> dim_names, vector<string> coord_vars);
927 int _DefineDataVar(
string varname, std::vector<string> dimnames, std::vector<string> coordvars,
string units,
XType type,
bool compressed,
bool has_missing,
double mv,
string maskvar);
929 vector<string> _GetCoordVarDimNames(
const CoordVar &var,
bool &time_varying)
const;
931 vector<string> _GetDataVarDimNames(
const DataVar &var,
bool &time_varying)
const;
933 int _DefineImplicitCoordVars(vector<string> dim_names, vector<string> coord_vars_in, vector<string> &coord_vars_out);
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.
Defines API for reading, writing, and appending data to a VAPOR Data Collection (Version 3)
virtual int initialize(const std::vector< string > &paths, const std::vector< string > &options, AccessMode mode, vector< size_t > bs)
virtual int PutVar(string varname, int lod, const float *data)=0
std::vector< string > getAttNames(string varname) const
std::vector< size_t > _bs
int PutAtt(string varname, string attname, XType type, const vector< double > &values)
virtual string getMapProjection() const
virtual int readRegion(int fd, const vector< size_t > &min, const vector< size_t > &max, double *region)=0
virtual int CopyVar(DC &dc, size_t ts, string varname, int srclod, int dstlod)=0
friend std::ostream & operator<<(std::ostream &o, const VDC &vdc)
bool getDataVarInfo(string varname, DC::DataVar &datavar) const
bool getAtt(string varname, string attname, vector< long > &values) const
int CopyAtt(const DC &src, string varname)
virtual string getMapProjectionDefault() const
virtual int Write(int fd, const float *data)=0
int DefineDimension(string dimname, size_t length, int axis)
bool getAtt(string varname, string attname, vector< double > &values) const
virtual int SetMapProjection(string projstring)
virtual int WriteSlice(int fd, const int *slice)=0
bool getCoordVarInfo(string varname, DC::CoordVar &cvar) const
virtual int closeVariable(int fd)=0
virtual bool getMesh(string mesh_name, DC::Mesh &mesh) const
XType getAttType(string varname, string attname) const
bool getDimension(string dimname, DC::Dimension &dimension) const
std::vector< string > getDimensionNames() const
virtual int SetMapProjection(string varname, string projstring)
int CopyAtt(const DC &src, string varname, string attname)
virtual int WriteSlice(int fd, const unsigned char *slice)=0
int PutAtt(string varname, string attname, XType type, const string &values)
void SetPeriodicBoundary(std::vector< bool > periodic)
virtual std::vector< string > getCoordVarNames() const
virtual int PutVar(string varname, int lod, const int *data)=0
std::map< string, Dimension > _dimsMap
std::map< string, CoordVar > _coordVars
bool getAtt(string varname, string attname, string &values) const
size_t getNumRefLevels(string varname) const
bool getBaseVarInfo(string varname, DC::BaseVar &var) const
int PutAtt(string varname, string attname, XType type, const vector< long > &values)
std::map< string, DataVar > _dataVars
virtual string getMapProjection(string varname) const
int SetCompressionBlock(string wname, std::vector< size_t > cratios)
virtual std::vector< string > getDataVarNames() const
int DefineCoordVarUniform(string varname, std::vector< string > dimname, string time_dim_name, string units, int axis, XType type, bool compressed)
std::vector< bool > GetPeriodicBoundary() const
virtual int initialize(const std::vector< string > &paths, const std::vector< string > &options)
std::map< string, Attribute > _atts
virtual int OpenVariableWrite(size_t ts, string varname, int lod=-1)=0
int DefineDataVar(string varname, std::vector< string > dimnames, std::vector< string > coordvars, string units, XType type, double missing_value, string maskvar)
virtual int CloseVariableWrite(int fd)=0
std::map< string, Mesh > _meshes
virtual int Write(int fd, const int *data)=0
virtual int WriteSlice(int fd, const float *slice)=0
virtual bool CompressionInfo(vector< size_t > bs, string wname, size_t &nlevels, size_t &maxcratio) const =0
virtual int openVariableRead(size_t ts, string varname, int level=0, int lod=0)=0
int DefineDataVar(string varname, std::vector< string > dimnames, std::vector< string > coordvars, string units, XType type, bool compressed)
int DefineCoordVar(string varname, std::vector< string > dimnames, string time_dim_name, string units, int axis, XType type, bool compressed)
int DefineDimension(string dimname, size_t length)
std::vector< size_t > _cratios
virtual int PutVar(size_t ts, string varname, int lod, const int *data)=0
virtual int getDimLensAtLevel(string varname, int level, std::vector< size_t > &dims_at_level, std::vector< size_t > &bs_at_level) const =0
virtual int PutVar(size_t ts, string varname, int lod, const float *data)=0
virtual int CopyVar(DC &dc, string varname, int srclod, int dstlod)=0
virtual int readRegion(int fd, const vector< size_t > &min, const vector< size_t > &max, float *region)=0
bool getAuxVarInfo(string varname, DC::AuxVar &var) const
virtual vector< size_t > getBlockSize() const
std::vector< string > getMeshNames() const
virtual int GetPath(string varname, size_t ts, string &path, size_t &file_ts, size_t &max_ts) const =0
void GetCompressionBlock(std::vector< size_t > &bs, string &wname, std::vector< size_t > &cratios) const
virtual std::vector< string > getAuxVarNames() const
virtual bool variableExists(size_t ts, string varname, int reflevel=0, int lod=0) const =0