BioDynaMo  v1.05.120-25dc9790
Public Member Functions | Private Attributes | List of all members
bdm::FixedSizeVector< T, N > Class Template Reference

#include <fixed_size_vector.h>

Collaboration diagram for bdm::FixedSizeVector< T, N >:
[legend]

Public Member Functions

 FixedSizeVector ()=default
 
constexpr FixedSizeVector (const std::initializer_list< T > &l)
 
size_t size () const
 
const T & operator[] (size_t idx) const
 
T & operator[] (size_t idx)
 
bool operator== (const FixedSizeVector &other) const
 
FixedSizeVectoroperator++ ()
 
void clear ()
 
void push_back (const T &value)
 
const T * data () const
 
const T * begin () const
 
const T * end () const
 
T * begin ()
 
T * end ()
 

Private Attributes

data_ [N]
 
std::size_t size_ = 0
 

Detailed Description

template<typename T, std::size_t N>
class bdm::FixedSizeVector< T, N >

Vector with fixed number of elements == Array with push_back function that keeps track of its size NB: No bounds checking. Do not push_back more often than the number of maximum elements given by the template parameter N

Definition at line 30 of file fixed_size_vector.h.

Constructor & Destructor Documentation

◆ FixedSizeVector() [1/2]

template<typename T , std::size_t N>
bdm::FixedSizeVector< T, N >::FixedSizeVector ( )
default

◆ FixedSizeVector() [2/2]

template<typename T , std::size_t N>
constexpr bdm::FixedSizeVector< T, N >::FixedSizeVector ( const std::initializer_list< T > &  l)
inlineconstexpr

Constructor which accepts an std::initiliazer_list to set the array's content.

Parameters
lan initializer list

Definition at line 37 of file fixed_size_vector.h.

Member Function Documentation

◆ begin() [1/2]

template<typename T , std::size_t N>
T* bdm::FixedSizeVector< T, N >::begin ( )
inline

Definition at line 83 of file fixed_size_vector.h.

◆ begin() [2/2]

template<typename T , std::size_t N>
const T* bdm::FixedSizeVector< T, N >::begin ( ) const
inline

Definition at line 81 of file fixed_size_vector.h.

◆ clear()

template<typename T , std::size_t N>
void bdm::FixedSizeVector< T, N >::clear ( )
inline

Definition at line 72 of file fixed_size_vector.h.

◆ data()

template<typename T , std::size_t N>
const T* bdm::FixedSizeVector< T, N >::data ( ) const
inline

Definition at line 79 of file fixed_size_vector.h.

◆ end() [1/2]

template<typename T , std::size_t N>
T* bdm::FixedSizeVector< T, N >::end ( )
inline

Definition at line 84 of file fixed_size_vector.h.

◆ end() [2/2]

template<typename T , std::size_t N>
const T* bdm::FixedSizeVector< T, N >::end ( ) const
inline

Definition at line 82 of file fixed_size_vector.h.

◆ operator++()

template<typename T , std::size_t N>
FixedSizeVector& bdm::FixedSizeVector< T, N >::operator++ ( )
inline

Definition at line 64 of file fixed_size_vector.h.

◆ operator==()

template<typename T , std::size_t N>
bool bdm::FixedSizeVector< T, N >::operator== ( const FixedSizeVector< T, N > &  other) const
inline

Definition at line 52 of file fixed_size_vector.h.

◆ operator[]() [1/2]

template<typename T , std::size_t N>
T& bdm::FixedSizeVector< T, N >::operator[] ( size_t  idx)
inline

Definition at line 50 of file fixed_size_vector.h.

◆ operator[]() [2/2]

template<typename T , std::size_t N>
const T& bdm::FixedSizeVector< T, N >::operator[] ( size_t  idx) const
inline

Definition at line 48 of file fixed_size_vector.h.

◆ push_back()

template<typename T , std::size_t N>
void bdm::FixedSizeVector< T, N >::push_back ( const T &  value)
inline

Definition at line 74 of file fixed_size_vector.h.

◆ size()

template<typename T , std::size_t N>
size_t bdm::FixedSizeVector< T, N >::size ( ) const
inline

Definition at line 46 of file fixed_size_vector.h.

Member Data Documentation

◆ data_

template<typename T , std::size_t N>
T bdm::FixedSizeVector< T, N >::data_[N]
private

Definition at line 87 of file fixed_size_vector.h.

◆ size_

template<typename T , std::size_t N>
std::size_t bdm::FixedSizeVector< T, N >::size_ = 0
private

Definition at line 88 of file fixed_size_vector.h.


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