|
Glossygloss
0.2
Glossygloss is set of classes to use several data structure as Tree or hash table.
|
Maps a key to a value. More...
#include <hashtable.hpp>
Public Member Functions | |
| Hashtable () | |
| ~Hashtable () | |
| bool | contains (const K &key) |
| V | get (const K &key) |
| bool | isEmpty () |
| void | put (K key, V value) |
| void | remove (const K &key) |
| FIXME : remove last element of a list lead to a seg. fault. More... | |
| string | toString () |
| void | getPairs (forward_list< pair< string, int >> &pairs) |
Private Attributes | |
| Alveole< K, V > ** | _table |
Maps a key to a value.
array of alveoles Simple constructor
Do table contains key ?
| [in] | key | key to find |
| [out] | bool | True if the key is here, else false |
Return the value maped to the specified key
| [in] | key | a key in the hashtable |
| [out] | value | value associated with the key |
| HashtableException | threw if key is not in the hashtable |
| void Hashtable< K, V >::getPairs | ( | forward_list< pair< string, int >> & | pairs | ) |
Get a list of all kay and their value in pairs
| [in] | pairs | Vector which contains keys to find |
Tests if this hashtable maps no keys to values.
| [out] | bool | true if no elements in the hashtable, else false; |
Map the specified key to the specified value in this hashtable. or update the maped value to the key
| [in] | key | key of the pair |
| [in] | value | value of the pair |
FIXME : remove last element of a list lead to a seg. fault.
Remove the key (and its corresponding value) from this hashtable.
| [in] | key | Key of the pair to delete |
| HashtableException | threw if table does not contain key |
Return a description of the hashtable, enclosed in braces as well as {key, value}.
| [out] | desc | a string representation of this hashtable. |
1.8.6