cartobase  5.0.5
carto::block< T, N > Struct Template Reference

This array class extends the STL. More...

#include <cartobase/containers/block.h>

Collaboration diagram for carto::block< T, N >:

Public Types

typedef T value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef ptrdiff_t difference_type
 
typedef size_t size_type
 
typedef pointer iterator
 
typedef const_pointer const_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

reference operator[] (size_t d)
 
const_reference operator[] (size_t d) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
size_type size () const
 
size_type max_size () const
 
bool empty () const
 

Public Attributes

data [N]
 

Detailed Description

template<class T, size_t N>
struct carto::block< T, N >

This array class extends the STL.

It is defined in http://www2.awl.com/cseng/titles/0-201-30956-4/ Generic Programming and the STL, pp. 60-67. See also http://www2.awl.com/cseng/titles/0-201-88954-4/ The C++ Programming Language, 3rd edition, pp. 496-497, for a similar class named c_array.

This container class works like a std::vector (STL) but with a fixed size in order to provide a fast and efficient allocation. So it has iterators and begin() / end() methods, but no push_back() / insert() functions.

Definition at line 62 of file block.h.

Member Typedef Documentation

◆ const_iterator

template<class T, size_t N>
typedef const_pointer carto::block< T, N >::const_iterator

Definition at line 75 of file block.h.

◆ const_pointer

template<class T, size_t N>
typedef const value_type* carto::block< T, N >::const_pointer

Definition at line 67 of file block.h.

◆ const_reference

template<class T, size_t N>
typedef const value_type& carto::block< T, N >::const_reference

Definition at line 69 of file block.h.

◆ const_reverse_iterator

template<class T, size_t N>
typedef std::reverse_iterator< const_iterator > carto::block< T, N >::const_reverse_iterator

Definition at line 85 of file block.h.

◆ difference_type

template<class T, size_t N>
typedef ptrdiff_t carto::block< T, N >::difference_type

Definition at line 71 of file block.h.

◆ iterator

template<class T, size_t N>
typedef pointer carto::block< T, N >::iterator

Definition at line 74 of file block.h.

◆ pointer

template<class T, size_t N>
typedef value_type* carto::block< T, N >::pointer

Definition at line 66 of file block.h.

◆ reference

template<class T, size_t N>
typedef value_type& carto::block< T, N >::reference

Definition at line 68 of file block.h.

◆ reverse_iterator

template<class T, size_t N>
typedef std::reverse_iterator< iterator > carto::block< T, N >::reverse_iterator

Definition at line 84 of file block.h.

◆ size_type

template<class T, size_t N>
typedef size_t carto::block< T, N >::size_type

Definition at line 72 of file block.h.

◆ value_type

template<class T, size_t N>
typedef T carto::block< T, N >::value_type

Definition at line 65 of file block.h.

Member Function Documentation

◆ begin() [1/2]

template<class T , size_t N>
carto::block< T, N >::iterator carto::block< T, N >::begin ( )
inline

Definition at line 139 of file block.h.

References carto::block< T, N >::data.

Referenced by carto::block< T, N >::rend().

◆ begin() [2/2]

template<class T , size_t N>
carto::block< T, N >::const_iterator carto::block< T, N >::begin ( ) const
inline

Definition at line 160 of file block.h.

References carto::block< T, N >::data.

◆ empty()

template<class T , size_t N>
bool carto::block< T, N >::empty ( ) const
inline

Definition at line 242 of file block.h.

◆ end() [1/2]

template<class T , size_t N>
carto::block< T, N >::iterator carto::block< T, N >::end ( )
inline

Definition at line 149 of file block.h.

References carto::block< T, N >::data.

Referenced by carto::block< T, N >::rbegin().

◆ end() [2/2]

template<class T , size_t N>
carto::block< T, N >::const_iterator carto::block< T, N >::end ( ) const
inline

Definition at line 170 of file block.h.

References carto::block< T, N >::data.

◆ max_size()

template<class T , size_t N>
carto::block< T, N >::size_type carto::block< T, N >::max_size ( ) const
inline

Definition at line 232 of file block.h.

◆ operator[]() [1/2]

template<class T , size_t N>
carto::block< T, N >::reference carto::block< T, N >::operator[] ( size_t  d)
inline

Definition at line 116 of file block.h.

References carto::block< T, N >::data.

◆ operator[]() [2/2]

template<class T , size_t N>
carto::block< T, N >::const_reference carto::block< T, N >::operator[] ( size_t  d) const
inline

Definition at line 128 of file block.h.

References carto::block< T, N >::data.

◆ rbegin() [1/2]

template<class T , size_t N>
carto::block< T, N >::reverse_iterator carto::block< T, N >::rbegin ( )
inline

Definition at line 180 of file block.h.

References carto::block< T, N >::end().

◆ rbegin() [2/2]

template<class T , size_t N>
carto::block< T, N >::const_reverse_iterator carto::block< T, N >::rbegin ( ) const
inline

Definition at line 201 of file block.h.

References carto::block< T, N >::end().

◆ rend() [1/2]

template<class T , size_t N>
carto::block< T, N >::reverse_iterator carto::block< T, N >::rend ( )
inline

Definition at line 190 of file block.h.

References carto::block< T, N >::begin().

◆ rend() [2/2]

template<class T , size_t N>
carto::block< T, N >::const_reverse_iterator carto::block< T, N >::rend ( ) const
inline

Definition at line 212 of file block.h.

References carto::block< T, N >::begin().

◆ size()

template<class T , size_t N>
carto::block< T, N >::size_type carto::block< T, N >::size ( ) const
inline

Definition at line 222 of file block.h.

Member Data Documentation

◆ data

template<class T, size_t N>
T carto::block< T, N >::data[N]

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