|
| Array (int initial_page_count=0) |
|
| Array (Array &array) |
|
void | copy (const Array &array) |
| Makes this array to hold a copy of another one.
|
|
void | free () |
| Removes all elements from the array.
|
|
void | set_append_only (bool append_only) |
|
int | add (TYPE item) |
| Wrapper function for std::vector::add() for compatibility purposes.
|
|
TYPE * | add () |
|
void | remove (int id) |
|
int | first (int idx=0) |
|
int | next (int idx=0) |
|
int | last (int idx=INT_MAX) |
|
int | prev (int idx=INT_MAX) |
|
bool | exists (int idx) |
| Checks whether an element exists at position idx.
|
|
TYPE * | skip_slot () |
|
int | get_size () const |
|
int | get_num_items () const |
|
TYPE & | get (int id) const |
|
TYPE & | operator[] (int id) const |
|
|
TYPE ** | pages |
|
int * | unused |
|
unsigned int | page_count |
|
unsigned int | size |
|
unsigned int | nitems |
|
unsigned int | unused_size |
|
unsigned int | nunused |
|
bool | append_only |
|
template<class TYPE>
class Hermes::Array< TYPE >
Definition at line 43 of file array.h.
Adds a new_ item to the array: either it is appended at the end or an unused item is reused.
- Returns
- A reference to the newly allocated item of the array. The item is assigned an id and its used flag is set to 1.
Definition at line 138 of file array.h.
Referenced by Hermes::Array< TYPE >::add().
Get the first index that is present and is equal to or greater than the passed idx
. Typically used to begin an iteration over all indices present in the array.
- Parameters
-
[in] | idx | Optional, default value 0 (finds the first present index). |
- Returns
- First index present in the array that is equal or greater than the passed
idx
(if found),
INVALID_IDX
(if not found).
Definition at line 188 of file array.h.
Get the last index present in the array that is equal to or less than the passed idx
. Typically used to begin a reverse iteration over all indices present in the array.
- Parameters
-
[in] | idx | Optional, default value (Word_t) -1 (finds the last index present in the array). |
- Returns
- Last index present in the array that is equal or less than the passed
idx
(if found),
INVALID_IDX
(if not found).
Definition at line 222 of file array.h.
Get the first index that is present and is greater than the passed idx
. Typically used to continue an iteration over all indices present in the array.
- Parameters
-
[in] | idx | Index whose succesor we want to find. Optional, default value 0 . |
- Returns
- First idx present in the array that is greater than the passed
idx
(if found),
INVALID_IDX
(if not found).
Definition at line 205 of file array.h.
Get the last index present in the array that is less than the passed idx
. Typically used to continue a reverse iteration over all indices present in the array.
- Parameters
-
[in] | idx | Index whose predecessor we want to find. Optional, default value (Word_t) -1 . |
- Returns
- Last index present in the array that is less than the passed
idx
(if found),
INVALID_IDX
(if not found).
Definition at line 240 of file array.h.
Removes the given item from the array, ie., marks it as unused. Note that the array is never physically shrinked. This should not be a problem, since meshes tend to grow rather than become smaller.
- Parameters
-
Definition at line 167 of file array.h.
Sets or resets the append-only mode. In append-only mode new elements are only added to the end of the array. This can be useful eg. when refining all elements of a mesh in which case the newly added elements must not be processed again by the for-loop. Normally this option should be off.
Definition at line 121 of file array.h.
Adds an unused item at the end of the array and skips its ID forever. This is a special-purpose function used to create empty element slots.
Definition at line 261 of file array.h.
The documentation for this class was generated from the following file: