#include <CDMReader.h>
Public Member Functions | |
CDMReader () | |
virtual | ~CDMReader () |
virtual const CDM & | getCDM () const |
virtual const boost::shared_ptr< Data > | getDataSlice (const std::string &varName, size_t unLimDimPos)=0 throw (CDMException) |
data-reading function to be called from the CDMWriter | |
virtual const boost::shared_ptr< Data > | getData (const std::string &varName) throw (CDMException) |
data-reading function to be called from the CDMWriter | |
Protected Member Functions | |
virtual const boost::shared_ptr< Data > | getDataSliceFromMemory (const CDMVariable &variable, size_t unLimDimPos=0) throw (CDMException) |
Protected Attributes | |
CDM | cdm |
The CDMReader is the basic interface for reading and manipulation of the cdm datastructure. The CDMWriter will work with an implementation of the CDMReader and read the included data in the cdm or the data provided through the implementation of the CDMReader#getDataSlice
MetNoFimex::CDMReader::CDMReader | ( | ) | [inline] |
virtual MetNoFimex::CDMReader::~CDMReader | ( | ) | [inline, virtual] |
virtual const CDM& MetNoFimex::CDMReader::getCDM | ( | ) | const [inline, virtual] |
virtual const boost::shared_ptr<Data> MetNoFimex::CDMReader::getDataSlice | ( | const std::string & | varName, | |
size_t | unLimDimPos | |||
) | throw (CDMException) [pure virtual] |
data-reading function to be called from the CDMWriter
This function needs to be implemented by the CDMReader. It should provide the data for each variable, either by reading from disk, converting from another CDMReader or reading from an in-memory data-section.
This function should retrieve the whole data for a dataset without unlimited dimension if the unLimDimPos == 0.
varName | name of the variable to read | |
unLimDimPos | (optional) if the variable contains a unlimited dimension (max one allowed) an slice of this position is returned |
Implemented in MetNoFimex::CDMExtractor, MetNoFimex::CDMTimeInterpolator, and MetNoFimex::NetCDF_CF10_CDMReader.
virtual const boost::shared_ptr<Data> MetNoFimex::CDMReader::getData | ( | const std::string & | varName | ) | throw (CDMException) [virtual] |
data-reading function to be called from the CDMWriter
The getData function is a convenience function to retrieve all data from a file. It is implemented using getDataSlice. It should be used with care, since a complete variable might be bigger than available memory.
varName | name of the variable to read |
virtual const boost::shared_ptr<Data> MetNoFimex::CDMReader::getDataSliceFromMemory | ( | const CDMVariable & | variable, | |
size_t | unLimDimPos = 0 | |||
) | throw (CDMException) [protected, virtual] |
Read the data from the variable.hasData() and select the correct unLimDimPos. This function should be used internally from getDataSlice.
variable | the variable to read data from | |
unLimDimPos | (optional) the unlimited position |
CDM MetNoFimex::CDMReader::cdm [protected] |
Referenced by MetNoFimex::FeltCDMReader::getCDM(), and getCDM().