![]() |
VR-Forces 4.0.4 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 DtVrfObjectPlanManager::~DtVrfObjectPlanManager | ( | ) | [virtual] |
destructor
| DtVrfObjectPlanManager::DtVrfObjectPlanManager | ( | ) | [protected] |
default constructor; not implemented
| DtVrfObjectPlanManager::DtVrfObjectPlanManager | ( | const DtVrfObjectPlanManager & | orig | ) | [protected] |
copy constructor; not implemented
| virtual bool DtVrfObjectPlanManager::init | ( | ) | [virtual] |
Calls createPlanExecutor() to initialize myPlanExecutor.
| virtual void DtVrfObjectPlanManager::tick | ( | ) | [virtual] |
If myPlanQueuedForAbandonment the plan is abandoned, otherwise the plan is ticked.
| virtual DtPlanExecutor* DtVrfObjectPlanManager::createPlanExecutor | ( | ) | [virtual] |
Returns a newly created DtVrfSimPlanExecutor.
The caller is responsible for ownership of the pointer.
| virtual DtPlan* DtVrfObjectPlanManager::createAndInitPlan | ( | ) | [virtual] |
| virtual DtPlan* DtVrfObjectPlanManager::plan | ( | ) | [virtual] |
| virtual void DtVrfObjectPlanManager::setPlan | ( | DtPlan * | plan | ) | [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 bool DtVrfObjectPlanManager::sendPlan | ( | ) | [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 bool DtVrfObjectPlanManager::sendPlanStatement | ( | int | statementId, |
| const DtSimulationAddress & | address | ||
| ) | const [virtual] |
Sends the statement corresponding to the given ID from the plan to the given recipient using a DtIfPlanStatement message.
| virtual void DtVrfObjectPlanManager::updatePlanNames | ( | ) | [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 void DtVrfObjectPlanManager::updatePlanNames | ( | DtSimBlock * | block | ) | [virtual] |
Updates the names for a block. May recurse into itself for subblocks.
| virtual void DtVrfObjectPlanManager::updatePlanNames | ( | DtSimCondExpr * | condExpr | ) | [virtual] |
Updates the names for a conditional expression.
May recurse into itself for sub expressions.
| virtual void DtVrfObjectPlanManager::setTaskIssuedFromPlan | ( | bool | taskIssuedFromPlan | ) | [virtual] |
Sets myTaskIssuedFromPlan.
| virtual void DtVrfObjectPlanManager::taskExecuted | ( | const DtTaskMessage & | msg, |
| bool | abandonPlan = true |
||
| ) | [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 DtVrfObjectPlanManagerFactory* DtVrfObjectPlanManager::factory | ( | ) | [static] |
| static void DtVrfObjectPlanManager::setFactory | ( | DtVrfObjectPlanManagerFactory * | factory | ) | [static] |
Sets theFactory.
| virtual void DtVrfObjectPlanManager::processSetPlan | ( | DtSimMessage * | msg | ) | [virtual] |
Creates a new plan or appends an existing one in response to a DtIfPlan message.
Called by DtVrfObjectPlanAdministrator::processSetPlan.
| virtual void DtVrfObjectPlanManager::processSetPlan | ( | DtIfPlan * | msgData | ) | [virtual] |
| virtual void DtVrfObjectPlanManager::processRequestPlan | ( | const DtSimMessage * | msg | ) | [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 void DtVrfObjectPlanManager::processAbandonPlan | ( | DtSimMessage * | msg | ) | [virtual] |
Responds to DtIfAbandonPlan messages by calling abandonPlan on myPlan.
| virtual void DtVrfObjectPlanManager::processRestartPlan | ( | DtSimMessage * | msg | ) | [virtual] |
Responds to DtIfRestartPlan messages by calling restartPlan on myPlan.
| static void DtVrfObjectPlanManager::currentStatementChangedCallback | ( | const DtPlan & | plan, |
| void * | usrData | ||
| ) | [static] |
Callback registered with plans for notification when the current statement changes.
| virtual void DtVrfObjectPlanManager::processCurrentStatementChanged | ( | const DtPlan & | plan | ) | [virtual] |
Processes the current statement change by sending a DtIfPlanCurStatement message.
| static DtVrfObjectPlanManager* DtVrfObjectPlanManager::creator | ( | DtVrfObject * | vrfObject | ) | [static] |
Returns a new DtVrfObjectPlanManager.
The caller is responsible for ownership of the pointer.
| static DtVrfObjectPlanManager* DtVrfObjectPlanManager::createVrfObjectPlanManager | ( | const DtString & | type, |
| DtVrfObject * | vrfObject | ||
| ) | [static] |
Creates the given type of DtVrfObjectPlanManager using the DtVrfObjectPlanManagerFactory.
Called by DtVrfObject::createVrfObjectPlanManager. The caller is responsible for ownership of the pointer.
| virtual bool DtVrfObjectPlanManager::hasPlan | ( | ) | const [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 bool DtVrfObjectPlanManager::executingPlan | ( | ) | const [virtual] |
| virtual void DtVrfObjectPlanManager::notifyTaskCompletion | ( | int | taskId | ) | [virtual] |
Call this to indicate that a task has been completed, and specify the task execution ID.
| DtVrfObjectPlanManager& DtVrfObjectPlanManager::operator= | ( | const DtVrfObjectPlanManager & | orig | ) | [protected] |
assignment operator; not implemented
DtPlan* DtVrfObjectPlanManager::myPlan [protected] |
DtPlanExecutor* DtVrfObjectPlanManager::myPlanExecutor [protected] |
DtVrfObject* DtVrfObjectPlanManager::myVrfObject [protected] |
bool DtVrfObjectPlanManager::myTaskIssuedFromPlan [protected] |
DtVrfObjectPlanManagerFactory* DtVrfObjectPlanManager::theFactory [static, protected] |
This factory is allocated and destroyed by the DtVrfCreator.