Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
Euclid::GridContainer::GridAxis< T > Class Template Reference

Provides information related with an axis of a GridContainer. More...

#include <GridAxis.h>

Collaboration diagram for Euclid::GridContainer::GridAxis< T >:
Collaboration graph
[legend]

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::stringname () 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
 

Detailed Description

template<typename T>
class Euclid::GridContainer::GridAxis< T >

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.

Template Parameters
Tthe type of the axis values

Definition at line 49 of file GridAxis.h.

Member Typedef Documentation

◆ const_iterator

template<typename T >
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.

◆ data_type

template<typename T >
typedef T Euclid::GridContainer::GridAxis< T >::data_type

The type of the axis values.

Definition at line 53 of file GridAxis.h.

Constructor & Destructor Documentation

◆ GridAxis()

template<typename T >
Euclid::GridContainer::GridAxis< T >::GridAxis ( std::string  name,
std::vector< T >  values 
)

Constructs an GridAxis with the given name and knot values.

◆ ~GridAxis()

template<typename T >
virtual Euclid::GridContainer::GridAxis< T >::~GridAxis ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ begin()

template<typename T >
const_iterator Euclid::GridContainer::GridAxis< T >::begin ( ) const

Returns an iterator at the first knot of the axis.

◆ end()

template<typename T >
const_iterator Euclid::GridContainer::GridAxis< T >::end ( ) const

Returns an iterator after the last knot of the axis.

◆ infimum()

template<typename T >
const_iterator Euclid::GridContainer::GridAxis< T >::infimum ( const T &  value) const

Returns an iterator to the greatest element still smaller or equal than value

Note
The value is clipped, so if value is less than the first element, still begin() is returned

◆ name()

template<typename T >
const std::string & Euclid::GridContainer::GridAxis< T >::name ( ) const

Returns the name of the axis.

Referenced by boost::serialization::save_construct_data().

◆ operator!=()

template<typename T >
template<typename U >
bool Euclid::GridContainer::GridAxis< T >::operator!= ( const GridAxis< U > &  other) const

The opposite of the == operator.

◆ operator==()

template<typename T >
template<typename U >
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.

Parameters
otherThe axis to compare with
Returns
true if the two axes have the same size and equal knots, false otherwise

◆ operator[]()

template<typename T >
const T & Euclid::GridContainer::GridAxis< T >::operator[] ( size_t  index) const

Returns the value of the knot with the given index.

◆ size()

template<typename T >
size_t Euclid::GridContainer::GridAxis< T >::size ( ) const

Returns the number of knots of the axis.

Referenced by boost::serialization::save_construct_data().

Member Data Documentation

◆ m_name

template<typename T >
std::string Euclid::GridContainer::GridAxis< T >::m_name
private

Definition at line 103 of file GridAxis.h.

◆ m_values

template<typename T >
std::vector<T> Euclid::GridContainer::GridAxis< T >::m_values
private

Definition at line 104 of file GridAxis.h.


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