Class providing hash table service with a given memory max usage.
More...
#include <Hash16.hpp>
template<typename Item, typename value_type = int>
class gatb::core::tools::collections::impl::Hash16< Item, value_type >
Class providing hash table service with a given memory max usage.
Constructor.
- Parameters
-
[in] | sizeMB | : approx max memory to be used by the hash table |
Hash16 |
( |
u_int64_t |
nb_entries, |
|
|
u_int64_t * |
nb_created |
|
) |
| |
|
inline |
Constructor with directly number of entries wished, return really created in nb_created
- Parameters
-
[in] | nb_entries | : number of entries. |
[in] | nb_created | : number of created items. |
Clear the content of the hash table.
bool contains |
( |
Item |
graine | ) |
|
|
inline |
Tells whether or not the given key exists in the hash table.
- Parameters
-
- Returns
- true if the key exists, 0 otherwise.
int get |
( |
Item |
graine, |
|
|
value_type * |
val |
|
) |
| |
|
inline |
Get the value for a given key
- Parameters
-
[in] | graine | : key |
[out] | val | : value to be retrieved |
- Returns
- 1 if the key exists, 0 otherwise.
u_int64_t getMaxNbItems |
( |
| ) |
|
|
inline |
Get the max number of items allowed by the hash table
- Returns
- the max number of items.
void insert |
( |
Item |
graine, |
|
|
value_type |
value |
|
) |
| |
|
inline |
Insert an item into the hash table
- Parameters
-
[in] | graine | : key |
[in] | value | : value |
void insert |
( |
Item |
graine | ) |
|
|
inline |
Insert an item into the hash table
- Parameters
-
Get an iterator for the hash table.
- Parameters
-
[in] | sorted | : if true, items are iterated in a sorted way (warning: reorder in place so cant acces hash after that !) |
- Returns
- an iterator over the items of the hash table.
int remove |
( |
Item |
graine, |
|
|
value_type * |
val |
|
) |
| |
|
inline |
Remove a key from the hash table.
- Parameters
-
[in] | graine | : key to be removed from the hash table |
[out] | val | : value of the key |
- Returns
- true if the key was found, 0 otherwise
Get the number of items in the hash table
- Returns
- the number of items.
The documentation for this class was generated from the following file:
- /builds/workspace/publish-doc-api-gitlab/gatb-core/src/gatb/tools/collections/impl/Hash16.hpp