BALL::StringHashMap< Value > Class Template Reference
[Generic Hash Associative Containers]

#include <BALL/DATATYPE/stringHashMap.h>

Inheritance diagram for BALL::StringHashMap< Value >:
BALL::HashMap< String, Value > BALL_MAP_NAME

List of all members.


Public Types

Type Definitions
typedef HashMap< String, Value >
::Iterator 
Iterator
typedef HashMap< String, Value >
::ConstIterator 
ConstIterator
typedef HashMap< String, Value >
::ValueType 
ValueType

Public Member Functions

Constructors and Destructors


 StringHashMap ()
 StringHashMap (const StringHashMap &map)
virtual ~StringHashMap ()
void destroy ()
Assignment


void set (const StringHashMap &hash_map)
const StringHashMapoperator= (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, boolinsert (const ValueType &obj)
::std::pair< Iterator, boolinsert (const String &key, const Value &value)
bool remove (const String &key)
Size getSize () const
Predicates


bool operator== (const StringHashMap< Value > &hash_map) const
bool operator!= (const StringHashMap< Value > &hash_map) const
bool has (const String &key) const
bool isEmpty () const
Miscellaneous


void host (Visitor< StringHashMap< Value > > &visitor)

Detailed Description

template<typename Value>
class BALL::StringHashMap< Value >

StringHashMap


Member Typedef Documentation

template<typename Value>
typedef HashMap<String, Value>::ConstIterator BALL::StringHashMap< Value >::ConstIterator

Const iterator type

Reimplemented from BALL::HashMap< String, Value >.

template<typename Value>
typedef HashMap<String, Value>::Iterator BALL::StringHashMap< Value >::Iterator

Iterator type

Reimplemented from BALL::HashMap< String, Value >.

template<typename Value>
typedef HashMap<String, Value>::ValueType BALL::StringHashMap< Value >::ValueType

Value type

Reimplemented from BALL::HashMap< String, Value >.


Constructor & Destructor Documentation

template<typename Value>
BALL::StringHashMap< Value >::StringHashMap (  )  [inline]

Default constructor. Create an empty hash map.

template<typename Value>
BALL::StringHashMap< Value >::StringHashMap ( const StringHashMap< Value > &  map  )  [inline]

Copy constructor. Create a copy of an existing hash map.

Parameters:
map the hash map to be copied
template<typename Value>
virtual BALL::StringHashMap< Value >::~StringHashMap (  )  [inline, virtual]

Destructor. Destruct the hash map and free all used memory.


Member Function Documentation

template<typename Value>
void BALL::StringHashMap< Value >::destroy (  )  [inline]

Clear the hash map. Remove all contents from the hash map.

template<typename Value>
void BALL::StringHashMap< Value >::get ( StringHashMap< Value > &  hash_map  )  const [inline]

Assigns the content of a hash map to another.

template<typename Value>
Size BALL::StringHashMap< Value >::getSize (  )  const [inline]

Return the size of the hash map.

template<typename Value>
bool BALL::StringHashMap< Value >::has ( const String key  )  const [inline]

Decide whether the hash map contains a given key.

Reimplemented from BALL::HashMap< String, Value >.

template<typename Value>
void BALL::StringHashMap< Value >::host ( Visitor< StringHashMap< Value > > &  visitor  )  [inline]

Visitor host method. StringHashMaps may be visited.

Parameters:
visitor the visitor
template<typename Value>
::std::pair<Iterator, bool> BALL::StringHashMap< Value >::insert ( const String key,
const Value value 
) [inline]

Insert a given value and key.

Parameters:
value the value to be inserted
key the value`s key
template<typename Value>
std::pair<Iterator, bool> BALL::StringHashMap< Value >::insert ( const ValueType obj  )  [inline]

Insert a pair of key and value.

Referenced by BALL::StringHashMap< ColorRGBA >::insert(), and BALL::StringHashMap< ColorRGBA >::set().

template<typename Value>
bool BALL::StringHashMap< Value >::isEmpty (  )  const [inline]

Return true if the hash map is empty. This method return true if the hash map does not contain any entries.

template<typename Value>
bool BALL::StringHashMap< Value >::operator!= ( const StringHashMap< Value > &  hash_map  )  const [inline]

Compare two string hash maps.

template<typename Value>
const StringHashMap& BALL::StringHashMap< Value >::operator= ( const StringHashMap< Value > &  hash_map  )  [inline]

Assign a hash map from another.

template<typename Value>
bool BALL::StringHashMap< Value >::operator== ( const StringHashMap< Value > &  hash_map  )  const [inline]
template<typename Value>
bool BALL::StringHashMap< Value >::remove ( const String key  )  [inline]

Remove the entry key from the map.

Parameters:
key the key of the entry to be removed
Returns:
bool true if the key was removed
template<typename Value>
void BALL::StringHashMap< Value >::set ( const StringHashMap< Value > &  hash_map  )  [inline]

Assign a hash map from another. Create a copy of a hash map.

Parameters:
hash_map the map to be copied

Referenced by BALL::StringHashMap< ColorRGBA >::get().

template<typename Value>
void BALL::StringHashMap< Value >::swap ( StringHashMap< Value > &  hash_map  )  [inline]

Swaps the contents of two hash maps.

Referenced by BALL::StringHashMap< ColorRGBA >::swap().