#include <stringHashMap.h>
Public Types |
|
Type Definitions
|
|
typedef HashMap< String, Value
> ::Iterator |
Iterator |
Iterator type. |
|
typedef HashMap< String, Value
> ::ConstIterator |
ConstIterator |
Const iterator type. |
|
typedef HashMap< String, Value
> ::ValueType |
ValueType |
Value type. |
|
Public Member Functions |
|
Constructors and Destructors
|
|
StringHashMap () | |
Default constructor. |
|
StringHashMap (const StringHashMap &map) | |
Copy constructor. |
|
virtual | ~StringHashMap () |
Destructor. |
|
void | destroy () |
Clear the hash map. |
|
Assignment
|
|
void | set (const StringHashMap &hash_map) |
Assign a hash map from another.
|
|
const StringHashMap & | operator= (const StringHashMap &hash_map) |
Assign a hash map from
another. |
|
void | get (StringHashMap &hash_map) const |
Assigns the content of a hash map to
another. |
|
void | swap (StringHashMap &hash_map) |
Swaps the contents of two hash
maps. |
|
Accessors
|
|
std::pair< Iterator, bool > | insert (const ValueType &obj) |
Insert a pair of key and
value. |
|
::std::pair< Iterator, bool > | insert (const String &key, const Value &value) |
Insert a given value and key.
|
|
bool | remove (const String &key) |
Remove the entry key
from the map. |
|
Size | getSize () const |
Return the size of the hash
map. |
|
Predicates
|
|
bool | operator== (const StringHashMap< Value > &hash_map) const |
Compare two string hash
maps. |
|
bool | operator!= (const StringHashMap< Value > &hash_map) const |
Compare two string hash
maps. |
|
bool | has (const String &key) const |
Decide whether the hash map contains
a given key. |
|
bool | isEmpty () const |
Return true if the hash map is
empty. |
|
Miscellaneous
|
|
void | host (Visitor< StringHashMap< Value > > &visitor) |
Visitor host method. |
BALL::StringHashMap< Value >::StringHashMap | ( | ) |
Default constructor.
Create an empty hash map.
BALL::StringHashMap< Value >::StringHashMap | ( | const StringHashMap< Value > & | map | ) |
Copy constructor.
Create a copy of an existing hash map.
map | the hash map to be copied |
virtual BALL::StringHashMap< Value >::~StringHashMap | ( | ) | [virtual] |
Destructor.
Destruct the hash map and free all used memory.
void BALL::StringHashMap< Value >::destroy | ( | ) |
Clear the hash map.
Remove all contents from the hash map.
void BALL::StringHashMap< Value >::host | ( | Visitor< StringHashMap< Value > > & | visitor | ) |
::std::pair<Iterator, bool> BALL::StringHashMap< Value >::insert | ( | const String & | key, | |
const Value & | value | |||
) |
Insert a given value and key.
value | the value to be inserted | |
key | the value`s key |
bool BALL::StringHashMap< Value >::isEmpty | ( | ) | const |
Return true if the hash map is empty.
This method return true if the hash map does not contain any entries.
bool BALL::StringHashMap< Value >::remove | ( | const String & | key | ) |
Remove the entry key
from the map.
key | the key of the entry to be removed |
void BALL::StringHashMap< Value >::set | ( | const StringHashMap< Value > & | hash_map | ) |
Assign a hash map from another.
Create a copy of a hash map.
hash_map | the map to be copied |
Referenced by BALL::StringHashMap< ColorRGBA >::get().