green::KeyNameTable< entryType > Class Template Reference

#include <KeyNameTable.h>

Inheritance diagram for green::KeyNameTable< entryType >:

green::TemplateTable green::VariableTableTemplate green::BehaviorTemplateTable green::MessageTemplateTable green::BehaviorTemplate green::EntityTemplate green::MessageTemplate List of all members.

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

Detailed Description

template<class entryType>
class green::KeyNameTable< entryType >

Short description before the dot. More description here.


Member Typedef Documentation

template<class entryType>
typedef std::vector<_entryPtr> green::KeyNameTable< entryType >::_keyMap [protected]

This is a table which is accessable by Key

template<class entryType>
typedef std::map<Name, _entryPtr> green::KeyNameTable< entryType >::_nameMap [protected]

This is a table which is accessable by a name


Constructor & Destructor Documentation

template<class entryType>
virtual green::KeyNameTable< entryType >::~KeyNameTable (  )  [inline, virtual]

Default destructor declared virtual


Member Function Documentation

template<class entryType>
size_t green::KeyNameTable< entryType >::GetNumEntries (  )  const [inline]

Get the number of entries in the table

template<class entryType>
bool green::KeyNameTable< entryType >::HasEntry ( Key  key  )  const [inline]

Check if an element exists in the table.

Parameters:
key The unique key associated with the element.
Returns:
Returns true if element is in the table. false otherwise.

template<class entryType>
bool green::KeyNameTable< entryType >::HasEntry ( const Name name  )  const [inline]

Check if an element exists in the table.

Parameters:
name The name of the element.
Returns:
Returns true if element is in the table. false otherwise.

template<class entryType>
Key green::KeyNameTable< entryType >::GetKey ( const Name name  )  const [inline]

Get they Key associated with an element name.

Parameters:
name the name of the element.
Returns:
Returns a unique Key for that element, if it exists. Otherwise throws an Error.

template<class entryType>
entryType green::KeyNameTable< entryType >::GetEntry ( Key  key  )  const [inline]

Get an element by its key.

Parameters:
key The unique Key associated with the element.
Returns:
Returns the type for the specified element. If element is not in the table, an Error is thrown.

template<class entryType>
entryType green::KeyNameTable< entryType >::GetEntry ( const Name name  )  const [inline]

Get an element by its name.

Parameters:
name The name of the element.
Returns:
Returns the type for the specified element. If element is not in the table, an Error is thrown.

template<class entryType>
void green::KeyNameTable< entryType >::SetEntry ( Key  key,
entryType  newValue 
) [inline]

Set a specific entry to a specific value.

Parameters:
key The key for the entry. Throws an Error if key is not in table.

template<class entryType>
void green::KeyNameTable< entryType >::SetEntry ( Name  name,
entryType  newValue 
) [inline]

Set a specific entry to a specific value.

Parameters:
name The name of the entry. Throws an Error if key is not in table.

template<class entryType>
virtual Key green::KeyNameTable< entryType >::AddEntry ( const Name name,
entryType  element 
) [inline, virtual]

Add a new element to the table.

Parameters:
name The name of the element. If element is already in the table, an Error is thrown.
element The new element.
Returns:
Returns the unique key for the new variable.

template<class entryType>
_entryPtr green::KeyNameTable< entryType >::_getEntry ( Key  key  )  const [inline, protected]

Get a _enntry from a key, throws an Error if key not in table

Parameters:
key The key of the variable.

template<class entryType>
_entryPtr green::KeyNameTable< entryType >::_getEntry ( const Name name  )  const [inline, protected]

Get an _entry from a name, throws an Error if name not in table

Parameters:
name The name of the variable.


Member Data Documentation

template<class entryType>
_keyMap green::KeyNameTable< entryType >::mKeyMap [protected]

This is the key lookup table

template<class entryType>
_nameMap green::KeyNameTable< entryType >::mNameMap [protected]

This is the name lookup table


The documentation for this class was generated from the following file:
Generated on Fri Apr 27 10:27:39 2007 for Green Engine by  doxygen 1.5.1