VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
DtGlobalPlanManager Class Reference

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...

List of all members.

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 DtPlanmakePlan (const DtString &name) const
 Creates and returns a new DtPlan instance, configured with the plan manager's plan executor.
virtual DtGlobalPlanExecutorcreatePlanExecutor ()
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

DtSimManagermySimManager
DtPlanMap myPlanMap
bool myExecutionState
DtGlobalPlanExecutormyPlanExecutor

Private Member Functions

 DtGlobalPlanManager ()
 Not implemented.
 DtGlobalPlanManager (const DtGlobalPlanManager &orig)
 Not implemented.
DtGlobalPlanManageroperator= (const DtGlobalPlanManager &orig)
 Not implemented.

Detailed Description

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.


Member Typedef Documentation

typedef std::map<DtString, DtPlan*> DtGlobalPlanManager::DtPlanMap [protected]

Constructor & Destructor Documentation

Basic constructor.

Destructor.

Not implemented.

Not implemented.


Member Function Documentation

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]
virtual void DtGlobalPlanManager::sendPlanList ( ) [protected, virtual]

Sends a DtIfGlobalPlanList with the current plan names.

static void DtGlobalPlanManager::requestPlanCallback ( DtSimMessage msg,
void *  usr 
) [static, protected]
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]
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.

Parameters:
statementListA 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.

Parameters:
statementListA list of DtSimStatement objects.
static void DtGlobalPlanManager::deletePlanCallback ( DtSimMessage msg,
void *  usr 
) [static, protected]
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.

Returns:
A new instance of DtGlobalPlanExecutor.
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.


Member Data Documentation


The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)