![]() |
VR-Forces 4.1 Class Documentation
|
class DtVrfObjectPlanManager: More...
Public Member Functions | |
| DtVrfObjectPlanManager (DtVrfObject *vrfObject) | |
| constructor | |
| virtual | ~DtVrfObjectPlanManager () |
| destructor | |
| virtual bool | init () |
| Calls createPlanExecutor() to initialize myPlanExecutor. | |
| virtual void | tick () |
| If myPlanQueuedForAbandonment the plan is abandoned, otherwise the plan is ticked. | |
| virtual DtPlanExecutor * | createPlanExecutor () |
| Returns a newly created DtVrfSimPlanExecutor. | |
| virtual DtPlan * | createAndInitPlan () |
| Returns a newly created DtPlan Creates and initializes a new, empty DtPlan object and then initializes it. | |
| virtual DtPlan * | plan () |
| virtual void | setPlan (DtPlan *plan) |
| Sets myPlan. | |
| virtual bool | sendPlan () |
| Sends the plan using a DtIfPlan message. | |
| virtual bool | sendPlanStatement (int statementId, const DtSimulationAddress &address) const |
| Sends the statement corresponding to the given ID from the plan to the given recipient using a DtIfPlanStatement message. | |
| virtual void | updatePlanNames () |
| Walks through the current plan and replaces name references with the actual name of the object referenced in order to get rid of aliases. | |
| virtual void | updatePlanNames (DtSimBlock *block) |
| Updates the names for a block. May recurse into itself for subblocks. | |
| virtual void | updatePlanNames (DtSimCondExpr *condExpr) |
| Updates the names for a conditional expression. | |
| virtual void | setTaskIssuedFromPlan (bool taskIssuedFromPlan) |
| Sets myTaskIssuedFromPlan. | |
| virtual void | taskExecuted (const DtTaskMessage &msg, bool abandonPlan=true) |
| Called by DtSimTaskManager::executeTask when a task is executed. | |
| virtual void | processSetPlan (DtSimMessage *msg) |
| Creates a new plan or appends an existing one in response to a DtIfPlan message. | |
| virtual void | processSetPlan (DtIfPlan *msgData) |
| virtual void | processRequestPlan (const DtSimMessage *msg) |
| Responds to DtIfRequestPlan messages by calling sendPlan(). | |
| virtual void | processAbandonPlan (DtSimMessage *msg) |
| Responds to DtIfAbandonPlan messages by calling abandonPlan on myPlan. | |
| virtual void | processRestartPlan (DtSimMessage *msg) |
| Responds to DtIfRestartPlan messages by calling restartPlan on myPlan. | |
| virtual void | processCurrentStatementChanged (const DtPlan &plan) |
| Processes the current statement change by sending a DtIfPlanCurStatement message. | |
| virtual bool | hasPlan () const |
| Returns true if there is a plan associated with this plan manger. | |
| virtual bool | executingPlan () const |
| virtual void | notifyTaskCompletion (int taskId) |
| Call this to indicate that a task has been completed, and specify the task execution ID. | |
Static Public Member Functions | |
| static DtVrfObjectPlanManagerFactory * | factory () |
| static void | setFactory (DtVrfObjectPlanManagerFactory *factory) |
| Sets theFactory. | |
| static void | currentStatementChangedCallback (const DtPlan &plan, void *usrData) |
| Callback registered with plans for notification when the current statement changes. | |
| static DtVrfObjectPlanManager * | creator (DtVrfObject *vrfObject) |
| Returns a new DtVrfObjectPlanManager. | |
| static DtVrfObjectPlanManager * | createVrfObjectPlanManager (const DtString &type, DtVrfObject *vrfObject) |
| Creates the given type of DtVrfObjectPlanManager using the DtVrfObjectPlanManagerFactory. | |
Protected Member Functions | |
| DtVrfObjectPlanManager () | |
| default constructor; not implemented | |
| DtVrfObjectPlanManager (const DtVrfObjectPlanManager &orig) | |
| copy constructor; not implemented | |
| DtVrfObjectPlanManager & | operator= (const DtVrfObjectPlanManager &orig) |
| assignment operator; not implemented | |
Protected Attributes | |
| DtPlan * | myPlan |
| DtPlanExecutor * | myPlanExecutor |
| DtVrfObject * | myVrfObject |
| bool | myTaskIssuedFromPlan |
| bool | myPlanQueuedForAbandonment |
Static Protected Attributes | |
| static DtVrfObjectPlanManagerFactory * | theFactory |
| This factory is allocated and destroyed by the DtVrfCreator. | |
class DtVrfObjectPlanManager:
The DtVrfObjectPlanManager handles the DtPlan for a DtVrfObject. It is ticked by the DtVrfObject and forwards the tick on to the plan. It serves as the interface between a DtPlan and the DtPlanExecutor which will carry out its statements. It also responds to commands from the DtVrfRemoteController which get forwarded from the DtPlanAdministrator to set, monitor and abandon plans.
| DtVrfObjectPlanManager::DtVrfObjectPlanManager | ( | DtVrfObject * | vrfObject | ) |
constructor
|
virtual |
destructor
|
protected |
default constructor; not implemented
|
protected |
copy constructor; not implemented
|
virtual |
Calls createPlanExecutor() to initialize myPlanExecutor.
|
virtual |
If myPlanQueuedForAbandonment the plan is abandoned, otherwise the plan is ticked.
|
virtual |
Returns a newly created DtVrfSimPlanExecutor.
The caller is responsible for ownership of the pointer.
|
virtual |
|
virtual |
|
virtual |
Sets myPlan.
Deletes any existing plan. Sets the plan's executor to myPlanExecutor. Sets the plan's object name to the myVrfObject's name.
|
virtual |
Sends the plan using a DtIfPlan message.
Plans are sent to the broadcast address, DtSimSendToAll. If no plan exists yet, createAndInitPlan will be called to make one.
|
virtual |
Sends the statement corresponding to the given ID from the plan to the given recipient using a DtIfPlanStatement message.
|
virtual |
Walks through the current plan and replaces name references with the actual name of the object referenced in order to get rid of aliases.
This is used to bring v3.2 plan files up to date with 3.3, where names used to be the echelon id.
|
virtual |
Updates the names for a block. May recurse into itself for subblocks.
|
virtual |
Updates the names for a conditional expression.
May recurse into itself for sub expressions.
|
virtual |
Sets myTaskIssuedFromPlan.
|
virtual |
Called by DtSimTaskManager::executeTask when a task is executed.
If the task was issued by an aggregate (meaning the task does not have the independently tasked flag set) it is ignored. Subtasks are also ignored. For all other tasks if myTaskIssuedFromPlan is false and myPlan exists, myPlanQueuedForAbandonment is set to true to abandon the plan on the next tick. This happens when a task is issued from the GUI or from a global plan. Finally, myTaskIssuedFromPlan is reset to false.
If abandonPlan is true (the default) will abandon plan due to task executing. If abandonPlan is false, will not abandon plan, assuming that the task being issued is from a controller that knows to continue the plan after task executing is complete
|
static |
|
static |
Sets theFactory.
|
virtual |
Creates a new plan or appends an existing one in response to a DtIfPlan message.
Called by DtVrfObjectPlanAdministrator::processSetPlan.
|
virtual |
|
virtual |
Responds to DtIfRequestPlan messages by calling sendPlan().
Sends a DtIfPlanCurStatement to update the current statement and registers currentStatementChangedCallback to process future updates. Called by DtVrfObjectPlanAdministrator::processRequestPlan.
|
virtual |
Responds to DtIfAbandonPlan messages by calling abandonPlan on myPlan.
|
virtual |
Responds to DtIfRestartPlan messages by calling restartPlan on myPlan.
|
static |
Callback registered with plans for notification when the current statement changes.
|
virtual |
Processes the current statement change by sending a DtIfPlanCurStatement message.
|
static |
Returns a new DtVrfObjectPlanManager.
The caller is responsible for ownership of the pointer.
|
static |
Creates the given type of DtVrfObjectPlanManager using the DtVrfObjectPlanManagerFactory.
Called by DtVrfObject::createVrfObjectPlanManager. The caller is responsible for ownership of the pointer.
|
virtual |
Returns true if there is a plan associated with this plan manger.
A plan being defined as a non-null myPlan pointer that as plan statements within it (i.e. not an empty plan)
|
virtual |
|
virtual |
Call this to indicate that a task has been completed, and specify the task execution ID.
|
protected |
assignment operator; not implemented
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
This factory is allocated and destroyed by the DtVrfCreator.