green::VariableTableInstance Class Reference

#include <VariableTableInstance.h>

Inheritance diagram for green::VariableTableInstance:

green::BehaviorInstance green::MessageInstance List of all members.

Public Member Functions

 VariableTableInstance (boost::shared_ptr< VariableTableInstance > copy)
 VariableTableInstance (Key templ)
Key GetTemplate () const
void SetTemplate (Key templ)
virtual void CopyFrom (boost::shared_ptr< VariableTableInstance > copy)
virtual ~VariableTableInstance ()
 default destructor declared as virtual
ID GetID () const
 get the instance's unique ID
void SetID (ID newID)
 set the instance's unique ID
virtual void AddVariable (Variable::Value value)
size_t GetNumVariables () const
virtual Variable::Value GetVariable (Key key) const
virtual void SetVariable (Key key, Variable::Value value)

Protected Member Functions

 VariableTableInstance ()
 You must use the VariableTableInstance(shared_ptr<templateType>) constructor.

Protected Attributes

ID mID
 The unique ID associated with this instance.
std::vector< Variable::ValuemVariables
 Variable table.
Key mTemplate
 The template for this instance.

Detailed Description

The VariableContainer class is a super class of various objects in the engine. It represents any object that has a table of named Variables. Examples of subclasses of this are Behavior, Message, and Entity. It associates a string (ie, a name) and a Variable, which could be of various types.


Constructor & Destructor Documentation

green::VariableTableInstance::VariableTableInstance ( boost::shared_ptr< VariableTableInstance copy  )  [inline]

Copy constructor for shared_ptr of VariableTableInstance

green::VariableTableInstance::VariableTableInstance ( Key  templ  )  [inline]

Constructor that sets the template key, but nothing else


Member Function Documentation

Key green::VariableTableInstance::GetTemplate (  )  const [inline]

Gets the template key for this instance.

Returns:
Returns the template Key for this instance

void green::VariableTableInstance::SetTemplate ( Key  templ  )  [inline]

Set the template key for this instance

Parameters:
templ The new template Key for this instance

virtual void green::VariableTableInstance::CopyFrom ( boost::shared_ptr< VariableTableInstance copy  )  [inline, virtual]

This = operator will copy the contents of another instance into this one

virtual void green::VariableTableInstance::AddVariable ( Variable::Value  value  )  [inline, virtual]

Add a value to the end of the table

Parameters:
value the type and value of the variable

size_t green::VariableTableInstance::GetNumVariables (  )  const [inline]

Get the number of values in the instance.

virtual Variable::Value green::VariableTableInstance::GetVariable ( Key  key  )  const [inline, virtual]

Get a value, if it exists. Throws an Error if the variable name does not exist.

Parameters:
key the key of the variable to get
Returns:
Returns the variable in question

virtual void green::VariableTableInstance::SetVariable ( Key  key,
Variable::Value  value 
) [inline, virtual]

Set a variable to a certain value. Throws an Error if the key is not a value variable in the table.

Parameters:
name The name of the variable.
value The new value of the variable.


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