MI - Fimex
Public Member Functions | List of all members
MetNoFimex::CDMVariable Class Reference

#include <fimex/CDMVariable.h>

Inheritance diagram for MetNoFimex::CDMVariable:
MetNoFimex::CDMNamedEntity MetNoFimex::CoordinateAxis

Public Member Functions

 CDMVariable (std::string name, CDMDataType datatype, std::vector< std::string > shape)
 
virtual ~CDMVariable ()
 
const std::stringgetName () const
 
void setName (std::string newName)
 
CDMDataType getDataType () const
 
void setDataType (CDMDataType type)
 
const std::vector< std::string > & getShape () const
 
void setShape (std::vector< std::string > newShape)
 
void setAsSpatialVector (const std::string &counterpart, const std::string &direction)
 
bool isSpatialVector () const
 
const std::stringgetSpatialVectorCounterpart () const
 get the spatial counterpart of this vector More...
 
const std::stringgetSpatialVectorDirection () const
 get the possible directions of this spatial vector (comma-separated string) More...
 
bool checkDimension (const std::string &dimension) const
 
void toXMLStream (std::ostream &out) const
 print a xml representation to the stream without attributes More...
 
void toXMLStream (std::ostream &out, const std::vector< CDMAttribute > &attrs) const
 print a xml representation to the stream with attributes More...
 
void setData (DataPtr data)
 add data to the variable More...
 
const DataPtr getData () const
 retrieve volatile data from this variable More...
 
int hasData () const
 check if real data has been set with setData() (null-pointer reference returns false) More...
 
- Public Member Functions inherited from MetNoFimex::CDMNamedEntity
virtual ~CDMNamedEntity ()=0
 

Constructor & Destructor Documentation

MetNoFimex::CDMVariable::CDMVariable ( std::string  name,
CDMDataType  datatype,
std::vector< std::string shape 
)
explicit
virtual MetNoFimex::CDMVariable::~CDMVariable ( )
virtual

Member Function Documentation

bool MetNoFimex::CDMVariable::checkDimension ( const std::string dimension) const

check the dimension of a variable

Parameters
dimensionthe dimension to check for

Referenced by getSpatialVectorDirection().

const DataPtr MetNoFimex::CDMVariable::getData ( ) const
inline

retrieve volatile data from this variable

Retrieve data, but only if it has been set previously by setData() this method will not try to read data from the disk. Use CDMReader::getData(const std::string& varName) to get the data from memory or from disk.

CDMDataType MetNoFimex::CDMVariable::getDataType ( ) const
inline
const std::string& MetNoFimex::CDMVariable::getName ( ) const
inlinevirtual
const std::vector<std::string>& MetNoFimex::CDMVariable::getShape ( ) const
inline
const std::string& MetNoFimex::CDMVariable::getSpatialVectorCounterpart ( ) const
inline

get the spatial counterpart of this vector

const std::string& MetNoFimex::CDMVariable::getSpatialVectorDirection ( ) const
inline

get the possible directions of this spatial vector (comma-separated string)

References checkDimension(), and toXMLStream().

int MetNoFimex::CDMVariable::hasData ( ) const
inline

check if real data has been set with setData() (null-pointer reference returns false)

bool MetNoFimex::CDMVariable::isSpatialVector ( ) const
inline

test if this variable has been declared to be a spatial vector

void MetNoFimex::CDMVariable::setAsSpatialVector ( const std::string counterpart,
const std::string direction 
)

Declare this variable to be part of a spatial vector, e.g. (x-wind, y-wind)

Parameters
counterpartname of the other variable being part of this vector
directioncomma-separated list of possible directions for this vector, e.g. "x,longitude"

Referenced by setShape().

void MetNoFimex::CDMVariable::setData ( DataPtr  data)
inline

add data to the variable

void MetNoFimex::CDMVariable::setDataType ( CDMDataType  type)
inline
void MetNoFimex::CDMVariable::setName ( std::string  newName)
inline
void MetNoFimex::CDMVariable::setShape ( std::vector< std::string newShape)
inline

References setAsSpatialVector().

void MetNoFimex::CDMVariable::toXMLStream ( std::ostream out) const

print a xml representation to the stream without attributes

Referenced by getSpatialVectorDirection().

void MetNoFimex::CDMVariable::toXMLStream ( std::ostream out,
const std::vector< CDMAttribute > &  attrs 
) const

print a xml representation to the stream with attributes


The documentation for this class was generated from the following file: