SPUC  3.0
Public Types | Public Member Functions | Public Attributes | List of all members
SPUC::hash_map< T > Class Template Reference

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...
 
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
 

Detailed Description

template<typename T>
class SPUC::hash_map< T >

Class that implements a hash map with string key.

Member Typedef Documentation

template<typename T >
typedef std::unordered_map<std::string, T> SPUC::hash_map< T >::HashTableType

Member Function Documentation

template<typename T >
bool SPUC::hash_map< T >::add ( std::string  key,
value 
)

Add key and value to the table (return operation success / fail)

template<typename T >
void SPUC::hash_map< T >::clear ( )

Clear all contents of the table.

template<typename T >
bool SPUC::hash_map< T >::contains ( std::string  key)

Check if table already contains key.

template<typename T >
uint32_t SPUC::hash_map< T >::getSize ( )

Get number of elements in the table.

template<typename T >
T SPUC::hash_map< T >::getValue ( std::string  key)

Get value corresponding to key (if it exists)

template<typename T >
bool SPUC::hash_map< T >::remove ( std::string  key)

Remove key and corresponding value from table (return operation success / fail)

template<typename T >
bool SPUC::hash_map< T >::set ( std::string  key,
value 
)

Change value for key (assuming already in table)

Member Data Documentation

template<typename T >
std::unordered_map<std::string, T>::const_iterator SPUC::hash_map< T >::_iter
template<typename T >
HashTableType SPUC::hash_map< T >::table

The documentation for this class was generated from the following file: