#include <basicsimulation.h>

Public Member Functions | |
| ComponentManager () | |
| ~ComponentManager () | |
| void | build_component_list () |
| Clears and builds the list of all components from the lists of trait prototype templates and life cycle event templates. | |
| void | add_component (SimComponent *cmpt) |
| Push a component at the back of the component list. | |
| void | add_trait (TraitPrototype *trait) |
| Add a trait prototype to the template and component lists. | |
| void | add_LCE (LifeCycleEvent *event) |
| Add a life cycle event to the template and component lists. | |
| TraitPrototype * | get_trait (string &name) |
| Search for component with "name" in the trait prototype list. | |
| LifeCycleEvent * | get_LCE (string &name) |
| Search for component with "name" in the life cycle events list. | |
Protected Attributes | |
| list< SimComponent * > | _components |
| List of all the simulation components. | |
| list< TraitPrototype * > | _TTrait_Templates |
| List of all trait prototypes of the simulation, a subset of _components list. | |
| list< LifeCycleEvent * > | _LCE_Templates |
| List of all the life-cycle events of the simulation, a subset of _components list. | |
This class stores and provides accessors to the simulation components. It also stores the trait prototype and life cycle event template instances.
Definition at line 46 of file basicsimulation.h.
| ComponentManager::ComponentManager | ( | ) | [inline] |
| ComponentManager::~ComponentManager | ( | ) | [inline] |
| void ComponentManager::add_component | ( | SimComponent * | cmpt | ) | [inline] |
Push a component at the back of the component list.
Definition at line 54 of file basicsimulation.h.
00054 {_components.push_back(cmpt);}
| void ComponentManager::add_LCE | ( | LifeCycleEvent * | event | ) | [inline] |
Add a life cycle event to the template and component lists.
Definition at line 58 of file basicsimulation.h.
Referenced by SIMenv::loadDefaultComponents(), and SimBuilder::SimBuilder().
00058 {_LCE_Templates.push_back(event);_components.push_back(event);}
| void ComponentManager::add_trait | ( | TraitPrototype * | trait | ) | [inline] |
Add a trait prototype to the template and component lists.
Definition at line 56 of file basicsimulation.h.
Referenced by SIMenv::loadDefaultComponents(), and SimBuilder::SimBuilder().
00056 {_TTrait_Templates.push_back(trait); _components.push_back(trait);}
| void ComponentManager::build_component_list | ( | ) |
Clears and builds the list of all components from the lists of trait prototype templates and life cycle event templates.
Definition at line 40 of file basicsimulation.cc.
00041 { 00042 _components.clear(); 00043 00044 list< TraitPrototype* >::iterator TT_it = _TTrait_Templates.begin(); 00045 00046 while(TT_it != _TTrait_Templates.end()) { 00047 _components.push_back( (*TT_it) ); 00048 TT_it++; 00049 } 00050 00051 list< LifeCycleEvent* >::iterator LCE_it = _LCE_Templates.begin(); 00052 00053 while(LCE_it != _LCE_Templates.end()) { 00054 _components.push_back( (*LCE_it) ); 00055 LCE_it++; 00056 } 00057 }
| LifeCycleEvent * ComponentManager::get_LCE | ( | string & | name | ) |
Search for component with "name" in the life cycle events list.
Definition at line 77 of file basicsimulation.cc.
00078 { 00079 list< LifeCycleEvent* >::iterator LCE = _LCE_Templates.begin(); 00080 00081 while(LCE != _LCE_Templates.end()) { 00082 00083 if( (*LCE)->get_event_name().compare(name) == 0 ) return (*LCE); 00084 00085 LCE++; 00086 } 00087 00088 return NULL; 00089 }
| TraitPrototype * ComponentManager::get_trait | ( | string & | name | ) |
Search for component with "name" in the trait prototype list.
Definition at line 61 of file basicsimulation.cc.
00062 { 00063 list< TraitPrototype* >::iterator TT = _TTrait_Templates.begin(); 00064 00065 while(TT != _TTrait_Templates.end()) { 00066 00067 if( (*TT)->get_paramset()->getName().compare(name) == 0 ) return (*TT); 00068 00069 TT++; 00070 } 00071 00072 return NULL; 00073 }
list< SimComponent* > ComponentManager::_components [protected] |
List of all the simulation components.
Definition at line 71 of file basicsimulation.h.
Referenced by add_component(), add_LCE(), add_trait(), SimRunner::attach_pop(), ParamManager::build_allParams(), and build_component_list().
list< LifeCycleEvent* > ComponentManager::_LCE_Templates [protected] |
List of all the life-cycle events of the simulation, a subset of _components list.
Definition at line 75 of file basicsimulation.h.
Referenced by add_LCE(), build_component_list(), SimBuilder::build_LifeCycle(), get_LCE(), and SimBuilder::SimBuilder().
list< TraitPrototype* > ComponentManager::_TTrait_Templates [protected] |
List of all trait prototypes of the simulation, a subset of _components list.
Definition at line 73 of file basicsimulation.h.
Referenced by add_trait(), build_component_list(), SimBuilder::build_currentTraits(), get_trait(), and SimBuilder::SimBuilder().
1.5.8 -- Nemo is hosted by