Alexandria 2.31.4
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
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 >:

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.

Definition at line 31 of file GridAxis.icpp.

References m_name, and m_values.

Referenced by operator!=(), operator==(), and ~GridAxis().

◆ ~GridAxis()

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

Default destructor.

References GridAxis().

Here is the call graph for this function:

Member Function Documentation

◆ begin()

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

Returns an iterator at the first knot of the axis.

Definition at line 49 of file GridAxis.icpp.

References m_values.

Referenced by operator==().

◆ end()

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

Returns an iterator after the last knot of the axis.

Definition at line 54 of file GridAxis.icpp.

References m_values.

Referenced by operator==().

◆ infimum()

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

Definition at line 75 of file GridAxis.icpp.

References m_values, and std::upper_bound().

Here is the call graph for this function:

◆ name()

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

Returns the name of the axis.

Definition at line 39 of file GridAxis.icpp.

References m_name.

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.

Definition at line 70 of file GridAxis.icpp.

References GridAxis(), and operator==().

Here is the call graph for this function:

◆ 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

Definition at line 60 of file GridAxis.icpp.

References begin(), end(), std::equal(), GridAxis(), and size().

Referenced by operator!=().

Here is the call graph for this function:

◆ 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.

Definition at line 44 of file GridAxis.icpp.

References m_values.

◆ size()

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

Returns the number of knots of the axis.

Definition at line 34 of file GridAxis.icpp.

References m_values.

Referenced by operator==(), and 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.

Referenced by GridAxis(), and name().

◆ m_values

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

Definition at line 104 of file GridAxis.h.

Referenced by begin(), end(), GridAxis(), infimum(), operator[](), and size().


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