HashList class. Like HashTable, but much less dynamic memory-y. Should be faster for small sets of non-dynamic primitive types (labels, edges, points, etc...). It is also much less functional at present. There is no re-sizing, so you have to make sure it is constructed sufficiently large to hold all the data that will ever be inserted into it. More...
Public Member Functions | |
HashList (const label size) | |
Construct given a size. More... | |
label | capacity () const |
The size of the underlying list. More... | |
void | clear () |
Clear all elements. More... | |
void | resizeAndClear (const label newSize) |
Resize and clear all elements. More... | |
bool | insert (const Key &k, const Type &t) |
Insert into the hash list. Return true if the value was newly. More... | |
const Type & | operator[] (const Key &k) const |
Retrieve from the hash list. More... | |
const edge | nullKey (-labelMax, -labelMax) |
Static Public Attributes | |
static const Key | nullKey = Key::null |
Null key value for unset elements in the list. More... | |
HashList class. Like HashTable, but much less dynamic memory-y. Should be faster for small sets of non-dynamic primitive types (labels, edges, points, etc...). It is also much less functional at present. There is no re-sizing, so you have to make sure it is constructed sufficiently large to hold all the data that will ever be inserted into it.
Definition at line 57 of file HashList.H.
Construct given a size.
Definition at line 40 of file HashList.C.
|
inline |
The size of the underlying list.
Definition at line 49 of file HashList.C.
void clear |
Clear all elements.
Definition at line 56 of file HashList.C.
void resizeAndClear | ( | const label | newSize | ) |
Resize and clear all elements.
Definition at line 66 of file HashList.C.
References clear(), and resize().
bool insert | ( | const Key & | k, |
const Type & | t | ||
) |
Insert into the hash list. Return true if the value was newly.
inserted, or false if it was already there.
Definition at line 75 of file HashList.C.
const Type & operator[] | ( | const Key & | k | ) | const |
Retrieve from the hash list.
Definition at line 110 of file HashList.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::first(), Foam::constant::universal::h, k, n, and List< T >::size().
const edge nullKey | ( | - | labelMax, |
- | labelMax | ||
) |
|
static |
Null key value for unset elements in the list.
Definition at line 66 of file HashList.H.