CppELib 1.7.0
Loading...
Searching...
No Matches
Container::FixedDeque< T, MaxSize > Class Template Reference

STL-like deque container with fixed capacity. More...

#include <FixedDeque.h>

Public Types

typedef T value_type
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef FixedDeque_iterator< T, T &, T *, FixedDeque *, MaxSizeiterator
 
typedef FixedDeque_iterator< T, const T &, const T *, const FixedDeque *, MaxSizeconst_iterator
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

 FixedDeque ()
 
 FixedDeque (size_type n, const T &data=T())
 
template<typename InputIterator >
 FixedDeque (InputIterator first, InputIterator last)
 
 FixedDeque (const FixedDeque &x)
 
 ~FixedDeque ()
 
FixedDequeoperator= (const FixedDeque &x)
 
size_type size () const
 
size_type max_size () const
 
size_type available_size () const
 
bool empty () const
 
bool full () const
 
void clear ()
 
reference operator[] (size_type idx)
 
const_reference operator[] (size_type idx) const
 
reference at (size_type idx)
 
const_reference at (size_type idx) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
void resize (size_type n, const T &data=T())
 
void push_back (const T &data)
 
void pop_back ()
 
void push_front (const T &data)
 
void pop_front ()
 
void assign (size_type n, const T &data)
 
template<typename InputIterator >
void assign (InputIterator first, InputIterator last)
 
iterator insert (iterator pos, const T &data)
 
void insert (iterator pos, size_type n, const T &data)
 
template<typename InputIterator >
void insert (iterator pos, InputIterator first, InputIterator last)
 
iterator erase (iterator pos)
 
iterator erase (iterator first, iterator last)
 

Detailed Description

template<typename T, std::size_t MaxSize>
class Container::FixedDeque< T, MaxSize >

STL-like deque container with fixed capacity.

Template Parameters
TType of element
MaxSizeMax of elements that can be stored (that is decided at compile-time)

Almost all the method specification is similar as STL deque, but this container can not expand the capacity.

Over capacity addition of element throws the exception derived from std::exception. But if CPPELIB_NO_EXCEPTIONS macro is defined, aborted instead of the exception.

Member Typedef Documentation

◆ const_iterator

template<typename T , std::size_t MaxSize>
typedef FixedDeque_iterator<T, const T&, const T*, const FixedDeque*, MaxSize> Container::FixedDeque< T, MaxSize >::const_iterator

◆ const_pointer

template<typename T , std::size_t MaxSize>
typedef const value_type* Container::FixedDeque< T, MaxSize >::const_pointer

◆ const_reference

template<typename T , std::size_t MaxSize>
typedef const value_type& Container::FixedDeque< T, MaxSize >::const_reference

◆ const_reverse_iterator

template<typename T , std::size_t MaxSize>
typedef std::reverse_iterator<const_iterator> Container::FixedDeque< T, MaxSize >::const_reverse_iterator

◆ difference_type

template<typename T , std::size_t MaxSize>
typedef std::ptrdiff_t Container::FixedDeque< T, MaxSize >::difference_type

◆ iterator

template<typename T , std::size_t MaxSize>
typedef FixedDeque_iterator<T, T&, T*, FixedDeque*, MaxSize> Container::FixedDeque< T, MaxSize >::iterator

◆ pointer

template<typename T , std::size_t MaxSize>
typedef value_type* Container::FixedDeque< T, MaxSize >::pointer

◆ reference

template<typename T , std::size_t MaxSize>
typedef value_type& Container::FixedDeque< T, MaxSize >::reference

◆ reverse_iterator

template<typename T , std::size_t MaxSize>
typedef std::reverse_iterator<iterator> Container::FixedDeque< T, MaxSize >::reverse_iterator

◆ size_type

template<typename T , std::size_t MaxSize>
typedef std::size_t Container::FixedDeque< T, MaxSize >::size_type

◆ value_type

template<typename T , std::size_t MaxSize>
typedef T Container::FixedDeque< T, MaxSize >::value_type

Constructor & Destructor Documentation

◆ FixedDeque() [1/4]

template<typename T , std::size_t MaxSize>
Container::FixedDeque< T, MaxSize >::FixedDeque ( )
inline

◆ FixedDeque() [2/4]

template<typename T , std::size_t MaxSize>
Container::FixedDeque< T, MaxSize >::FixedDeque ( size_type  n,
const T data = T() 
)
inlineexplicit

◆ FixedDeque() [3/4]

template<typename T , std::size_t MaxSize>
template<typename InputIterator >
Container::FixedDeque< T, MaxSize >::FixedDeque ( InputIterator  first,
InputIterator  last 
)
inline

◆ FixedDeque() [4/4]

template<typename T , std::size_t MaxSize>
Container::FixedDeque< T, MaxSize >::FixedDeque ( const FixedDeque< T, MaxSize > &  x)
inline

◆ ~FixedDeque()

template<typename T , std::size_t MaxSize>
Container::FixedDeque< T, MaxSize >::~FixedDeque ( )
inline

Member Function Documentation

◆ assign() [1/2]

template<typename T , std::size_t MaxSize>
template<typename InputIterator >
void Container::FixedDeque< T, MaxSize >::assign ( InputIterator  first,
InputIterator  last 
)
inline

◆ assign() [2/2]

template<typename T , std::size_t MaxSize>
void Container::FixedDeque< T, MaxSize >::assign ( size_type  n,
const T data 
)
inline

◆ at() [1/2]

template<typename T , std::size_t MaxSize>
reference Container::FixedDeque< T, MaxSize >::at ( size_type  idx)
inline

◆ at() [2/2]

template<typename T , std::size_t MaxSize>
const_reference Container::FixedDeque< T, MaxSize >::at ( size_type  idx) const
inline

◆ available_size()

template<typename T , std::size_t MaxSize>
size_type Container::FixedDeque< T, MaxSize >::available_size ( ) const
inline

◆ back() [1/2]

template<typename T , std::size_t MaxSize>
reference Container::FixedDeque< T, MaxSize >::back ( )
inline

◆ back() [2/2]

template<typename T , std::size_t MaxSize>
const_reference Container::FixedDeque< T, MaxSize >::back ( ) const
inline

◆ begin() [1/2]

template<typename T , std::size_t MaxSize>
iterator Container::FixedDeque< T, MaxSize >::begin ( )
inline

◆ begin() [2/2]

template<typename T , std::size_t MaxSize>
const_iterator Container::FixedDeque< T, MaxSize >::begin ( ) const
inline

◆ clear()

template<typename T , std::size_t MaxSize>
void Container::FixedDeque< T, MaxSize >::clear ( )
inline

◆ empty()

template<typename T , std::size_t MaxSize>
bool Container::FixedDeque< T, MaxSize >::empty ( ) const
inline

◆ end() [1/2]

template<typename T , std::size_t MaxSize>
iterator Container::FixedDeque< T, MaxSize >::end ( )
inline

◆ end() [2/2]

template<typename T , std::size_t MaxSize>
const_iterator Container::FixedDeque< T, MaxSize >::end ( ) const
inline

◆ erase() [1/2]

template<typename T , std::size_t MaxSize>
iterator Container::FixedDeque< T, MaxSize >::erase ( iterator  first,
iterator  last 
)
inline

◆ erase() [2/2]

template<typename T , std::size_t MaxSize>
iterator Container::FixedDeque< T, MaxSize >::erase ( iterator  pos)
inline

◆ front() [1/2]

template<typename T , std::size_t MaxSize>
reference Container::FixedDeque< T, MaxSize >::front ( )
inline

◆ front() [2/2]

template<typename T , std::size_t MaxSize>
const_reference Container::FixedDeque< T, MaxSize >::front ( ) const
inline

◆ full()

template<typename T , std::size_t MaxSize>
bool Container::FixedDeque< T, MaxSize >::full ( ) const
inline

◆ insert() [1/3]

template<typename T , std::size_t MaxSize>
iterator Container::FixedDeque< T, MaxSize >::insert ( iterator  pos,
const T data 
)
inline

◆ insert() [2/3]

template<typename T , std::size_t MaxSize>
template<typename InputIterator >
void Container::FixedDeque< T, MaxSize >::insert ( iterator  pos,
InputIterator  first,
InputIterator  last 
)
inline

◆ insert() [3/3]

template<typename T , std::size_t MaxSize>
void Container::FixedDeque< T, MaxSize >::insert ( iterator  pos,
size_type  n,
const T data 
)
inline

◆ max_size()

template<typename T , std::size_t MaxSize>
size_type Container::FixedDeque< T, MaxSize >::max_size ( ) const
inline

◆ operator=()

template<typename T , std::size_t MaxSize>
FixedDeque & Container::FixedDeque< T, MaxSize >::operator= ( const FixedDeque< T, MaxSize > &  x)
inline

◆ operator[]() [1/2]

template<typename T , std::size_t MaxSize>
reference Container::FixedDeque< T, MaxSize >::operator[] ( size_type  idx)
inline

◆ operator[]() [2/2]

template<typename T , std::size_t MaxSize>
const_reference Container::FixedDeque< T, MaxSize >::operator[] ( size_type  idx) const
inline

◆ pop_back()

template<typename T , std::size_t MaxSize>
void Container::FixedDeque< T, MaxSize >::pop_back ( )
inline

◆ pop_front()

template<typename T , std::size_t MaxSize>
void Container::FixedDeque< T, MaxSize >::pop_front ( )
inline

◆ push_back()

template<typename T , std::size_t MaxSize>
void Container::FixedDeque< T, MaxSize >::push_back ( const T data)
inline

◆ push_front()

template<typename T , std::size_t MaxSize>
void Container::FixedDeque< T, MaxSize >::push_front ( const T data)
inline

◆ rbegin() [1/2]

template<typename T , std::size_t MaxSize>
reverse_iterator Container::FixedDeque< T, MaxSize >::rbegin ( )
inline

◆ rbegin() [2/2]

template<typename T , std::size_t MaxSize>
const_reverse_iterator Container::FixedDeque< T, MaxSize >::rbegin ( ) const
inline

◆ rend() [1/2]

template<typename T , std::size_t MaxSize>
reverse_iterator Container::FixedDeque< T, MaxSize >::rend ( )
inline

◆ rend() [2/2]

template<typename T , std::size_t MaxSize>
const_reverse_iterator Container::FixedDeque< T, MaxSize >::rend ( ) const
inline

◆ resize()

template<typename T , std::size_t MaxSize>
void Container::FixedDeque< T, MaxSize >::resize ( size_type  n,
const T data = T() 
)
inline

◆ size()

template<typename T , std::size_t MaxSize>
size_type Container::FixedDeque< T, MaxSize >::size ( ) const
inline

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