#include <EntityTemplate.h>
Inheritance diagram for green::EntityTemplate:
Public Member Functions | |
void | AddBehavior (Key behavior, ArgListPtr args) |
void | AddBehavior (const Name &name, ArgListPtr args) |
void | SetBehaviorKey (size_t behavior, Key key) |
Key | GetBehavior (size_t behavior) const |
const Name & | GetBehaviorName (size_t behavior) |
ArgListPtr | GetBehaviorArgs (size_t behavior) const |
size_t | GetNumBehaviors () const |
void | addInitCode (UnresOpSeqPtr uInitCodeIn) |
This adds the unresolved init code to this entity. | |
UnresOpSeqPtr | getInitCode () |
This gets the unresolved init code from this entity. | |
void | addResolvedInit (VariableTableTemplatePtr argList, OpSeqPtr resdCode) |
This adds resolved init code. This adds resolved code (OpSeq). It also as a hack adds the argList from the other arg list. | |
virtual void | Print (std::ostream &os) |
Protected Attributes | |
std::vector< _listEntry > | mBehaviors |
UnresOpSeqPtr | unresInitCode |
OpSeqPtr | initCode |
Classes | |
class | _listEntry |
void green::EntityTemplate::AddBehavior | ( | Key | behavior, | |
ArgListPtr | args | |||
) | [inline] |
Add a behavior to the end of the behavior list.
behavior | The behavior type to add. | |
args | The ArgList to send to the behavior on instantiation. |
void green::EntityTemplate::AddBehavior | ( | const Name & | name, | |
ArgListPtr | args | |||
) | [inline] |
Add a behavior to the end of the behavior list. Use this function when you only have the name, but not the key for the behavior. Later on you can call SetBehaviorKey to set the key once you know what it is
name | The name of the behavior. | |
args | The arguments you will use to instantiate the behavior. |
void green::EntityTemplate::SetBehaviorKey | ( | size_t | behavior, | |
Key | key | |||
) | [inline] |
Set the key for a behavior you previously only knew the name for.
behavior | the behavior number in this templates behavior list. | |
key | The key of the behavior. |
Key green::EntityTemplate::GetBehavior | ( | size_t | behavior | ) | const [inline] |
Get a specific behavior template from the list.
behavior | The behavior number to get. Throws an Error if behavior is greater than the number of behaviors in the list. |
const Name& green::EntityTemplate::GetBehaviorName | ( | size_t | behavior | ) | [inline] |
Get the name of a behavior in this template's list
behavior | the number of the behavior in this list. |
ArgListPtr green::EntityTemplate::GetBehaviorArgs | ( | size_t | behavior | ) | const [inline] |
Get the arguments for a behavior in the list.
behavior | The behavior number of the behavior arguments you want. |
size_t green::EntityTemplate::GetNumBehaviors | ( | ) | const [inline] |
Get the number of BehaviorTemplates in the list.
void green::EntityTemplate::addInitCode | ( | UnresOpSeqPtr | uInitCodeIn | ) | [inline] |
This adds the unresolved init code to this entity.
uBodyCodeIn | the body code to add |
UnresOpSeqPtr green::EntityTemplate::getInitCode | ( | ) | [inline] |
This gets the unresolved init code from this entity.
void green::EntityTemplate::addResolvedInit | ( | VariableTableTemplatePtr | argList, | |
OpSeqPtr | resdCode | |||
) | [inline] |
This adds resolved init code. This adds resolved code (OpSeq). It also as a hack adds the argList from the other arg list.
argList | the argument list in VariableTableTemplate format to set to InitFormat. | |
resdCode | the OpSeq to set as code |
virtual void green::EntityTemplate::Print | ( | std::ostream & | os | ) | [inline, virtual] |
A nice Print function to print the contents of the table. This version will also print behavior information.
os | The output ostream to print to. |
Reimplemented from green::VariableTableTemplate.