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

#include <fimex/SliceBuilder.h>

Inheritance diagram for MetNoFimex::SliceBuilder:
MetNoFimex::CoordinateSystemSliceBuilder

Public Member Functions

 SliceBuilder (const CDM &cdm, const std::string &varName, bool setUnlimited=false)
 
 SliceBuilder (const std::vector< std::string > &dimNames, const std::vector< size_t > &dimSize)
 
virtual ~SliceBuilder ()
 
void getStartAndSize (const std::string &dimName, std::size_t &start, std::size_t &size) const
 
void setStartAndSize (const std::string &dimName, size_t start, size_t size)
 
void setStartAndSize (const boost::shared_ptr< const CoordinateAxis > &axis, size_t start, size_t size)
 
void setAll (const std::string &dimName)
 
void setAll (const boost::shared_ptr< const CoordinateAxis > &axis)
 
const std::vector< size_t > & getDimensionStartPositions () const
 
const std::vector< size_t > & getDimensionSizes () const
 
std::vector< std::stringgetDimensionNames () const
 
std::vector< std::stringgetUnsetDimensionNames () const
 
const std::vector< size_t > & getMaxDimensionSizes () const
 

Protected Member Functions

size_t getDimPos (const std::string &dimName) const
 

Detailed Description

Examples:
parallelRead.cpp.

Constructor & Destructor Documentation

MetNoFimex::SliceBuilder::SliceBuilder ( const CDM cdm,
const std::string varName,
bool  setUnlimited = false 
)

Create a new slice builder for variable varName. The default will give a slice of full size.

Parameters
cdm
varNamevariable name
setUnlimitedenable enlarging of unlimited dimensions
Exceptions
CDMExceptionf varName doesn't exists
MetNoFimex::SliceBuilder::SliceBuilder ( const std::vector< std::string > &  dimNames,
const std::vector< size_t > &  dimSize 
)

Simple interface to create a slicebuilder. No checks are made if the created object is useful with any reader.

Parameters
dimNamesnames of dimensions
dimSizemaximum size of the dimensions
virtual MetNoFimex::SliceBuilder::~SliceBuilder ( )
virtual

Member Function Documentation

std::vector<std::string> MetNoFimex::SliceBuilder::getDimensionNames ( ) const
Returns
vector with names of dimensions in correct order

Referenced by getDimensionSizes().

const std::vector<size_t>& MetNoFimex::SliceBuilder::getDimensionSizes ( ) const
inline
Returns
vector with sizes of the dimenions of the variable in the order and size of the variables dimensions

References getDimensionNames(), and getUnsetDimensionNames().

const std::vector<size_t>& MetNoFimex::SliceBuilder::getDimensionStartPositions ( ) const
inline
Returns
vector with start-positions of shape-size and order of the variable
size_t MetNoFimex::SliceBuilder::getDimPos ( const std::string dimName) const
protected

Referenced by getMaxDimensionSizes().

const std::vector<size_t>& MetNoFimex::SliceBuilder::getMaxDimensionSizes ( ) const
inline
Returns
vector with maximum sizes of the dimenions of the variable in the order and size of the variables dimensions

References getDimPos(), and MetNoFimex::operator<<().

void MetNoFimex::SliceBuilder::getStartAndSize ( const std::string dimName,
std::size_t &  start,
std::size_t &  size 
) const

get the start position and the size of the slice of that dimension

Parameters
dimNamename of the dimension to restrict
startoutput, starting point of slice (starts at 0)
sizeoutput, size of the slice
Exceptions
CDMExceptionif dimName not part of the dimensions of variable
out_of_rangedepending on startPos or size
std::vector<std::string> MetNoFimex::SliceBuilder::getUnsetDimensionNames ( ) const
Returns
vector with names of dimensions which have not been set yet, (i.e. through setAll() or setStartAndSize()
Examples:
coordinateSystem.cpp.

Referenced by getDimensionSizes().

void MetNoFimex::SliceBuilder::setAll ( const std::string dimName)

Set the start to 0 and the size to the maximum size. Though this is the default this function will reset prevous reduced dimensions and it will mark the dimension as 'set' and not return it in getUnsetDimensionNames.

Parameters
dimNameaxis name of the dimension to restrict
Examples:
coordinateSystem.cpp.
void MetNoFimex::SliceBuilder::setAll ( const boost::shared_ptr< const CoordinateAxis > &  axis)

Set the start to 0 and the size to the maximum size. Though this is the default this function will reset prevous reduced dimensions and it will mark the dimension as 'set' and not return it in getUnsetDimensionNames.

Parameters
axisname of the dimension to restrict, ignored if NULL
void MetNoFimex::SliceBuilder::setStartAndSize ( const std::string dimName,
size_t  start,
size_t  size 
)

set the start position and the size of the slice of that dimension

Parameters
dimNamename of the dimension to restrict
startstarting point of slice (starts at 0)
sizesize of the slice
Exceptions
CDMExceptionif dimName not part of the dimensions of variable
out_of_rangedepending on startPos or size
Examples:
coordinateSystem.cpp, and parallelRead.cpp.
void MetNoFimex::SliceBuilder::setStartAndSize ( const boost::shared_ptr< const CoordinateAxis > &  axis,
size_t  start,
size_t  size 
)

set the start position and the size of the slice of that dimension

Parameters
axisname of the dimension to restrict, ignored if NULL
startstarting point of slice (starts at 0)
sizesize of the slice
Exceptions
CDMExceptionif axis not part of the dimensions of the variable
out_of_rangedepending on startPos or size

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