torc::generic::SymTab< _KeyType, _ValueType, cOverWriteExisting > Class Template Reference

A symbol table. More...

#include <SymTab.hpp>

Inheritance diagram for torc::generic::SymTab< _KeyType, _ValueType, cOverWriteExisting >:

Inheritance graph
[legend]

List of all members.

Public Types

typedef _KeyType KeyType
typedef _ValueType ValueType
typedef std::map< KeyType, Data > Map
typedef std::map< KeyType,
ValueType > 
UserMap

Public Member Functions

bool get (const KeyType &inKey, ValueType &outValue) const throw ()
bool set (const KeyType &inKey, const ValueType &inValue) throw ()
bool remove (const KeyType &inKey) throw ()
void getValues (std::vector< ValueType > &outValues) const throw ()
void getValueMap (UserMap &outMap) const throw ()
size_t getSize () const throw ()
void clear () throw ()
template<typename _Action>
void applyOnAll (const _Action &action) throw (Error)

Private Attributes

Map mValues
size_t mNextValue

Classes

struct  Data


Detailed Description

template<typename _KeyType, typename _ValueType, bool cOverWriteExisting = false>
class torc::generic::SymTab< _KeyType, _ValueType, cOverWriteExisting >

A symbol table.

This class acts as a symbol table to store key-value pairs

Definition at line 44 of file SymTab.hpp.


Member Function Documentation

template<typename _KeyType, typename _ValueType, bool cOverWriteExisting>
bool torc::generic::SymTab< _KeyType, _ValueType, cOverWriteExisting >::get ( const KeyType &  inKey,
ValueType &  outValue 
) const throw () [inline]

Get a value for a key

Parameters:
[in] inKey key to look for
[out] outValue resultant value
Returns:
true if object was found

Definition at line 154 of file SymTab.hpp.

template<typename _KeyType, typename _ValueType, bool cOverWriteExisting>
bool torc::generic::SymTab< _KeyType, _ValueType, cOverWriteExisting >::set ( const KeyType &  inKey,
const ValueType &  inValue 
) throw () [inline]

Set a value for a key. If cOverWriteExisting is true, Existing value will be replaced.

Parameters:
[in] inKey key to look for
[in] inValue value to be stored
Returns:
True if value was inserted

Definition at line 169 of file SymTab.hpp.

template<typename _KeyType, typename _ValueType, bool cOverWriteExisting>
bool torc::generic::SymTab< _KeyType, _ValueType, cOverWriteExisting >::remove ( const KeyType &  inKey  )  throw () [inline]

Remove a value for a key

Parameters:
[in] inKey key to look for
Returns:
true if object was removed

Definition at line 200 of file SymTab.hpp.


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

Generated on Thu Oct 13 16:50:28 2011 for TORC by  doxygen 1.5.6