CatapultServer  v0.5.0.1 (Elephant)
catapult::utils::CheckedArray< T, N > Class Template Reference

An array that checks for overflow. More...

Public Member Functions

 CheckedArray ()
 
bool empty () const
 Returns true if the array is empty, false otherwise. More...
 
size_t size () const
 Gets the size of the array. More...
 
size_t capacity () const
 Gets the capacity of the array. More...
 
void push_back (T val)
 
const T * begin () const
 Returns a const iterator that represents first element. More...
 
const T * end () const
 Returns a const iterator that represents one past last element. More...
 
const T * cbegin () const
 Returns a const iterator that represents first element. More...
 
const T * cend () const
 Returns a const iterator that represents one past last element. More...
 
T & operator[] (size_t index)
 
const T & operator[] (size_t index) const
 
constexpr bool operator== (const CheckedArray &rhs) const
 Returns true if this array is equal to rhs. More...
 
constexpr bool operator!= (const CheckedArray &rhs) const
 Returns true if this array is not equal to rhs. More...
 

Private Attributes

m_data [N]
 
size_t m_size
 

Detailed Description

template<typename T, size_t N>
class catapult::utils::CheckedArray< T, N >

An array that checks for overflow.

Constructor & Destructor Documentation

◆ CheckedArray()

template<typename T, size_t N>
catapult::utils::CheckedArray< T, N >::CheckedArray ( )
inline

Member Function Documentation

◆ begin()

template<typename T, size_t N>
const T* catapult::utils::CheckedArray< T, N >::begin ( ) const
inline

Returns a const iterator that represents first element.

◆ capacity()

template<typename T, size_t N>
size_t catapult::utils::CheckedArray< T, N >::capacity ( ) const
inline

Gets the capacity of the array.

◆ cbegin()

template<typename T, size_t N>
const T* catapult::utils::CheckedArray< T, N >::cbegin ( ) const
inline

Returns a const iterator that represents first element.

Here is the caller graph for this function:

◆ cend()

template<typename T, size_t N>
const T* catapult::utils::CheckedArray< T, N >::cend ( ) const
inline

Returns a const iterator that represents one past last element.

Here is the caller graph for this function:

◆ empty()

template<typename T, size_t N>
bool catapult::utils::CheckedArray< T, N >::empty ( ) const
inline

Returns true if the array is empty, false otherwise.

Here is the caller graph for this function:

◆ end()

template<typename T, size_t N>
const T* catapult::utils::CheckedArray< T, N >::end ( ) const
inline

Returns a const iterator that represents one past last element.

◆ operator!=()

template<typename T, size_t N>
constexpr bool catapult::utils::CheckedArray< T, N >::operator!= ( const CheckedArray< T, N > &  rhs) const
inlineconstexpr

Returns true if this array is not equal to rhs.

◆ operator==()

template<typename T, size_t N>
constexpr bool catapult::utils::CheckedArray< T, N >::operator== ( const CheckedArray< T, N > &  rhs) const
inlineconstexpr

Returns true if this array is equal to rhs.

◆ operator[]() [1/2]

template<typename T, size_t N>
T& catapult::utils::CheckedArray< T, N >::operator[] ( size_t  index)
inline

Returns a reference to the element at index.

Note
This method throws if the index is out of range.

◆ operator[]() [2/2]

template<typename T, size_t N>
const T& catapult::utils::CheckedArray< T, N >::operator[] ( size_t  index) const
inline

Returns the element at index.

Note
This method throws if the index is out of range.

◆ push_back()

template<typename T, size_t N>
void catapult::utils::CheckedArray< T, N >::push_back ( val)
inline

Appends val at the end of the array.

Note
This method throws if the boundary of the array is exceeded.
Here is the caller graph for this function:

◆ size()

template<typename T, size_t N>
size_t catapult::utils::CheckedArray< T, N >::size ( ) const
inline

Gets the size of the array.

Here is the caller graph for this function:

Member Data Documentation

◆ m_data

template<typename T, size_t N>
T catapult::utils::CheckedArray< T, N >::m_data[N]
private

◆ m_size

template<typename T, size_t N>
size_t catapult::utils::CheckedArray< T, N >::m_size
private

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