SPUC
3.0
|
Class that implements a hash map with string key. More...
#include <hash_map.h>
Public Types | |
typedef std::unordered_map < std::string, T > | HashTableType |
Public Member Functions | |
void | clear () |
Clear all contents of the table. More... | |
uint32_t | getSize () |
Get number of elements in the table. More... | |
bool | add (std::string key, T value) |
Add key and value to the table (return operation success / fail) More... | |
bool | set (std::string key, T value) |
Change value for key (assuming already in table) More... | |
bool | contains (std::string key) |
Check if table already contains key. More... | |
bool | remove (std::string key) |
Remove key and corresponding value from table (return operation success / fail) More... | |
T | getValue (std::string key) |
Get value corresponding to key (if it exists) More... | |
Public Attributes | |
HashTableType | table |
std::unordered_map < std::string, T > ::const_iterator | _iter |
Class that implements a hash map with string key.
typedef std::unordered_map<std::string, T> SPUC::hash_map< T >::HashTableType |
bool SPUC::hash_map< T >::add | ( | std::string | key, |
T | value | ||
) |
Add key and value to the table (return operation success / fail)
void SPUC::hash_map< T >::clear | ( | ) |
Clear all contents of the table.
bool SPUC::hash_map< T >::contains | ( | std::string | key | ) |
Check if table already contains key.
uint32_t SPUC::hash_map< T >::getSize | ( | ) |
Get number of elements in the table.
T SPUC::hash_map< T >::getValue | ( | std::string | key | ) |
Get value corresponding to key (if it exists)
bool SPUC::hash_map< T >::remove | ( | std::string | key | ) |
Remove key and corresponding value from table (return operation success / fail)
bool SPUC::hash_map< T >::set | ( | std::string | key, |
T | value | ||
) |
Change value for key (assuming already in table)
std::unordered_map<std::string, T>::const_iterator SPUC::hash_map< T >::_iter |
HashTableType SPUC::hash_map< T >::table |