VR-Forces 4.10 Class Documentation
 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: More...

Public Member Functions

 DtVrfObjectPlanManager (DtVrfObject *vrfObject)
 constructor More...
 
virtual ~DtVrfObjectPlanManager ()
 destructor More...
 
virtual bool init ()
 Calls createPlanExecutor() to initialize myPlanExecutor. More...
 
virtual void tick ()
 If myPlanQueuedForAbandonment the plan is abandoned, otherwise the plan is ticked. More...
 
virtual DtPlanExecutorcreatePlanExecutor ()
 Returns a newly created DtVrfSimPlanExecutor. More...
 
virtual DtPlancreateAndInitPlan ()
 Returns a newly created DtPlan Creates and initializes a new, empty DtPlan object and then initializes it. More...
 
virtual DtPlanplan ()
 
virtual DtPlangetOrCreatePlan ()
 If there is no plan creates and returns. Different than plan() in that plan() does not create a plan if it is missing. More...
 
virtual void setPlan (DtPlan *plan)
 Sets myPlan. More...
 
virtual bool sendPlan ()
 Sends the plan using a DtIfPlan message. More...
 
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. More...
 
virtual void setTaskIssuedFromPlan (bool taskIssuedFromPlan)
 Sets myTaskIssuedFromPlan. More...
 
virtual void taskExecuted (const DtTaskMessage &msg, bool abandonPlan=true)
 Called by DtSimTaskManager::executeTask when a task is executed. More...
 
virtual void processSetPlan (DtSimMessage *msg)
 Creates a new plan or appends an existing one in response to a DtIfPlan message. More...
 
virtual void processSetPlan (DtIfPlan *msgData)
 
virtual void prepareForReinitialization ()
 Prepares for reinitialization by restarting plan (without giving a wait task or making independently tasked) More...
 
virtual void processRequestPlan (const DtSimMessage *msg)
 Responds to DtIfRequestPlan messages by calling sendPlan(). More...
 
virtual void processAbandonPlan (DtSimMessage *msg)
 Responds to DtIfAbandonPlan messages by calling abandonPlan on myPlan. More...
 
virtual void processRestartPlan (DtSimMessage *msg)
 Responds to DtIfRestartPlan messages by calling restartPlan on myPlan. More...
 
virtual void restartPlan ()
 Restarts the plan. More...
 
virtual void processCurrentStatementChanged (const DtPlan &plan)
 Processes the current statement change by sending a DtIfPlanCurStatement message. More...
 
virtual bool hasPlan () const
 Returns true if there is a plan associated with this plan manger. More...
 
virtual bool isGlobalPlan () const
 Returns true if the plan represents a global plan. More...
 
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. More...
 
virtual void notifySkipTask ()
 Call this to indicate that a task has been skipped. More...
 

Static Public Member Functions

static
DtVrfObjectPlanManagerFactory
factory ()
 
static void setFactory (DtVrfObjectPlanManagerFactory *factory)
 Sets theFactory. More...
 
static void currentStatementChangedCallback (const DtPlan &plan, void *usrData)
 Callback registered with plans for notification when the current statement changes. More...
 
static DtVrfObjectPlanManagercreator (DtVrfObject *vrfObject)
 Returns a new DtVrfObjectPlanManager. More...
 
static DtVrfObjectPlanManagercreateVrfObjectPlanManager (const DtString &type, DtVrfObject *vrfObject)
 Creates the given type of DtVrfObjectPlanManager using the DtVrfObjectPlanManagerFactory. More...
 

Protected Member Functions

 DtVrfObjectPlanManager ()
 default constructor; not implemented More...
 
 DtVrfObjectPlanManager (const DtVrfObjectPlanManager &orig)
 copy constructor; not implemented More...
 
DtVrfObjectPlanManageroperator= (const DtVrfObjectPlanManager &orig)
 assignment operator; not implemented More...
 

Protected Attributes

DtPlanmyPlan
 
DtPlanExecutormyPlanExecutor
 
DtVrfObjectmyVrfObject
 
bool myTaskIssuedFromPlan
 
bool myPlanQueuedForAbandonment
 
bool myIsRegisteredForCallback
 

Static Protected Attributes

static
DtVrfObjectPlanManagerFactory
theFactory
 This factory is allocated and destroyed by the DtVrfCreator. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

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

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

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

assignment operator; not implemented

Member Data Documentation

DtPlan* DtVrfObjectPlanManager::myPlan
protected
DtPlanExecutor* DtVrfObjectPlanManager::myPlanExecutor
protected
DtVrfObject* 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.


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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)