#include <DataImpl.h>
Public Member Functions | |
DataImpl (long length) | |
constructor where the array will be automatically allocated | |
DataImpl (boost::shared_array< C > array, long length) | |
virtual | ~DataImpl () |
virtual size_t | size () const |
size of the data | |
virtual int | bytes_for_one () const |
sizeof the data-impl datatype | |
virtual void * | getDataPtr () |
virtual void | toStream (std::ostream &os, std::string separator="") const |
printing of the current data to ostream, with optional separator | |
virtual const boost::shared_array< C > | asBase () const |
get the datapointer of the data | |
template<typename T> | |
const boost::shared_array< T > | as () const |
template<typename T> | |
boost::shared_array< T > | as () |
virtual const boost::shared_array< char > | asConstChar () const |
retrieve data as char | |
virtual boost::shared_array< char > | asChar () |
retrieve data as char | |
virtual const boost::shared_array< short > | asConstShort () const |
retrieve data as short | |
virtual boost::shared_array < short > | asShort () |
retrieve data as short | |
virtual const boost::shared_array< int > | asConstInt () const |
retrieve data as int | |
virtual boost::shared_array< int > | asInt () |
retrieve data as int | |
virtual const boost::shared_array< float > | asConstFloat () const |
retrieve data as float | |
virtual boost::shared_array < float > | asFloat () |
retrieve data as float (eventually copy) | |
virtual const boost::shared_array< double > | asConstDouble () const |
retrieve data as double | |
virtual boost::shared_array < double > | asDouble () |
retrieve data as double | |
virtual std::string | asString (std::string separator="") const |
retrieve the whole array as a string (with possible separator) | |
virtual void | setValue (long pos, double val) |
set a value at the desired position | |
virtual void | setValues (size_t startPos, const Data &data, size_t first=0, size_t last=-1) throw (CDMException) |
virtual void | setAllValues (double val) |
virtual boost::shared_ptr< Data > | slice (std::vector< size_t > orgDimSize, std::vector< size_t > startDims, std::vector< size_t > outputDimSize) throw (CDMException) |
get a multi-dimensional slice of the data | |
virtual boost::shared_ptr< Data > | convertDataType (double oldFill, double oldScale, double oldOffset, CDMDataType newType, double newFill, double newScale, double newOffset) throw (CDMException) |
convert the datatype from one type,fill,scale,offset to another | |
virtual CDMDataType | getDataType () const |
template<class InputIterator> | |
void | setValues (InputIterator begin, InputIterator end, size_t dataStartPos=0) throw (CDMException) |
template<> | |
void | setValues (size_t startPos, const Data &data, size_t first, size_t last) throw(CDMException) |
template<> | |
void | setValues (size_t startPos, const Data &data, size_t first, size_t last) throw(CDMException) |
template<> | |
void | setValues (size_t startPos, const Data &data, size_t first, size_t last) throw(CDMException) |
template<> | |
void | setValues (size_t startPos, const Data &data, size_t first, size_t last) throw(CDMException) |
template<> | |
void | setValues (size_t startPos, const Data &data, size_t first, size_t last) throw(CDMException) |
MetNoFimex::DataImpl< C >::DataImpl | ( | long | length | ) | [inline, explicit] |
constructor where the array will be automatically allocated
MetNoFimex::DataImpl< C >::DataImpl | ( | boost::shared_array< C > | array, | |
long | length | |||
) | [inline, explicit] |
virtual MetNoFimex::DataImpl< C >::~DataImpl | ( | ) | [inline, virtual] |
virtual size_t MetNoFimex::DataImpl< C >::size | ( | ) | const [inline, virtual] |
virtual int MetNoFimex::DataImpl< C >::bytes_for_one | ( | ) | const [inline, virtual] |
virtual void* MetNoFimex::DataImpl< C >::getDataPtr | ( | ) | [inline, virtual] |
Implements MetNoFimex::Data.
void MetNoFimex::DataImpl< C >::toStream | ( | std::ostream & | , | |
std::string | separator = "" | |||
) | const [inline, virtual] |
printing of the current data to ostream, with optional separator
Implements MetNoFimex::Data.
Referenced by MetNoFimex::DataImpl< C >::asString().
virtual const boost::shared_array<C> MetNoFimex::DataImpl< C >::asBase | ( | ) | const [inline, virtual] |
get the datapointer of the data
const boost::shared_array<T> MetNoFimex::DataImpl< C >::as | ( | ) | const [inline] |
general conversion function, not in base since template methods not allowed
boost::shared_array<T> MetNoFimex::DataImpl< C >::as | ( | ) | [inline] |
virtual const boost::shared_array<char> MetNoFimex::DataImpl< C >::asConstChar | ( | ) | const [inline, virtual] |
virtual boost::shared_array<char> MetNoFimex::DataImpl< C >::asChar | ( | ) | [inline, virtual] |
virtual const boost::shared_array<short> MetNoFimex::DataImpl< C >::asConstShort | ( | ) | const [inline, virtual] |
virtual boost::shared_array<short> MetNoFimex::DataImpl< C >::asShort | ( | ) | [inline, virtual] |
virtual const boost::shared_array<int> MetNoFimex::DataImpl< C >::asConstInt | ( | ) | const [inline, virtual] |
virtual boost::shared_array<int> MetNoFimex::DataImpl< C >::asInt | ( | ) | [inline, virtual] |
virtual const boost::shared_array<float> MetNoFimex::DataImpl< C >::asConstFloat | ( | ) | const [inline, virtual] |
virtual boost::shared_array<float> MetNoFimex::DataImpl< C >::asFloat | ( | ) | [inline, virtual] |
virtual const boost::shared_array<double> MetNoFimex::DataImpl< C >::asConstDouble | ( | ) | const [inline, virtual] |
virtual boost::shared_array<double> MetNoFimex::DataImpl< C >::asDouble | ( | ) | [inline, virtual] |
std::string MetNoFimex::DataImpl< C >::asString | ( | std::string | separator = "" |
) | const [inline, virtual] |
retrieve the whole array as a string (with possible separator)
Implements MetNoFimex::Data.
References std::basic_ostringstream< _CharT, _Traits, _Alloc >::str(), and MetNoFimex::DataImpl< C >::toStream().
virtual void MetNoFimex::DataImpl< C >::setValue | ( | long | pos, | |
double | val | |||
) | [inline, virtual] |
virtual void MetNoFimex::DataImpl< C >::setValues | ( | size_t | startPos, | |
const Data & | data, | |||
size_t | first = 0 , |
|||
size_t | end = -1 | |||
) | throw (CDMException) [virtual] |
set the values from another Data implementation
startPos | the first position the data should be written to | |
data | the other data-source | |
first | the first data-entry | |
end | the last (excluded) data-entry, defaults to MAX size_t, automatically shrunken to fit size |
Implements MetNoFimex::Data.
virtual void MetNoFimex::DataImpl< C >::setAllValues | ( | double | val | ) | [inline, virtual] |
boost::shared_ptr< Data > MetNoFimex::DataImpl< C >::slice | ( | std::vector< size_t > | orgDimSize, | |
std::vector< size_t > | startDims, | |||
std::vector< size_t > | outputDimSize | |||
) | throw (CDMException) [inline, 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)
orgDimSize | the dimensions of this vector. The product of all orgDimSizes must equal to data.size. | |
startDims | The start-position in the original data to fetch data from | |
outputDimSize | the size of the output data |
CDMException | on dimension mismatch: (start+size > orgDimSize) or (Product(orgDimSize) != size) |
Implements MetNoFimex::Data.
References MetNoFimex::recursiveCopyMultiDimData(), std::vector< _Tp, _Alloc >::size(), and MetNoFimex::type2string().
boost::shared_ptr< Data > MetNoFimex::DataImpl< C >::convertDataType | ( | double | oldFill, | |
double | oldScale, | |||
double | oldOffset, | |||
CDMDataType | newType, | |||
double | newFill, | |||
double | newScale, | |||
double | newOffset | |||
) | throw (CDMException) [inline, virtual] |
convert the datatype from one type,fill,scale,offset to another
Implements MetNoFimex::Data.
References MetNoFimex::CDM_CHAR, MetNoFimex::CDM_DOUBLE, MetNoFimex::CDM_FLOAT, MetNoFimex::CDM_INT, MetNoFimex::CDM_NAT, MetNoFimex::CDM_SHORT, and MetNoFimex::CDM_STRING.
virtual CDMDataType MetNoFimex::DataImpl< C >::getDataType | ( | ) | const [inline, virtual] |
void MetNoFimex::DataImpl< C >::setValues | ( | InputIterator | begin, | |
InputIterator | end, | |||
size_t | dataStartPos = 0 | |||
) | throw (CDMException) [inline] |
set the values of the data by the input-iterator
References std::distance(), std::transform(), and MetNoFimex::type2string().
void MetNoFimex::DataImpl< char >::setValues | ( | size_t | startPos, | |
const Data & | data, | |||
size_t | first, | |||
size_t | end | |||
) | throw(CDMException) [inline, virtual] |
set the values from another Data implementation
startPos | the first position the data should be written to | |
data | the other data-source | |
first | the first data-entry | |
end | the last (excluded) data-entry, defaults to MAX size_t, automatically shrunken to fit size |
Implements MetNoFimex::Data.
void MetNoFimex::DataImpl< short >::setValues | ( | size_t | startPos, | |
const Data & | data, | |||
size_t | first, | |||
size_t | end | |||
) | throw(CDMException) [inline, virtual] |
set the values from another Data implementation
startPos | the first position the data should be written to | |
data | the other data-source | |
first | the first data-entry | |
end | the last (excluded) data-entry, defaults to MAX size_t, automatically shrunken to fit size |
Implements MetNoFimex::Data.
void MetNoFimex::DataImpl< int >::setValues | ( | size_t | startPos, | |
const Data & | data, | |||
size_t | first, | |||
size_t | end | |||
) | throw(CDMException) [inline, virtual] |
set the values from another Data implementation
startPos | the first position the data should be written to | |
data | the other data-source | |
first | the first data-entry | |
end | the last (excluded) data-entry, defaults to MAX size_t, automatically shrunken to fit size |
Implements MetNoFimex::Data.
void MetNoFimex::DataImpl< float >::setValues | ( | size_t | startPos, | |
const Data & | data, | |||
size_t | first, | |||
size_t | end | |||
) | throw(CDMException) [inline, virtual] |
set the values from another Data implementation
startPos | the first position the data should be written to | |
data | the other data-source | |
first | the first data-entry | |
end | the last (excluded) data-entry, defaults to MAX size_t, automatically shrunken to fit size |
Implements MetNoFimex::Data.
void MetNoFimex::DataImpl< double >::setValues | ( | size_t | startPos, | |
const Data & | data, | |||
size_t | first, | |||
size_t | end | |||
) | throw(CDMException) [inline, virtual] |
set the values from another Data implementation
startPos | the first position the data should be written to | |
data | the other data-source | |
first | the first data-entry | |
end | the last (excluded) data-entry, defaults to MAX size_t, automatically shrunken to fit size |
Implements MetNoFimex::Data.