Hash table implementation.
More...
#include <OAHash.hpp>
template<typename Item>
class gatb::core::tools::collections::impl::OAHash< Item >
Hash table implementation.
OAHash |
( |
u_int64_t |
max_memory | ) |
|
|
inline |
Constructor.
- Parameters
-
[in] | max_memory | : max memory for the hash table. |
bool get |
( |
const Item & |
graine, |
|
|
int * |
val = 0 |
|
) |
| |
|
inline |
Get the value for a given key
- Parameters
-
[in] | graine | : key |
[out] | val | : value to be retrieved |
- Returns
- true if the key is found, false otherwise.
Get the max number of items for the hash table
- Returns
- the max items number.
bool has_key |
( |
const Item & |
graine | ) |
|
|
inline |
Tells whether or not the given key is in the table
- Parameters
-
[in] | graine | : key to be checked |
- Returns
- true if present, false otherwise.
void increment |
( |
const Item & |
graine | ) |
|
|
inline |
Increment the value for a given key.
- Parameters
-
void insert |
( |
const Item & |
graine, |
|
|
int |
value |
|
) |
| |
|
inline |
Insert an item with its value into the hash table.
- Parameters
-
[in] | graine | : key |
[in] | value | : value |
Get an iterator for the hash table.
- Parameters
-
[in] | sorted | : if true, items are iterated in a sorted way |
- Returns
- an iterator over the items of the hash table.
Get the load factor of the hash table
- Returns
- the load factor.
u_int64_t memory_usage |
( |
| ) |
|
|
inline |
Get the memory usage of the hash table
- Returns
- the memory usage (in bits).
static int size_entry |
( |
| ) |
|
|
inlinestatic |
Get the size (in byte) of an item.
- Returns
- the item size.
The documentation for this class was generated from the following file:
- /builds/workspace/publish-doc-api-gitlab/gatb-core/src/gatb/tools/collections/impl/OAHash.hpp