VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtVrfObjectPlanManager Class Reference

class DtVrfObjectPlanManager:

The DtVrfObjectPlanManager handles the DtPlan for a DtLocalObject. It is ticked by the DtLocalObject 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.

See Also
Plan Manager
Related Examples

Public Member Functions

 DtVrfObjectPlanManager (DtLocalObject *vrfObject)
 
virtual ~DtVrfObjectPlanManager ()
 
virtual bool init ()
 
virtual void tick ()
 
virtual DtPlanExecutor * createPlanExecutor ()
 
virtual DtPlan * createAndInitPlan ()
 
virtual DtPlan * plan ()
 
virtual DtPlan * getOrCreatePlan ()
 
virtual DtPlan * nextFramePlan ()
 
virtual void setPlan (DtPlan *plan, bool abandonCurrentPlan=true)
 
virtual bool sendPlan ()
 
virtual bool sendPlanStatement (int statementId, const DtSimulationAddress &address) const
 
virtual void setTaskIssuedFromPlan (bool taskIssuedFromPlan)
 
virtual void taskExecuted (const DtTaskMessage &msg, bool abandonPlan=true)
 
virtual void processSetPlan (DtSimMessage *msg)
 
virtual void processSetPlan (DtIfPlan *msgData)
 
virtual void prepareForReinitialization ()
 
virtual void processRequestPlan (const DtSimMessage *msg)
 
virtual void processAbandonPlan (DtSimMessage *msg)
 
virtual void processRestartPlan (DtSimMessage *msg)
 
virtual void restartPlan ()
 
virtual void processCurrentStatementChanged (const DtPlan &plan)
 
virtual bool hasPlan () const
 
virtual bool isGlobalPlan () const
 
virtual bool executingPlan () const
 
virtual void notifyTaskCompletion (int taskId)
 
virtual void notifySkipTask ()
 
virtual bool taskAbandonsPlan (const DtTaskMessage &tskMsg) const
 

Static Public Member Functions

static
DtVrfObjectPlanManagerFactory * 
factory ()
 
static void setFactory (DtVrfObjectPlanManagerFactory *factory)
 
static void currentStatementChangedCallback (const DtPlan &plan, void *usrData)
 
static DtVrfObjectPlanManager * creator (DtLocalObject *vrfObject)
 
static DtVrfObjectPlanManager * createVrfObjectPlanManager (const DtString &type, DtLocalObject *vrfObject)
 

Protected Member Functions

 DtVrfObjectPlanManager ()
 
 DtVrfObjectPlanManager (const DtVrfObjectPlanManager &orig)
 
DtVrfObjectPlanManager & operator= (const DtVrfObjectPlanManager &orig)
 

Protected Attributes

DtPlan * myPlan
 
DtPlanExecutor * myPlanExecutor
 
DtLocalObject * myVrfObject
 
bool myTaskIssuedFromPlan
 
bool myPlanQueuedForAbandonment
 
bool myIsRegisteredForCallback
 
DtPlan * myPendingReplacementPlan = nullptr
 

Static Protected Attributes

static
DtVrfObjectPlanManagerFactory * 
theFactory
 

Constructor & Destructor Documentation

DtVrfObjectPlanManager::DtVrfObjectPlanManager ( DtLocalObject *  vrfObject)

constructor

virtual DtVrfObjectPlanManager::~DtVrfObjectPlanManager ( )
virtual

destructor

DtVrfObjectPlanManager::DtVrfObjectPlanManager ( )
protected

default constructor; not implemented

DtVrfObjectPlanManager::DtVrfObjectPlanManager ( const DtVrfObjectPlanManager &  orig)
protected

copy constructor; not implemented

Member Function Documentation

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

Returns a newly created DtPlan Creates and initializes a new, empty DtPlan object and then initializes it. The caller is responsible for ownership of the pointer. Overriding this function allows an alternate subclass of DtPlan to be created.

virtual DtPlan* DtVrfObjectPlanManager::plan ( )
virtual
Returns
myPlan
virtual DtPlan* DtVrfObjectPlanManager::getOrCreatePlan ( )
virtual

If there is no plan creates and returns. Different than plan() in that plan() does not create a plan if it is missing.

virtual DtPlan* DtVrfObjectPlanManager::nextFramePlan ( )
virtual

If there is a plan queued for replacement, returns that plan, else returns the current plan.

virtual void DtVrfObjectPlanManager::setPlan ( DtPlan *  plan,
bool  abandonCurrentPlan = true 
)
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.

If there is a current plan, abandon it immediate, else, let the current plans current task continue to execute until the new plan executes a task

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::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
Returns
theFactory
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::prepareForReinitialization ( )
virtual

Prepares for reinitialization by restarting plan (without giving a wait task or making independently tasked)

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. Called by DtVrfObjectPlanAdministrator::processAbandonPlan.

virtual void DtVrfObjectPlanManager::processRestartPlan ( DtSimMessage *  msg)
virtual

Responds to DtIfRestartPlan messages by calling restartPlan on myPlan. Called by DtVrfObjectPlanAdministrator::processRestartPlan.

virtual void DtVrfObjectPlanManager::restartPlan ( )
virtual

Restarts the plan.

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 ( DtLocalObject *  vrfObject)
static

Returns a new DtVrfObjectPlanManager. The caller is responsible for ownership of the pointer.

static DtVrfObjectPlanManager* DtVrfObjectPlanManager::createVrfObjectPlanManager ( const DtString &  type,
DtLocalObject *  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::isGlobalPlan ( ) const
virtual

Returns true if the plan represents a global plan.

virtual bool DtVrfObjectPlanManager::executingPlan ( ) const
virtual
Returns
True if there is currently a plan that is being executed.
virtual void DtVrfObjectPlanManager::notifyTaskCompletion ( int  taskId)
virtual

Call this to indicate that a task has been completed, and specify the task execution ID.

virtual void DtVrfObjectPlanManager::notifySkipTask ( )
virtual

Call this to indicate that a task has been skipped.

virtual bool DtVrfObjectPlanManager::taskAbandonsPlan ( const DtTaskMessage &  tskMsg) const
virtual

Returns false if this task execution can let the plan continue to run. A task will not abandon a plan if:

  1. It is in the task rules as a non-plan-interruptable-tasks
  2. It is a scripted task that can be executed concurrently and is not part of any task group
DtVrfObjectPlanManager& DtVrfObjectPlanManager::operator= ( const DtVrfObjectPlanManager &  orig)
protected

assignment operator; not implemented

Member Data Documentation

DtPlan* DtVrfObjectPlanManager::myPlan
protected
DtPlanExecutor* DtVrfObjectPlanManager::myPlanExecutor
protected
DtLocalObject* DtVrfObjectPlanManager::myVrfObject
protected
bool DtVrfObjectPlanManager::myTaskIssuedFromPlan
protected
bool DtVrfObjectPlanManager::myPlanQueuedForAbandonment
protected
bool DtVrfObjectPlanManager::myIsRegisteredForCallback
protected
DtVrfObjectPlanManagerFactory* DtVrfObjectPlanManager::theFactory
staticprotected

This factory is allocated and destroyed by the DtVrfCreator.

DtPlan* DtVrfObjectPlanManager::myPendingReplacementPlan = nullptr
protected

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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)