#include <KeyNameTable.h>
Inheritance diagram for green::KeyNameTable< entryType >:
Public Types | |
typedef entryType | Entry |
Public Member Functions | |
virtual | ~KeyNameTable () |
size_t | GetNumEntries () const |
bool | HasEntry (Key key) const |
bool | HasEntry (const Name &name) const |
Key | GetKey (const Name &name) const |
entryType | GetEntry (Key key) const |
entryType | GetEntry (const Name &name) const |
void | SetEntry (Key key, entryType newValue) |
void | SetEntry (Name name, entryType newValue) |
virtual Key | AddEntry (const Name &name, entryType element) |
Protected Types | |
typedef boost::shared_ptr< _entry > | _entryPtr |
typedef std::vector< _entryPtr > | _keyMap |
typedef std::map< Name, _entryPtr > | _nameMap |
Protected Member Functions | |
_entryPtr | _getEntry (Key key) const |
_entryPtr | _getEntry (const Name &name) const |
Protected Attributes | |
_keyMap | mKeyMap |
_nameMap | mNameMap |
Classes | |
class | _entry |
typedef std::vector<_entryPtr> green::KeyNameTable< entryType >::_keyMap [protected] |
This is a table which is accessable by Key
typedef std::map<Name, _entryPtr> green::KeyNameTable< entryType >::_nameMap [protected] |
This is a table which is accessable by a name
virtual green::KeyNameTable< entryType >::~KeyNameTable | ( | ) | [inline, virtual] |
Default destructor declared virtual
size_t green::KeyNameTable< entryType >::GetNumEntries | ( | ) | const [inline] |
Get the number of entries in the table
bool green::KeyNameTable< entryType >::HasEntry | ( | Key | key | ) | const [inline] |
Check if an element exists in the table.
key | The unique key associated with the element. |
bool green::KeyNameTable< entryType >::HasEntry | ( | const Name & | name | ) | const [inline] |
Check if an element exists in the table.
name | The name of the element. |
Key green::KeyNameTable< entryType >::GetKey | ( | const Name & | name | ) | const [inline] |
Get they Key associated with an element name.
name | the name of the element. |
entryType green::KeyNameTable< entryType >::GetEntry | ( | Key | key | ) | const [inline] |
Get an element by its key.
key | The unique Key associated with the element. |
entryType green::KeyNameTable< entryType >::GetEntry | ( | const Name & | name | ) | const [inline] |
Get an element by its name.
name | The name of the element. |
void green::KeyNameTable< entryType >::SetEntry | ( | Key | key, | |
entryType | newValue | |||
) | [inline] |
Set a specific entry to a specific value.
key | The key for the entry. Throws an Error if key is not in table. |
void green::KeyNameTable< entryType >::SetEntry | ( | Name | name, | |
entryType | newValue | |||
) | [inline] |
Set a specific entry to a specific value.
name | The name of the entry. Throws an Error if key is not in table. |
virtual Key green::KeyNameTable< entryType >::AddEntry | ( | const Name & | name, | |
entryType | element | |||
) | [inline, virtual] |
Add a new element to the table.
name | The name of the element. If element is already in the table, an Error is thrown. | |
element | The new element. |
_entryPtr green::KeyNameTable< entryType >::_getEntry | ( | Key | key | ) | const [inline, protected] |
Get a _enntry from a key, throws an Error if key not in table
key | The key of the variable. |
_entryPtr green::KeyNameTable< entryType >::_getEntry | ( | const Name & | name | ) | const [inline, protected] |
_keyMap green::KeyNameTable< entryType >::mKeyMap [protected] |
This is the key lookup table
_nameMap green::KeyNameTable< entryType >::mNameMap [protected] |
This is the name lookup table