Block-Structured AMR Software Framework
amrex::PODVector< T, Allocator > Class Template Reference

#include <AMReX_PODVector.H>

Inheritance diagram for amrex::PODVector< T, Allocator >:

Public Types

using value_type = T
 
using allocator_type = Allocator
 
using size_type = std::size_t
 
using difference_type = std::ptrdiff_t
 
using reference = T &
 
using pointer = T *
 
using iterator = T *
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reference = const T &
 
using const_pointer = const T *
 
using const_iterator = const T *
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 

Public Member Functions

constexpr PODVector () noexcept=default
 
constexpr PODVector (const allocator_type &a_allocator) noexcept
 
 PODVector (size_type a_size)
 
 PODVector (size_type a_size, const value_type &a_value, const allocator_type &a_allocator=Allocator())
 
 PODVector (std::initializer_list< T > a_initializer_list, const allocator_type &a_allocator=Allocator())
 
 PODVector (const PODVector< T, Allocator > &a_vector)
 
 PODVector (PODVector< T, Allocator > &&a_vector) noexcept
 
 ~PODVector ()
 
PODVectoroperator= (const PODVector< T, Allocator > &a_vector)
 
PODVectoroperator= (PODVector< T, Allocator > &&a_vector) noexcept
 
iterator erase (const_iterator a_pos)
 
iterator erase (const_iterator a_first, const_iterator a_last)
 
iterator insert (const_iterator a_pos, const T &a_item)
 
iterator insert (const_iterator a_pos, size_type a_count, const T &a_value)
 
iterator insert (const_iterator a_pos, T &&a_item)
 
iterator insert (const_iterator a_pos, std::initializer_list< T > a_initializer_list)
 
template<class InputIt , class bar = typename std::iterator_traits<InputIt>::difference_type>
iterator insert (const_iterator a_pos, InputIt a_first, InputIt a_last)
 
void assign (size_type a_count, const T &a_value)
 
void assign (std::initializer_list< T > a_initializer_list)
 
template<class InputIt , class bar = typename std::iterator_traits<InputIt>::difference_type>
void assign (InputIt a_first, InputIt a_last)
 
void assign (const T &a_value)
 
allocator_type get_allocator () const noexcept
 
void push_back (const T &a_value)
 
void pop_back () noexcept
 
void clear () noexcept
 
size_type size () const noexcept
 
size_type capacity () const noexcept
 
bool empty () const noexcept
 
T & operator[] (size_type a_index) noexcept
 
const T & operator[] (size_type a_index) const noexcept
 
T & front () noexcept
 
const T & front () const noexcept
 
T & back () noexcept
 
const T & back () const noexcept
 
T * data () noexcept
 
const T * data () const noexcept
 
T * dataPtr () noexcept
 
const T * dataPtr () const noexcept
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
reverse_iterator rbegin () noexcept
 
const_reverse_iterator rbegin () const noexcept
 
reverse_iterator rend () noexcept
 
const_reverse_iterator rend () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 
void resize (size_type a_new_size)
 
void resize (size_type a_new_size, const T &a_val)
 
void reserve (size_type a_capacity)
 
void shrink_to_fit ()
 
void swap (PODVector< T, Allocator > &a_vector) noexcept
 

Private Member Functions

size_type nBytes () const noexcept
 
size_type GetNewCapacityForPush () const noexcept
 
void UpdateDataPtr (FatPtr< T > const &fp)
 
void AllocateBufferForPush (size_type target_capacity)
 
void AllocateBufferForInsert (size_type a_index, size_type a_count)
 
void resize_without_init_snan (size_type a_new_size)
 

Private Attributes

pointer m_data = nullptr
 
size_type m_size {0}
 
size_type m_capacity {0}
 

Member Typedef Documentation

◆ allocator_type

template<class T , class Allocator = std::allocator<T>>
using amrex::PODVector< T, Allocator >::allocator_type = Allocator

◆ const_iterator

template<class T , class Allocator = std::allocator<T>>
using amrex::PODVector< T, Allocator >::const_iterator = const T*

◆ const_pointer

template<class T , class Allocator = std::allocator<T>>
using amrex::PODVector< T, Allocator >::const_pointer = const T*

◆ const_reference

template<class T , class Allocator = std::allocator<T>>
using amrex::PODVector< T, Allocator >::const_reference = const T&

◆ const_reverse_iterator

template<class T , class Allocator = std::allocator<T>>
using amrex::PODVector< T, Allocator >::const_reverse_iterator = std::reverse_iterator<const_iterator>

◆ difference_type

template<class T , class Allocator = std::allocator<T>>
using amrex::PODVector< T, Allocator >::difference_type = std::ptrdiff_t

◆ iterator

template<class T , class Allocator = std::allocator<T>>
using amrex::PODVector< T, Allocator >::iterator = T*

◆ pointer

template<class T , class Allocator = std::allocator<T>>
using amrex::PODVector< T, Allocator >::pointer = T*

◆ reference

template<class T , class Allocator = std::allocator<T>>
using amrex::PODVector< T, Allocator >::reference = T&

◆ reverse_iterator

template<class T , class Allocator = std::allocator<T>>
using amrex::PODVector< T, Allocator >::reverse_iterator = std::reverse_iterator<iterator>

◆ size_type

template<class T , class Allocator = std::allocator<T>>
using amrex::PODVector< T, Allocator >::size_type = std::size_t

◆ value_type

template<class T , class Allocator = std::allocator<T>>
using amrex::PODVector< T, Allocator >::value_type = T

Constructor & Destructor Documentation

◆ PODVector() [1/7]

template<class T , class Allocator = std::allocator<T>>
constexpr amrex::PODVector< T, Allocator >::PODVector ( )
constexprdefaultnoexcept

◆ PODVector() [2/7]

template<class T , class Allocator = std::allocator<T>>
constexpr amrex::PODVector< T, Allocator >::PODVector ( const allocator_type a_allocator)
inlineexplicitconstexprnoexcept

◆ PODVector() [3/7]

template<class T , class Allocator = std::allocator<T>>
amrex::PODVector< T, Allocator >::PODVector ( size_type  a_size)
inlineexplicit

◆ PODVector() [4/7]

template<class T , class Allocator = std::allocator<T>>
amrex::PODVector< T, Allocator >::PODVector ( size_type  a_size,
const value_type a_value,
const allocator_type a_allocator = Allocator() 
)
inline

◆ PODVector() [5/7]

template<class T , class Allocator = std::allocator<T>>
amrex::PODVector< T, Allocator >::PODVector ( std::initializer_list< T >  a_initializer_list,
const allocator_type a_allocator = Allocator() 
)
inline

◆ PODVector() [6/7]

template<class T , class Allocator = std::allocator<T>>
amrex::PODVector< T, Allocator >::PODVector ( const PODVector< T, Allocator > &  a_vector)
inline

◆ PODVector() [7/7]

template<class T , class Allocator = std::allocator<T>>
amrex::PODVector< T, Allocator >::PODVector ( PODVector< T, Allocator > &&  a_vector)
inlinenoexcept

◆ ~PODVector()

template<class T , class Allocator = std::allocator<T>>
amrex::PODVector< T, Allocator >::~PODVector ( )
inline

Member Function Documentation

◆ AllocateBufferForInsert()

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::AllocateBufferForInsert ( size_type  a_index,
size_type  a_count 
)
inlineprivate

◆ AllocateBufferForPush()

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::AllocateBufferForPush ( size_type  target_capacity)
inlineprivate

◆ assign() [1/4]

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::assign ( const T &  a_value)
inline

Set the same value to every element of the vector

Parameters
a_valuethe value to assign

◆ assign() [2/4]

template<class T , class Allocator = std::allocator<T>>
template<class InputIt , class bar = typename std::iterator_traits<InputIt>::difference_type>
void amrex::PODVector< T, Allocator >::assign ( InputIt  a_first,
InputIt  a_last 
)
inline

◆ assign() [3/4]

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::assign ( size_type  a_count,
const T &  a_value 
)
inline

◆ assign() [4/4]

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::assign ( std::initializer_list< T >  a_initializer_list)
inline

◆ back() [1/2]

template<class T , class Allocator = std::allocator<T>>
const T& amrex::PODVector< T, Allocator >::back ( ) const
inlinenoexcept

◆ back() [2/2]

template<class T , class Allocator = std::allocator<T>>
T& amrex::PODVector< T, Allocator >::back ( )
inlinenoexcept

◆ begin() [1/2]

template<class T , class Allocator = std::allocator<T>>
const_iterator amrex::PODVector< T, Allocator >::begin ( ) const
inlinenoexcept

◆ begin() [2/2]

template<class T , class Allocator = std::allocator<T>>
iterator amrex::PODVector< T, Allocator >::begin ( )
inlinenoexcept

◆ capacity()

template<class T , class Allocator = std::allocator<T>>
size_type amrex::PODVector< T, Allocator >::capacity ( ) const
inlinenoexcept

◆ cbegin()

template<class T , class Allocator = std::allocator<T>>
const_iterator amrex::PODVector< T, Allocator >::cbegin ( ) const
inlinenoexcept

◆ cend()

template<class T , class Allocator = std::allocator<T>>
const_iterator amrex::PODVector< T, Allocator >::cend ( ) const
inlinenoexcept

◆ clear()

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::clear ( )
inlinenoexcept

◆ crbegin()

template<class T , class Allocator = std::allocator<T>>
const_reverse_iterator amrex::PODVector< T, Allocator >::crbegin ( ) const
inlinenoexcept

◆ crend()

template<class T , class Allocator = std::allocator<T>>
const_reverse_iterator amrex::PODVector< T, Allocator >::crend ( ) const
inlinenoexcept

◆ data() [1/2]

template<class T , class Allocator = std::allocator<T>>
const T* amrex::PODVector< T, Allocator >::data ( ) const
inlinenoexcept

◆ data() [2/2]

template<class T , class Allocator = std::allocator<T>>
T* amrex::PODVector< T, Allocator >::data ( )
inlinenoexcept

◆ dataPtr() [1/2]

template<class T , class Allocator = std::allocator<T>>
const T* amrex::PODVector< T, Allocator >::dataPtr ( ) const
inlinenoexcept

◆ dataPtr() [2/2]

template<class T , class Allocator = std::allocator<T>>
T* amrex::PODVector< T, Allocator >::dataPtr ( )
inlinenoexcept

◆ empty()

template<class T , class Allocator = std::allocator<T>>
bool amrex::PODVector< T, Allocator >::empty ( ) const
inlinenoexcept

◆ end() [1/2]

template<class T , class Allocator = std::allocator<T>>
const_iterator amrex::PODVector< T, Allocator >::end ( ) const
inlinenoexcept

◆ end() [2/2]

template<class T , class Allocator = std::allocator<T>>
iterator amrex::PODVector< T, Allocator >::end ( )
inlinenoexcept

◆ erase() [1/2]

template<class T , class Allocator = std::allocator<T>>
iterator amrex::PODVector< T, Allocator >::erase ( const_iterator  a_first,
const_iterator  a_last 
)
inline

◆ erase() [2/2]

template<class T , class Allocator = std::allocator<T>>
iterator amrex::PODVector< T, Allocator >::erase ( const_iterator  a_pos)
inline

◆ front() [1/2]

template<class T , class Allocator = std::allocator<T>>
const T& amrex::PODVector< T, Allocator >::front ( ) const
inlinenoexcept

◆ front() [2/2]

template<class T , class Allocator = std::allocator<T>>
T& amrex::PODVector< T, Allocator >::front ( )
inlinenoexcept

◆ get_allocator()

template<class T , class Allocator = std::allocator<T>>
allocator_type amrex::PODVector< T, Allocator >::get_allocator ( ) const
inlinenoexcept

◆ GetNewCapacityForPush()

template<class T , class Allocator = std::allocator<T>>
size_type amrex::PODVector< T, Allocator >::GetNewCapacityForPush ( ) const
inlineprivatenoexcept

◆ insert() [1/5]

template<class T , class Allocator = std::allocator<T>>
iterator amrex::PODVector< T, Allocator >::insert ( const_iterator  a_pos,
const T &  a_item 
)
inline

◆ insert() [2/5]

template<class T , class Allocator = std::allocator<T>>
template<class InputIt , class bar = typename std::iterator_traits<InputIt>::difference_type>
iterator amrex::PODVector< T, Allocator >::insert ( const_iterator  a_pos,
InputIt  a_first,
InputIt  a_last 
)
inline

◆ insert() [3/5]

template<class T , class Allocator = std::allocator<T>>
iterator amrex::PODVector< T, Allocator >::insert ( const_iterator  a_pos,
size_type  a_count,
const T &  a_value 
)
inline

◆ insert() [4/5]

template<class T , class Allocator = std::allocator<T>>
iterator amrex::PODVector< T, Allocator >::insert ( const_iterator  a_pos,
std::initializer_list< T >  a_initializer_list 
)
inline

◆ insert() [5/5]

template<class T , class Allocator = std::allocator<T>>
iterator amrex::PODVector< T, Allocator >::insert ( const_iterator  a_pos,
T &&  a_item 
)
inline

◆ nBytes()

template<class T , class Allocator = std::allocator<T>>
size_type amrex::PODVector< T, Allocator >::nBytes ( ) const
inlineprivatenoexcept

◆ operator=() [1/2]

template<class T , class Allocator = std::allocator<T>>
PODVector& amrex::PODVector< T, Allocator >::operator= ( const PODVector< T, Allocator > &  a_vector)
inline

◆ operator=() [2/2]

template<class T , class Allocator = std::allocator<T>>
PODVector& amrex::PODVector< T, Allocator >::operator= ( PODVector< T, Allocator > &&  a_vector)
inlinenoexcept

◆ operator[]() [1/2]

template<class T , class Allocator = std::allocator<T>>
const T& amrex::PODVector< T, Allocator >::operator[] ( size_type  a_index) const
inlinenoexcept

◆ operator[]() [2/2]

template<class T , class Allocator = std::allocator<T>>
T& amrex::PODVector< T, Allocator >::operator[] ( size_type  a_index)
inlinenoexcept

◆ pop_back()

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::pop_back ( )
inlinenoexcept

◆ push_back()

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::push_back ( const T &  a_value)
inline

◆ rbegin() [1/2]

template<class T , class Allocator = std::allocator<T>>
const_reverse_iterator amrex::PODVector< T, Allocator >::rbegin ( ) const
inlinenoexcept

◆ rbegin() [2/2]

template<class T , class Allocator = std::allocator<T>>
reverse_iterator amrex::PODVector< T, Allocator >::rbegin ( )
inlinenoexcept

◆ rend() [1/2]

template<class T , class Allocator = std::allocator<T>>
const_reverse_iterator amrex::PODVector< T, Allocator >::rend ( ) const
inlinenoexcept

◆ rend() [2/2]

template<class T , class Allocator = std::allocator<T>>
reverse_iterator amrex::PODVector< T, Allocator >::rend ( )
inlinenoexcept

◆ reserve()

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::reserve ( size_type  a_capacity)
inline

◆ resize() [1/2]

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::resize ( size_type  a_new_size)
inline

◆ resize() [2/2]

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::resize ( size_type  a_new_size,
const T &  a_val 
)
inline

◆ resize_without_init_snan()

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::resize_without_init_snan ( size_type  a_new_size)
inlineprivate

◆ shrink_to_fit()

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::shrink_to_fit ( )
inline

◆ size()

template<class T , class Allocator = std::allocator<T>>
size_type amrex::PODVector< T, Allocator >::size ( ) const
inlinenoexcept

◆ swap()

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::swap ( PODVector< T, Allocator > &  a_vector)
inlinenoexcept

◆ UpdateDataPtr()

template<class T , class Allocator = std::allocator<T>>
void amrex::PODVector< T, Allocator >::UpdateDataPtr ( FatPtr< T > const &  fp)
inlineprivate

Member Data Documentation

◆ m_capacity

template<class T , class Allocator = std::allocator<T>>
size_type amrex::PODVector< T, Allocator >::m_capacity {0}
private

◆ m_data

template<class T , class Allocator = std::allocator<T>>
pointer amrex::PODVector< T, Allocator >::m_data = nullptr
private

◆ m_size

template<class T , class Allocator = std::allocator<T>>
size_type amrex::PODVector< T, Allocator >::m_size {0}
private

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