Alexandria 2.31.0
SDC-CH common library for the Euclid project
|
Provides information related with an axis of a GridContainer. More...
#include <GridAxis.h>
Public Types | |
typedef T | data_type |
The type of the axis values. | |
typedef std::vector< T >::const_iterator | const_iterator |
The iterator type of the GridAxis. | |
Public Member Functions | |
GridAxis (std::string name, std::vector< T > values) | |
Constructs an GridAxis with the given name and knot values. | |
virtual | ~GridAxis ()=default |
Default destructor. | |
size_t | size () const |
Returns the number of knots of the axis. | |
const std::string & | name () const |
Returns the name of the axis. | |
const T & | operator[] (size_t index) const |
Returns the value of the knot with the given index. | |
const_iterator | begin () const |
Returns an iterator at the first knot of the axis. | |
const_iterator | end () const |
Returns an iterator after the last knot of the axis. | |
const_iterator | infimum (const T &value) const |
template<typename U > | |
bool | operator== (const GridAxis< U > &other) const |
Compares the axis with another axis. | |
template<typename U > | |
bool | operator!= (const GridAxis< U > &other) const |
The opposite of the == operator. | |
Private Attributes | |
std::string | m_name |
std::vector< T > | m_values |
Provides information related with an axis of a GridContainer.
An axis has a name and a set of values, one for each knot of the axis. The GridAxis provides access to the values of the knots by using an iterator or by using the (zero based) index of the knot. Note that the GridAxis is designed to be immutable.
T | the type of the axis values |
Definition at line 49 of file GridAxis.h.
typedef std::vector<T>::const_iterator Euclid::GridContainer::GridAxis< T >::const_iterator |
The iterator type of the GridAxis.
Definition at line 56 of file GridAxis.h.
typedef T Euclid::GridContainer::GridAxis< T >::data_type |
The type of the axis values.
Definition at line 53 of file GridAxis.h.
Euclid::GridContainer::GridAxis< T >::GridAxis | ( | std::string | name, |
std::vector< T > | values | ||
) |
Constructs an GridAxis with the given name and knot values.
|
virtualdefault |
Default destructor.
const_iterator Euclid::GridContainer::GridAxis< T >::begin | ( | ) | const |
Returns an iterator at the first knot of the axis.
const_iterator Euclid::GridContainer::GridAxis< T >::end | ( | ) | const |
Returns an iterator after the last knot of the axis.
const_iterator Euclid::GridContainer::GridAxis< T >::infimum | ( | const T & | value | ) | const |
Returns an iterator to the greatest element still smaller or equal than value
const std::string & Euclid::GridContainer::GridAxis< T >::name | ( | ) | const |
Returns the name of the axis.
Referenced by boost::serialization::save_construct_data().
bool Euclid::GridContainer::GridAxis< T >::operator!= | ( | const GridAxis< U > & | other | ) | const |
The opposite of the == operator.
bool Euclid::GridContainer::GridAxis< T >::operator== | ( | const GridAxis< U > & | other | ) | const |
Compares the axis with another axis.
Two axes are considered equal if they have the same length and equal knots. They do not have to be of the same type. The only requirement is that the operation T == U is valid.
other | The axis to compare with |
const T & Euclid::GridContainer::GridAxis< T >::operator[] | ( | size_t | index | ) | const |
Returns the value of the knot with the given index.
size_t Euclid::GridContainer::GridAxis< T >::size | ( | ) | const |
Returns the number of knots of the axis.
Referenced by boost::serialization::save_construct_data().
|
private |
Definition at line 103 of file GridAxis.h.
|
private |
Definition at line 104 of file GridAxis.h.