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

#include <fimex/IndexedData.h>

Public Member Functions

 IndexedData ()
 
 IndexedData (DataPtr data, std::vector< std::size_t > dimSizes)
 
 ~IndexedData ()
 
void setDims (std::vector< std::size_t > dims)
 set the dimension sizes of data More...
 
const DataIndexidx () const
 get the index belonging to the data More...
 
DataPtr getDataPtr () const
 
double getDouble (size_t pos) const
 
double getDouble (size_t a, size_t b) const
 shortcut for 2d More...
 
double getDouble (size_t a, size_t b, size_t c) const
 shortcut for 3d More...
 
double getDouble (size_t a, size_t b, size_t c, size_t d) const
 shortcut for 4d More...
 
long long getLongLong (size_t pos) const
 
double getLongLong (size_t a, size_t b) const
 shortcut for 2d More...
 
double getLongLong (size_t a, size_t b, size_t c) const
 shortcut for 3d More...
 
double getLongLong (size_t a, size_t b, size_t c, size_t d) const
 shortcut for 4d More...
 

Constructor & Destructor Documentation

MetNoFimex::IndexedData::IndexedData ( )
MetNoFimex::IndexedData::IndexedData ( DataPtr  data,
std::vector< std::size_t >  dimSizes 
)
explicit

Create a indexed data. See setDims() for more information.

Parameters
data
dimSizes
MetNoFimex::IndexedData::~IndexedData ( )

Member Function Documentation

DataPtr MetNoFimex::IndexedData::getDataPtr ( ) const
Returns
the internal data
double MetNoFimex::IndexedData::getDouble ( size_t  pos) const

simple data accessor, should be used with MetNoFimex::Index

IndexedData idata(data, dims);
double val = id.getDouble(id.getIdx().getPos(3, 5, 7));
Parameters
posdata position, should be < size (not assured)
double MetNoFimex::IndexedData::getDouble ( size_t  a,
size_t  b 
) const
inline

shortcut for 2d

References getDouble(), and idx().

Referenced by getDouble().

double MetNoFimex::IndexedData::getDouble ( size_t  a,
size_t  b,
size_t  c 
) const
inline

shortcut for 3d

References getDouble(), and idx().

Referenced by getDouble().

double MetNoFimex::IndexedData::getDouble ( size_t  a,
size_t  b,
size_t  c,
size_t  d 
) const
inline

shortcut for 4d

References getDouble(), getLongLong(), and idx().

Referenced by getDouble().

long long MetNoFimex::IndexedData::getLongLong ( size_t  pos) const

simple data accessor, should be used with MetNoFimex::Index

Parameters
posdata position, should be < size (not assured)

Referenced by getDouble().

double MetNoFimex::IndexedData::getLongLong ( size_t  a,
size_t  b 
) const
inline

shortcut for 2d

References getLongLong(), and idx().

Referenced by getLongLong().

double MetNoFimex::IndexedData::getLongLong ( size_t  a,
size_t  b,
size_t  c 
) const
inline

shortcut for 3d

References getLongLong(), and idx().

Referenced by getLongLong().

double MetNoFimex::IndexedData::getLongLong ( size_t  a,
size_t  b,
size_t  c,
size_t  d 
) const
inline

shortcut for 4d

References getLongLong(), and idx().

Referenced by getLongLong().

const DataIndex& MetNoFimex::IndexedData::idx ( ) const

get the index belonging to the data

Returns
a Index belonging to the data

Referenced by getDouble(), getLongLong(), and MetNoFimex::OceanSCoordinateGToDepthConverter::OceanSCoordinateGToDepthConverter().

void MetNoFimex::IndexedData::setDims ( std::vector< std::size_t >  dims)

set the dimension sizes of data

The dimension sizes should be set with the fastest moving index first, e.g. x,y,z. It handles gracefully the case when the data is not defined.

Exceptions
runtime_errorif mult(dims) != size()

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