AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::StaticArray< T, N > Class Template Reference

Provides a wrapper for a StackArray with an additional size member. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.10.1/src/axom/core/StaticArray.hpp>

Inheritance diagram for axom::StaticArray< T, N >:

Public Member Functions

AXOM_HOST_DEVICE int size () const
 Returns the size of the static array. More...
 
AXOM_HOST_DEVICE void push_back (const T &obj)
 Pushes an object to the back of the static array. More...
 
AXOM_HOST_DEVICE void clear ()
 Clears the data from the static array. More...
 
AXOM_HOST_DEVICE T & operator[] (IndexType i) noexcept
 Accessor, returns a reference to the value at the given index. More...
 
constexpr AXOM_HOST_DEVICE const T & operator[] (IndexType i) const noexcept
 
AXOM_HOST_DEVICE operator T* () noexcept
 User defined conversion to a raw pointer. More...
 
constexpr AXOM_HOST_DEVICE operator const T * () const noexcept
 
AXOM_HOST_DEVICE T * begin () noexcept
 Begin/end iterators. More...
 
AXOM_HOST_DEVICE const T * begin () const noexcept
 
AXOM_HOST_DEVICE T * end () noexcept
 
AXOM_HOST_DEVICE const T * end () const noexcept
 

Public Attributes

m_data [N]
 

Detailed Description

template<typename T, int N>
class axom::StaticArray< T, N >

Provides a wrapper for a StackArray with an additional size member.

Template Parameters
Tthe type of the values to hold.
Nthe number of values in the array.
Note
Type T must be default-constructible on device for device execution.

Member Function Documentation

◆ size()

template<typename T , int N>
AXOM_HOST_DEVICE int axom::StaticArray< T, N >::size ( ) const
inline

Returns the size of the static array.

Returns
The size of the static array

◆ push_back()

template<typename T , int N>
AXOM_HOST_DEVICE void axom::StaticArray< T, N >::push_back ( const T &  obj)
inline

Pushes an object to the back of the static array.

Parameters
[in]objthe object to be added to the back.
Note
The number of push_backs must not exceed N, the max number of values in the array.
If the static array is full, push_back will not modify the static array.

◆ clear()

template<typename T , int N>
AXOM_HOST_DEVICE void axom::StaticArray< T, N >::clear ( )
inline

Clears the data from the static array.

◆ operator[]() [1/2]

template<typename T , int N>
AXOM_HOST_DEVICE T& axom::StackArray< T, N >::operator[] ( IndexType  i)
inlinenoexceptinherited

Accessor, returns a reference to the value at the given index.

Parameters
[in]ithe index to access.

References axom::StackArray< T, N >::m_data.

◆ operator[]() [2/2]

template<typename T , int N>
constexpr AXOM_HOST_DEVICE const T& axom::StackArray< T, N >::operator[] ( IndexType  i) const
inlineconstexprnoexceptinherited

◆ operator T*()

template<typename T , int N>
AXOM_HOST_DEVICE axom::StackArray< T, N >::operator T* ( )
inlinenoexceptinherited

User defined conversion to a raw pointer.

◆ operator const T *()

template<typename T , int N>
constexpr AXOM_HOST_DEVICE axom::StackArray< T, N >::operator const T * ( ) const
inlineconstexprnoexceptinherited

◆ begin() [1/2]

template<typename T , int N>
AXOM_HOST_DEVICE T* axom::StackArray< T, N >::begin ( )
inlinenoexceptinherited

Begin/end iterators.

References axom::StackArray< T, N >::m_data.

◆ begin() [2/2]

template<typename T , int N>
AXOM_HOST_DEVICE const T* axom::StackArray< T, N >::begin ( ) const
inlinenoexceptinherited

◆ end() [1/2]

template<typename T , int N>
AXOM_HOST_DEVICE T* axom::StackArray< T, N >::end ( )
inlinenoexceptinherited

◆ end() [2/2]

template<typename T , int N>
AXOM_HOST_DEVICE const T* axom::StackArray< T, N >::end ( ) const
inlinenoexceptinherited

Member Data Documentation

◆ m_data

template<typename T , int N>
T axom::StackArray< T, N >::m_data[N]
inherited

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