![]() |
VR-Forces 4.0.4 Class Documentation
|
The global plan manager maintains the list of "Global Plans." These are plans that are not specific to an entity, but are run stand-alone on a sim engine, possibly creating and deleting entities during execution. More...
Public Member Functions | |
| DtGlobalPlanManager (DtSimManager *simManager) | |
| Basic constructor. | |
| virtual | ~DtGlobalPlanManager () |
| Destructor. | |
| virtual bool | init () |
| virtual void | tick () |
| virtual void | clearPlans () |
| Removes all plans from this plan manager. | |
| virtual void | writePlanFile (const DtString &filename) const |
| Saves all the current plans to the global plan file to the specified name. | |
| virtual bool | readPlanFile (const DtString &filename) |
| Reads the global plan file to the specified name and replaces all current plans with plans from the file. | |
| virtual void | enableExecutionState () |
| Sets the execution state of all plans in the manager. | |
| virtual void | disableExecutionState () |
| Sets the execution state of all plans in the manager. | |
Static Public Member Functions | |
| static void | tickCallback (void *args) |
Protected Types | |
| typedef std::map< DtString, DtPlan * > | DtPlanMap |
Protected Member Functions | |
| virtual void | registerInterfaceMessageCallbacks () |
| Registers for any interface messages that the manager listens to. | |
| virtual void | sendPlanList () |
| Sends a DtIfGlobalPlanList with the current plan names. | |
| virtual void | processRequestPlan (DtSimMessage *msg) |
| Sends a DtIfPlan message for the requested plan if it exists on this sim engine. | |
| virtual void | processSetPlan (DtSimMessage *msg) |
| If this message is applicable to this sim engine, and contains a global plan, this plan is added to the system. | |
| virtual void | setPlan (const DtString &name, const DtList &statementList) |
| Creates a new plan in the plan manager with the specified name, and with the specified statements passed in the statement list. | |
| virtual void | appendToPlan (const DtString &name, const DtList &statementList) |
| Appends the specified statements to the plan of the specified name. | |
| virtual void | processDeletePlan (DtSimMessage *msg) |
| Looks up and removes any global plan that exists with the name specified in the delete plan message (DtIfDeletePlan). | |
| virtual DtPlan * | makePlan (const DtString &name) const |
| Creates and returns a new DtPlan instance, configured with the plan manager's plan executor. | |
| virtual DtGlobalPlanExecutor * | createPlanExecutor () |
| virtual void | processCurrentStatementChanged (const DtPlan &plan) |
| Sends off a DtIfPlanCurStatement message indicating the current statement of this plan. | |
| void | deletePlans () |
| Removes all plans from the manager and deletes them. | |
Static Protected Member Functions | |
| static void | requestPlanListCallback (DtSimMessage *msg, void *usr) |
| Calls sendPlanList(). | |
| static void | requestPlanCallback (DtSimMessage *msg, void *usr) |
| Calls processRequestPlan(). | |
| static void | setPlanCallback (DtSimMessage *msg, void *usr) |
| Calls processSetPlan(). | |
| static void | deletePlanCallback (DtSimMessage *msg, void *usr) |
| Calls processDeletePlan(). | |
| static void | currentStatementChangedCallback (const DtPlan &plan, void *usrData) |
| Calls processCurrentStatementChanged(). | |
Protected Attributes | |
| DtSimManager * | mySimManager |
| DtPlanMap | myPlanMap |
| bool | myExecutionState |
| DtGlobalPlanExecutor * | myPlanExecutor |
Private Member Functions | |
| DtGlobalPlanManager () | |
| Not implemented. | |
| DtGlobalPlanManager (const DtGlobalPlanManager &orig) | |
| Not implemented. | |
| DtGlobalPlanManager & | operator= (const DtGlobalPlanManager &orig) |
| Not implemented. | |
The global plan manager maintains the list of "Global Plans." These are plans that are not specific to an entity, but are run stand-alone on a sim engine, possibly creating and deleting entities during execution.
typedef std::map<DtString, DtPlan*> DtGlobalPlanManager::DtPlanMap [protected] |
| DtGlobalPlanManager::DtGlobalPlanManager | ( | DtSimManager * | simManager | ) |
Basic constructor.
| virtual DtGlobalPlanManager::~DtGlobalPlanManager | ( | ) | [virtual] |
Destructor.
| DtGlobalPlanManager::DtGlobalPlanManager | ( | ) | [private] |
Not implemented.
| DtGlobalPlanManager::DtGlobalPlanManager | ( | const DtGlobalPlanManager & | orig | ) | [private] |
Not implemented.
| virtual bool DtGlobalPlanManager::init | ( | ) | [virtual] |
| virtual void DtGlobalPlanManager::tick | ( | ) | [virtual] |
| static void DtGlobalPlanManager::tickCallback | ( | void * | args | ) | [static] |
| virtual void DtGlobalPlanManager::enableExecutionState | ( | ) | [virtual] |
Sets the execution state of all plans in the manager.
Plans are only executed when the execution state is enabled.
| virtual void DtGlobalPlanManager::disableExecutionState | ( | ) | [virtual] |
Sets the execution state of all plans in the manager.
Plans are only executed when the execution state is enabled.
| virtual void DtGlobalPlanManager::clearPlans | ( | ) | [virtual] |
Removes all plans from this plan manager.
| virtual void DtGlobalPlanManager::writePlanFile | ( | const DtString & | filename | ) | const [virtual] |
Saves all the current plans to the global plan file to the specified name.
| virtual bool DtGlobalPlanManager::readPlanFile | ( | const DtString & | filename | ) | [virtual] |
Reads the global plan file to the specified name and replaces all current plans with plans from the file.
| virtual void DtGlobalPlanManager::registerInterfaceMessageCallbacks | ( | ) | [protected, virtual] |
Registers for any interface messages that the manager listens to.
| static void DtGlobalPlanManager::requestPlanListCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static, protected] |
Calls sendPlanList().
| virtual void DtGlobalPlanManager::sendPlanList | ( | ) | [protected, virtual] |
Sends a DtIfGlobalPlanList with the current plan names.
| static void DtGlobalPlanManager::requestPlanCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static, protected] |
Calls processRequestPlan().
| virtual void DtGlobalPlanManager::processRequestPlan | ( | DtSimMessage * | msg | ) | [protected, virtual] |
Sends a DtIfPlan message for the requested plan if it exists on this sim engine.
Also adds a statement changed callback to the plan so that current statement messages will be sent out whenever the current statement changes for this plan.
| static void DtGlobalPlanManager::setPlanCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static, protected] |
Calls processSetPlan().
| virtual void DtGlobalPlanManager::processSetPlan | ( | DtSimMessage * | msg | ) | [protected, virtual] |
If this message is applicable to this sim engine, and contains a global plan, this plan is added to the system.
Any plan currently in the system with the same name will be replaced.
| virtual void DtGlobalPlanManager::setPlan | ( | const DtString & | name, |
| const DtList & | statementList | ||
| ) | [protected, virtual] |
Creates a new plan in the plan manager with the specified name, and with the specified statements passed in the statement list.
Any already existing plan with the same name will be replaced.
| statementList | A list of DtSimStatement objects. |
| virtual void DtGlobalPlanManager::appendToPlan | ( | const DtString & | name, |
| const DtList & | statementList | ||
| ) | [protected, virtual] |
Appends the specified statements to the plan of the specified name.
If no plan exists, a new one is created with the statements.
| statementList | A list of DtSimStatement objects. |
| static void DtGlobalPlanManager::deletePlanCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static, protected] |
Calls processDeletePlan().
| virtual void DtGlobalPlanManager::processDeletePlan | ( | DtSimMessage * | msg | ) | [protected, virtual] |
Looks up and removes any global plan that exists with the name specified in the delete plan message (DtIfDeletePlan).
| virtual DtPlan* DtGlobalPlanManager::makePlan | ( | const DtString & | name | ) | const [protected, virtual] |
Creates and returns a new DtPlan instance, configured with the plan manager's plan executor.
| virtual DtGlobalPlanExecutor* DtGlobalPlanManager::createPlanExecutor | ( | ) | [protected, virtual] |
| static void DtGlobalPlanManager::currentStatementChangedCallback | ( | const DtPlan & | plan, |
| void * | usrData | ||
| ) | [static, protected] |
| virtual void DtGlobalPlanManager::processCurrentStatementChanged | ( | const DtPlan & | plan | ) | [protected, virtual] |
Sends off a DtIfPlanCurStatement message indicating the current statement of this plan.
| void DtGlobalPlanManager::deletePlans | ( | ) | [protected] |
Removes all plans from the manager and deletes them.
Non-virtual since it is called from the destructor.
| DtGlobalPlanManager& DtGlobalPlanManager::operator= | ( | const DtGlobalPlanManager & | orig | ) | [private] |
Not implemented.
DtSimManager* DtGlobalPlanManager::mySimManager [protected] |
DtPlanMap DtGlobalPlanManager::myPlanMap [protected] |
bool DtGlobalPlanManager::myExecutionState [protected] |
DtGlobalPlanExecutor* DtGlobalPlanManager::myPlanExecutor [protected] |