# MI - Fimex: MetNoFimex::SliceBuilder Class Reference

# MetNoFimex::SliceBuilder Class Reference

`#include <fimex/SliceBuilder.h>`

List of all members.

## Public Member Functions

| SliceBuilder (const CDM &cdm, const std::string &varName)
| ~SliceBuilder ()
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)
const std::vector< size_t > & | getDimensionStartPositions () const
const std::vector< size_t > & | getDimensionSizes () const
std::vector< std::string > | getDimensionNames () const
const std::vector< size_t > & | getMaxDimensionSizes () const

## Constructor & Destructor Documentation

MetNoFimex::SliceBuilder::SliceBuilder | ( | const CDM & | cdm,
|  | const std::string & | varName |
| ) |  |  |

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

Parameters:

  | cdm |
  | varName | variable name

Exceptions:

  | CDMException | f varName doesn't exists

MetNoFimex::SliceBuilder::~SliceBuilder | ( |  | ) |

## Member Function Documentation

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:

  | dimName | name of the dimension to restrict
  | start | starting point of slice (starts at 0)
  | size | size of the slice

Exceptions:

  | CDMException | if dimName not part of the dimensions of variable
  | out_of_range | depending on startPos or size

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:

  | axis | name of the dimension to restrict, ignored if NULL
  | start | starting point of slice (starts at 0)
  | size | size of the slice

Exceptions:

  | CDMException | if axis not part of the dimensions of the variable
  | out_of_range | depending on startPos or size

const std::vector<size_t>& MetNoFimex::SliceBuilder::getDimensionStartPositions | ( |  | ) | const`[inline]`

Returns:
  vector with start-positions of shape-size and order of the variable

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

std::vector<std::string> MetNoFimex::SliceBuilder::getDimensionNames | ( |  | ) | const

Returns:
  vector with names of dimensions in correct order

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

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

- include/fimex/SliceBuilder.h