HerdSoftware  0.4.0
Public Types | Public Member Functions | List of all members
Herd::CooArray< ContainedClass > Class Template Reference

An array that accepts coordinates as subscripts. More...

#include <common/CooArray.h>

Inheritance diagram for Herd::CooArray< ContainedClass >:
Herd::ArrayForwarder< ContainedClass, 3 >

Public Types

using BaseType = ArrayForwarder< ContainedClass, 3 >
 
- Public Types inherited from Herd::ArrayForwarder< ContainedClass, 3 >
typedef _Tp value_type
 
typedef value_typepointer
 
typedef value_typereference
 
typedef value_typeiterator
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

constexpr CooArray ()=default
 Default constructor. More...
 
constexpr CooArray (const CooArray< ContainedClass > &c)
 Copy constructor. More...
 
template<typename U , typename V , typename Z >
constexpr CooArray (U &&v1, V &&v2, Z &&v3)
 Initializer list constructor. More...
 
constexpr CooArray (const std::array< ContainedClass, 3 > &values)
 Array constructors. More...
 
constexpr CooArray (std::array< ContainedClass, 3 > &&values)
 
constexpr CooArray< ContainedClass > & operator= (const CooArray< ContainedClass > &lhs)
 Assignment operator. More...
 
constexpr ContainedClass & operator[] (const RefFrame::Coo &coo)
 Accesses an element without validity check on the element index. More...
 
constexpr const ContainedClass & operator[] (const RefFrame::Coo &coo) const
 Accesses an element without validity check on the element index. More...
 
constexpr ContainedClass & at (const RefFrame::Coo &coo)
 Accesses an element with validity check on the element index. More...
 
constexpr const ContainedClass & at (const RefFrame::Coo &coo) const
 Accesses an element with validity check on the element index. More...
 
- Public Member Functions inherited from Herd::ArrayForwarder< ContainedClass, 3 >
constexpr ArrayForwarder ()=default
 
constexpr ArrayForwarder (std::array< _Tp, _Nm > arr)
 
void fill (const value_type &__u)
 
void swap (ArrayForwarder &__other) noexcept(noexcept(std::swap(std::declval< _Tp & >(), std::declval< _Tp & >())))
 
_GLIBCXX17_CONSTEXPR iterator begin () noexcept
 
_GLIBCXX17_CONSTEXPR const_iterator begin () const noexcept
 
_GLIBCXX17_CONSTEXPR iterator end () noexcept
 
_GLIBCXX17_CONSTEXPR const_iterator end () const noexcept
 
_GLIBCXX17_CONSTEXPR reverse_iterator rbegin () noexcept
 
_GLIBCXX17_CONSTEXPR const_reverse_iterator rbegin () const noexcept
 
_GLIBCXX17_CONSTEXPR reverse_iterator rend () noexcept
 
_GLIBCXX17_CONSTEXPR const_reverse_iterator rend () const noexcept
 
_GLIBCXX17_CONSTEXPR const_iterator cbegin () const noexcept
 
_GLIBCXX17_CONSTEXPR const_iterator cend () const noexcept
 
_GLIBCXX17_CONSTEXPR const_reverse_iterator crbegin () const noexcept
 
_GLIBCXX17_CONSTEXPR const_reverse_iterator crend () const noexcept
 
constexpr size_type size () const noexcept
 
constexpr size_type max_size () const noexcept
 
constexpr bool empty () const noexcept
 
_GLIBCXX17_CONSTEXPR reference operator[] (size_type __n) noexcept
 
constexpr const_reference operator[] (size_type __n) const noexcept
 
_GLIBCXX17_CONSTEXPR reference at (size_type __n)
 
constexpr const_reference at (size_type __n) const
 
_GLIBCXX17_CONSTEXPR reference front () noexcept
 
constexpr const_reference front () const noexcept
 
_GLIBCXX17_CONSTEXPR reference back () noexcept
 
constexpr const_reference back () const noexcept
 
_GLIBCXX17_CONSTEXPR pointer data () noexcept
 
_GLIBCXX17_CONSTEXPR const_pointer data () const noexcept
 

Additional Inherited Members

- Public Attributes inherited from Herd::ArrayForwarder< ContainedClass, 3 >
const typedef value_typeconst_pointer
 
const typedef value_typeconst_reference
 
const typedef value_typeconst_iterator
 

Detailed Description

template<typename ContainedClass>
class Herd::CooArray< ContainedClass >

An array that accepts coordinates as subscripts.

The elements in a CooArray can be indexed using RefFrame::Coo values.

Member Typedef Documentation

◆ BaseType

template<typename ContainedClass >
using Herd::CooArray< ContainedClass >::BaseType = ArrayForwarder<ContainedClass, 3>

Constructor & Destructor Documentation

◆ CooArray() [1/5]

template<typename ContainedClass >
constexpr Herd::CooArray< ContainedClass >::CooArray ( )
constexprdefault

Default constructor.

◆ CooArray() [2/5]

template<typename ContainedClass >
constexpr Herd::CooArray< ContainedClass >::CooArray ( const CooArray< ContainedClass > &  c)
inlineconstexpr

Copy constructor.

Parameters
cThe CooArray to copy from.

◆ CooArray() [3/5]

template<typename ContainedClass >
template<typename U , typename V , typename Z >
constexpr Herd::CooArray< ContainedClass >::CooArray ( U &&  v1,
V &&  v2,
Z &&  v3 
)
inlineconstexpr

Initializer list constructor.

Creates a CooArray from 3 elements of type ContainedClass

◆ CooArray() [4/5]

template<typename ContainedClass >
constexpr Herd::CooArray< ContainedClass >::CooArray ( const std::array< ContainedClass, 3 > &  values)
inlineconstexpr

Array constructors.

Create a CooArray from an std::array which holds 3 elements of type ContainedClass

◆ CooArray() [5/5]

template<typename ContainedClass >
constexpr Herd::CooArray< ContainedClass >::CooArray ( std::array< ContainedClass, 3 > &&  values)
inlineconstexpr

Member Function Documentation

◆ at() [1/2]

template<typename ContainedClass >
constexpr ContainedClass& Herd::CooArray< ContainedClass >::at ( const RefFrame::Coo coo)
inlineconstexpr

Accesses an element with validity check on the element index.

Accesses the element corresponding to the given coo; if the coo is NONE then a std::out_of_range exception will be thrown.

Parameters
cooThe coo of the desired element.
Returns
a reference to the desired element.
Exceptions
std::out_of_rangeif coo == RefFrame::Coo::NONE.

◆ at() [2/2]

template<typename ContainedClass >
constexpr const ContainedClass& Herd::CooArray< ContainedClass >::at ( const RefFrame::Coo coo) const
inlineconstexpr

Accesses an element with validity check on the element index.

Accesses the element corresponding to the given coo; if the coo is NONE then a std::out_of_range exception will be thrown.

Parameters
cooThe coo of the desired element.
Returns
a const reference to the desired element.
Exceptions
std::out_of_rangeif coo == RefFrame::Coo::NONE.

◆ operator=()

template<typename ContainedClass >
constexpr CooArray<ContainedClass>& Herd::CooArray< ContainedClass >::operator= ( const CooArray< ContainedClass > &  lhs)
inlineconstexpr

Assignment operator.

Parameters
lhsThe CooArray on the lhs of the assignment operation.
Returns
reference to this object.

◆ operator[]() [1/2]

template<typename ContainedClass >
constexpr ContainedClass& Herd::CooArray< ContainedClass >::operator[] ( const RefFrame::Coo coo)
inlineconstexpr

Accesses an element without validity check on the element index.

Accesses the element corresponding to the given coo. No check is performed on the coo argument, so passing NONE will result in undefined behavior.

Parameters
cooThe coo of the desired element.
Returns
a reference to the desired element.

◆ operator[]() [2/2]

template<typename ContainedClass >
constexpr const ContainedClass& Herd::CooArray< ContainedClass >::operator[] ( const RefFrame::Coo coo) const
inlineconstexpr

Accesses an element without validity check on the element index.

Accesses the element corresponding to the given coo. No check is performed on the coo argument, so passing NONE will result in undefined behavior.

Parameters
cooThe coo of the desired element.
Returns
a const reference to the desired element.

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