GetFEM
5.4.3
|
Dynamic Array. More...
#include <dal_basic.h>
Inherited by dal::dynamic_tas< green_simplex >, dal::dynamic_tas< size_t, pks >, dal::dynamic_tas< base_node >, dal::dynamic_tas< bgeot::small_vector >, dal::dynamic_tas< base_node, pks >, dal::dynamic_tas< mesh_convex_structure, 8 >, and dal::dynamic_tas< T, pks >.
Public Member Functions | |
size_type | size (void) const |
Number of allocated elements. | |
bool | empty (void) const |
True if no space is allocated. | |
iterator | begin (void) |
Iterator on the first element. | |
const_iterator | begin (void) const |
Constant iterator on the first element. | |
iterator | end (void) |
Iterator on the last + 1 element. | |
const_iterator | end (void) const |
Constant iterator on the last + 1 element. | |
void | clear (void) |
Clear and desallocate all the elements. | |
const_reference | operator[] (size_type ii) const |
Gives a constant reference on element ii. | |
reference | operator[] (size_type ii) |
Gives a reference on element ii. | |
size_type | memsize (void) const |
Gives the total memory occupied by the array. | |
void | swap (size_type i1, size_type i2) |
Swap element i1 and i2. | |
Dynamic Array.
Defines the basic container of the library which is dal::dynamic_array<T, pks>. This container is virtually an infinite array of element of type T. When a random acces tab[i] is called, a control is made on i and an allocation is made if needed. The allocation is made by blocks of n elements, where . is an optional parameter assumed to be 5. The structure of this container is similar to the one of std::deque<T> but with a faster random access.
If T is any type (with or without trivial constructor/destructor, and with constructor T(0) and T(1)), the following code is valid:
Definition at line 196 of file dal_basic.h.