Dune::ArrayList< T, N, A > Class Template Reference
[Common]
#include <arraylist.hh>
Detailed Description
template<class T, int N = 100, class A = std::allocator<T>>
class Dune::ArrayList< T, N, A >
A dynamically growing random access list.
Internally the data is organized in a list of arrays of fixed size. Whenever the capacity of the array list is not sufficient a new Dune::array is allocated. In contrast to std::vector this approach prevents data copying. On the outside we provide the same interface as the stl random access containers.
Public Types | |
enum | { chunkSize_ = (N > 0)? N : 1 } |
typedef T | MemberType |
The member type that is stored. | |
typedef T | value_type |
Value type for stl compliance. | |
typedef T & | reference |
The type of a reference to the type we store. | |
typedef const T & | const_reference |
The type of a const reference to the type we store. | |
typedef T * | pointer |
The type of a pointer to the type we store. | |
typedef const T * | const_pointer |
The type of a const pointer to the type we store. | |
typedef ArrayListIterator< MemberType, N, A > | iterator |
A random access iterator. | |
typedef ConstArrayListIterator< MemberType, N, A > | const_iterator |
A constant random access iterator. | |
typedef std::size_t | size_type |
The size type. | |
typedef std::ptrdiff_t | difference_type |
The difference type. | |
Public Member Functions | |
iterator | begin () |
Get an iterator that is positioned at the first element. | |
const_iterator | begin () const |
Get a random access iterator that is positioned at the first element. | |
iterator | end () |
Get a random access iterator positioned after the last element. | |
const_iterator | end () const |
Get a random access iterator positioned after the last element. | |
void | push_back (const_reference entry) |
Append an entry to the list. | |
reference | operator[] (size_type i) |
Get the element at specific position. | |
const_reference | operator[] (size_type i) const |
Get the element at specific position. | |
size_type | size () const |
Get the number of elements in the list. | |
size_type | capacity () const |
Get the current capacity of the list. | |
void | purge () |
Purge the list. | |
void | clear () |
Delete all entries from the list. | |
ArrayList () | |
Constructs an Array list with one chunk. |
Member Typedef Documentation
template<class T, int N = 100, class A = std::allocator<T>>
typedef T Dune::ArrayList< T, N, A >::MemberType |
The member type that is stored.
Has to be assignable and has to have an empty constructor.
Member Enumeration Documentation
template<class T, int N = 100, class A = std::allocator<T>>
anonymous enum |
The documentation for this class was generated from the following file: