MI - Fimex
Public Member Functions | List of all members
MetNoFimex::Data Class Referenceabstract

#include <Data.h>

Public Member Functions

virtual ~Data ()=0
 
virtual size_t size () const =0
 size of the data More...
 
virtual int bytes_for_one () const =0
 sizeof the data-impl datatype More...
 
virtual void * getDataPtr ()=0
 
virtual void toStream (std::ostream &, std::string separator="") const =0
 printing of the current data to ostream, with optional separator More...
 
 MIFI_DEPRECATED (virtual const boost::shared_array< char > asConstChar() const)=0
 retrieve data as char More...
 
virtual boost::shared_array< char > asChar () const =0
 retrieve data as char More...
 
 MIFI_DEPRECATED (virtual const boost::shared_array< short > asConstShort() const)=0
 retrieve data as short More...
 
virtual boost::shared_array< short > asShort () const =0
 retrieve data as short More...
 
 MIFI_DEPRECATED (virtual const boost::shared_array< int > asConstInt() const)=0
 retrieve data as int More...
 
virtual boost::shared_array< int > asInt () const =0
 retrieve data as int More...
 
 MIFI_DEPRECATED (virtual const boost::shared_array< long long > asConstInt64() const)=0
 retrieve data as int64 More...
 
virtual boost::shared_array< long long > asInt64 () const =0
 retrieve data as int64 More...
 
 MIFI_DEPRECATED (virtual const boost::shared_array< unsigned char > asConstUChar() const)=0
 retrieve data as uchar More...
 
virtual boost::shared_array< unsigned char > asUChar () const =0
 retrieve data as uchar More...
 
 MIFI_DEPRECATED (virtual const boost::shared_array< unsigned short > asConstUShort() const)=0
 retrieve data as short More...
 
virtual boost::shared_array< unsigned short > asUShort () const =0
 retrieve data as short More...
 
 MIFI_DEPRECATED (virtual const boost::shared_array< unsigned int > asConstUInt() const)=0
 retrieve data as uint More...
 
virtual boost::shared_array< unsigned int > asUInt () const =0
 retrieve data as uint More...
 
 MIFI_DEPRECATED (virtual const boost::shared_array< unsigned long long > asConstUInt64() const)=0
 retrieve data as uint64 More...
 
virtual boost::shared_array< unsigned long long > asUInt64 () const =0
 retrieve data as uint64 More...
 
 MIFI_DEPRECATED (virtual const boost::shared_array< float > asConstFloat() const)=0
 retrieve data as float More...
 
virtual boost::shared_array< float > asFloat () const =0
 retrieve data as float (eventually copy) More...
 
 MIFI_DEPRECATED (virtual const boost::shared_array< double > asConstDouble() const)=0
 retrieve data as double More...
 
virtual boost::shared_array< double > asDouble () const =0
 retrieve data as double More...
 
virtual boost::shared_array< std::stringasStrings () const =0
 retrieve data as array of strings More...
 
virtual std::string asString (std::string separator="") const =0
 retrieve the whole array as a string (with possible separator) More...
 
virtual double getDouble (size_t pos)=0
 get a value at the desired position More...
 
virtual long long getLongLong (size_t pos)=0
 get a value at the desired position More...
 
virtual void setValue (size_t pos, double val)=0
 set a value at the desired position More...
 
virtual void setValues (size_t startPos, const Data &data, size_t first=0, size_t end=-1)=0
 
virtual void setAllValues (double val)=0
 
virtual DataPtr clone () const =0
 duplicate the data More...
 
virtual DataPtr slice (std::vector< size_t > orgDimSize, std::vector< size_t > startDims, std::vector< size_t > outputDimSize)=0
 get a multi-dimensional slice of the data More...
 
virtual DataPtr convertDataType (double oldFill, double oldScale, double oldOffset, CDMDataType newType, double newFill, double newScale, double newOffset)=0
 convert the datatype from one type,fill,scale,offset to another More...
 
virtual DataPtr convertDataType (double oldFill, double oldScale, double oldOffset, boost::shared_ptr< UnitsConverter > unitConverter, CDMDataType newType, double newFill, double newScale, double newOffset)=0
 
virtual CDMDataType getDataType () const =0
 

Detailed Description

General class for storing different basic array pointers plus length

Constructor & Destructor Documentation

virtual MetNoFimex::Data::~Data ( )
pure virtual

Member Function Documentation

virtual boost::shared_array<char> MetNoFimex::Data::asChar ( ) const
pure virtual

retrieve data as char

virtual boost::shared_array<double> MetNoFimex::Data::asDouble ( ) const
pure virtual

retrieve data as double

virtual boost::shared_array<float> MetNoFimex::Data::asFloat ( ) const
pure virtual

retrieve data as float (eventually copy)

virtual boost::shared_array<int> MetNoFimex::Data::asInt ( ) const
pure virtual

retrieve data as int

virtual boost::shared_array<long long> MetNoFimex::Data::asInt64 ( ) const
pure virtual

retrieve data as int64

virtual boost::shared_array<short> MetNoFimex::Data::asShort ( ) const
pure virtual

retrieve data as short

virtual std::string MetNoFimex::Data::asString ( std::string  separator = "") const
pure virtual

retrieve the whole array as a string (with possible separator)

virtual boost::shared_array<std::string> MetNoFimex::Data::asStrings ( ) const
pure virtual

retrieve data as array of strings

virtual boost::shared_array<unsigned char> MetNoFimex::Data::asUChar ( ) const
pure virtual

retrieve data as uchar

virtual boost::shared_array<unsigned int> MetNoFimex::Data::asUInt ( ) const
pure virtual

retrieve data as uint

virtual boost::shared_array<unsigned long long> MetNoFimex::Data::asUInt64 ( ) const
pure virtual

retrieve data as uint64

virtual boost::shared_array<unsigned short> MetNoFimex::Data::asUShort ( ) const
pure virtual

retrieve data as short

virtual int MetNoFimex::Data::bytes_for_one ( ) const
pure virtual

sizeof the data-impl datatype

virtual DataPtr MetNoFimex::Data::clone ( ) const
pure virtual

duplicate the data

The clone operation generates a real duplicate of the data. The internal array-data will be copied.

virtual DataPtr MetNoFimex::Data::convertDataType ( double  oldFill,
double  oldScale,
double  oldOffset,
CDMDataType  newType,
double  newFill,
double  newScale,
double  newOffset 
)
pure virtual

convert the datatype from one type,fill,scale,offset to another

virtual DataPtr MetNoFimex::Data::convertDataType ( double  oldFill,
double  oldScale,
double  oldOffset,
boost::shared_ptr< UnitsConverter unitConverter,
CDMDataType  newType,
double  newFill,
double  newScale,
double  newOffset 
)
pure virtual
virtual void* MetNoFimex::Data::getDataPtr ( )
pure virtual
virtual CDMDataType MetNoFimex::Data::getDataType ( ) const
pure virtual

return the CDMDataType of this data

virtual double MetNoFimex::Data::getDouble ( size_t  pos)
pure virtual

get a value at the desired position

Usefull in combination with MetNoFimex::Index and getDims().

virtual long long MetNoFimex::Data::getLongLong ( size_t  pos)
pure virtual

get a value at the desired position

Usefull in combination with MetNoFimex::Index and getDims().

MetNoFimex::Data::MIFI_DEPRECATED ( virtual const boost::shared_array< char > asConstChar()  const)
pure virtual

retrieve data as char

Deprecated:
use asChar()
MetNoFimex::Data::MIFI_DEPRECATED ( virtual const boost::shared_array< short > asConstShort()  const)
pure virtual

retrieve data as short

Deprecated:
use asShort()
MetNoFimex::Data::MIFI_DEPRECATED ( virtual const boost::shared_array< int > asConstInt()  const)
pure virtual

retrieve data as int

Deprecated:
use asInt()
MetNoFimex::Data::MIFI_DEPRECATED ( virtual const boost::shared_array< long long > asConstInt64()  const)
pure virtual

retrieve data as int64

Deprecated:
use asInt64()
MetNoFimex::Data::MIFI_DEPRECATED ( virtual const boost::shared_array< unsigned char > asConstUChar()  const)
pure virtual

retrieve data as uchar

Deprecated:
use asUChar()
MetNoFimex::Data::MIFI_DEPRECATED ( virtual const boost::shared_array< unsigned short > asConstUShort()  const)
pure virtual

retrieve data as short

MetNoFimex::Data::MIFI_DEPRECATED ( virtual const boost::shared_array< unsigned int > asConstUInt()  const)
pure virtual

retrieve data as uint

MetNoFimex::Data::MIFI_DEPRECATED ( virtual const boost::shared_array< unsigned long long > asConstUInt64()  const)
pure virtual

retrieve data as uint64

MetNoFimex::Data::MIFI_DEPRECATED ( virtual const boost::shared_array< float > asConstFloat()  const)
pure virtual

retrieve data as float

MetNoFimex::Data::MIFI_DEPRECATED ( virtual const boost::shared_array< double > asConstDouble()  const)
pure virtual

retrieve data as double

virtual void MetNoFimex::Data::setAllValues ( double  val)
pure virtual

set all values to the submitted value

Parameters
valvalue to set
virtual void MetNoFimex::Data::setValue ( size_t  pos,
double  val 
)
pure virtual

set a value at the desired position

virtual void MetNoFimex::Data::setValues ( size_t  startPos,
const Data data,
size_t  first = 0,
size_t  end = -1 
)
pure virtual

set the values from another Data implementation

Parameters
startPosthe first position the data should be written to
datathe other data-source
firstthe first data-entry
endthe last (excluded) data-entry, defaults to MAX size_t, automatically shrunken to fit size
virtual size_t MetNoFimex::Data::size ( ) const
pure virtual

size of the data

virtual DataPtr MetNoFimex::Data::slice ( std::vector< size_t >  orgDimSize,
std::vector< size_t >  startDims,
std::vector< size_t >  outputDimSize 
)
pure virtual

get a multi-dimensional slice of the data

This slices a multidimensional chunk out of the data. All parameters must be vectors of the same size (dimension of array). The first dimension is the fastest moving index (fortran arrays)

Parameters
orgDimSizethe dimensions of this vector. The product of all orgDimSizes must equal to data.size.
startDimsThe start-position in the original data to fetch data from
outputDimSizethe size of the output data
Returns
a Data of the size of outputDimSize with the same datatype as the original type
Exceptions
CDMExceptionon dimension mismatch: (start+size > orgDimSize) or (Product(orgDimSize) != size)
virtual void MetNoFimex::Data::toStream ( std::ostream ,
std::string  separator = "" 
) const
pure virtual

printing of the current data to ostream, with optional separator


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