VR-Forces 4.1 Class Documentation
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtPlan Class Reference

class DtPlan: More...

Inheritance diagram for DtPlan:
Inheritance graph
[legend]

Public Member Functions

 DtPlan ()
 constructor for use from within a front-end application, or when creating a plan to be assigned through DtCgf's assignPlan() function.
 DtPlan (const DtString &planName, DtPlanExecutor *planExecutor, const DtString &name="Plan", DtReaderWriterRegistry *parentRegistry=NULL)
 constructor for use from within a back-end application
 DtPlan (const DtString &name, const DtString &planName, const DtPlan &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 copy constructor
virtual ~DtPlan ()
 destructor
virtual void init ()
 The init function must be called after any non-copy constructor!
virtual DtPlanclone (const DtString &name, const DtString &planName, DtReaderWriterRegistry *parentRegistry=NULL) const
 Returns a newly created copy of ourself.
DtPlanoperator= (const DtPlan &orig)
 Note: this will NOT copy the DtSimPlanManager pointer, and will only copy the planName if *this is not currently registered with a DtSimPlanManager (because either the DtSimPlanManager pointer is NULL or the current planName is empty).
virtual bool operator== (const DtPlan &orig) const
 Equality operator.
virtual DtString planName () const
virtual void setPlanName (const DtString &name)
virtual const DtStringobjectName () const
 Get/set the object name of entity associated with this plan.
virtual void setObjectName (const DtString &objectName)
virtual bool objectNameSpecified () const
 true if the object name was specified in the RW structure.
virtual void setPlanExecutor (DtPlanExecutor *planExecutor)
 Get a pointer to the sim manager.
virtual DtPlanExecutorplanExecutor () const
virtual void enableExecutionState ()
 Enable/disable plan execution state.
virtual void disableExecutionState ()
virtual bool executionState () const
virtual void awaitingTask ()
 Sets our awaiting task flag (it will be handled in processAwaitingTask(), called from tick if/when plan execution state is enabled.
virtual bool isAwatingTask () const
virtual void pushExecutionStack ()
 When a retasking trigger fires, it first calls pushExecutionStack on the DtPlan.
virtual void popExecutionStack (bool forceStep=false)
 When a retasking trigger completes, it calls popExecutionStack on the DtPlan.
virtual void executeTrigger (DtWhenBlock *whenBlock)
 When a DtSimTrigger gets executed, it calls the executeTrigger function which begins execution of the whenBlock.
virtual void executeBlock (DtSimBlock *block)
 Begin execution of a block of tasks.
virtual bool taskRequestPending () const
 Get the TaskRequestPending flag.
virtual void setTaskRequestPending (bool newValue=true)
 Set or clear the TaskRequestPending flag.
virtual bool executeTask (const DtSimTask &taskToSend) const
 Uses the plan executor to execute the specified task in the context of this plan.
virtual bool executeSetDataRequest (const DtSetDataRequest &setToSend) const
 Uses the plan executor to execute the specified set data request in the context of this plan.
virtual bool executeSimCommand (const DtSimCommand &command) const
 Uses the plan executor to execute the specified simulation command in the context of this plan.
virtual bool evaluateConditional (const DtSimCondExpr *condExpr) const
 Uses myPlanExecutor to evaluate the conditional expression.
virtual DtStmtIndex firstStmt () const
 Get the index of the first statement in the plan.
virtual DtPlanBlockmainBlock () const
 Get a pointer to the Plan's main Block.
virtual bool isEmpty () const
 True if the Plan is considered "Empty" (containing no statements).
virtual DtList * triggerList ()
 Get a pointer to the list of pending triggers.
virtual const DtList * triggerList () const
virtual void addTrigger (DtSimTrigger *trigger)
 Add a trigger to the pending trigger list.
virtual void removeTrigger (DtSimTrigger *trigger)
 Remove a trigger from the pending trigger list.
virtual DtList * executionStack ()
 Get a pointer to the execution stack.
virtual const DtList * executionStack () const
virtual bool validatePlan ()
 Checks, and potentially fixes, the plan.
virtual const DtStmtIndexcurrentStmt () const
 Get the index of the Plan's "current" statement.
virtual void setCurrentStmt (const DtStmtIndex &nextStatement)
 Set the Plan's "current" statement.
virtual void setCurrentStatementExecutionId (int id)
 Sets the current task execution ID to the value specified.
virtual bool isComplete () const
 True if the Plan is considered "Complete" and no longer active.
virtual void setIsComplete (bool completeFlag=true)
 Set the Plan's completion flag, if true, further execution of the Plan is disabled.
virtual bool isAbandoned () const
virtual void setIsAbandoned (bool v)
 Sets whether or not the plan is abandoned.
virtual bool isExecuting () const
virtual DtPlanStatus currentStatus () const
virtual void reset ()
 Clear all registered triggers and reset the Plan to its initial state.
virtual void abandonPlan (bool sendWaitTask)
 Reset the plan, but then set isComplete and set the current statement to the last one in the Main Block.
virtual void restartPlan (bool sendWaitTask=true)
 Reset sthe plan.
virtual bool translateIndex (DtStmtIndex &stmtIndex) const
 If you have a DtStmtIndex object that used to point into the original DtPlan before it was copied/cloned into this one, use the translateIndex function to convert it to point into this DtPlan.
virtual void translateIndices (DtList &stmtIndexList) const
 If you have a list of DtStmtIndex objects that used to point into the original DtPlan before it was copied/cloned into this one, use the translateIndicies function to convert them to point into this DtPlan.
virtual void tick ()
 The Plan tick function. Presently this ticks all the Plan's triggers.
virtual void mergeEditedPlanWith (const DtPlan &oldPlan)
 This plan is an edited version of an old one, copy and/or translate over any information that we want to preserve when we replace the old plan with this one (e.g.
virtual
DtRecursiveSimBlockIterator
spawnRecursiveIterator () const
 Spawns an iterator that iterates over the statements in the plan.
virtual void putSelf (FILE *fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtReaderWriter::appPath())
 This is the top-level reader-writer member function for saving self to file.
virtual void getSelf (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings)
 This is the top-level reader-writer member function for reading in self from file.
virtual void addStatementChangedCallback (DtCurrentStatementChangedCallbackFcn fcn, void *usrData)
 Adds a callback which is called whenever the current statement changes or whenever the status of the plan changes.
virtual void removeStatementChangedCallback (DtCurrentStatementChangedCallbackFcn fcn, void *usrData)
 Removes a statement changed callback.
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 default constructor
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 real constructor Setting the readonly flag prevents object from writing itself to the stream.
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 copy constructor
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 assignment operator
virtual ~DtReaderWriter ()
 destructor
virtual void writeSelf (FILE *fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 Called from putSelf, calls myRegistry.putSelf which in turn calls putSelf on each reader/writer in the registry.
virtual DtSymbolString name () const
 Accessor for name of this readable/writable object.
virtual void addAlias (const DtSymbolString &alias)
 Add an alias as an alternative name for this object.
virtual bool hasAlias (const DtSymbolString &alias)
virtual const aliasContaineraliases () const
virtual void setReadonly (bool flag)
 Set read-only flag.
virtual bool isReadonly () const
virtual bool variableIsBound () const
virtual void unbindVariable ()
 Sets the myVariableIsBound flag to false.
virtual void setName (const DtString &)
 Set the name of the object.
virtual const char * readerWriterType () const
 Used to supply a string type that this reader writer type is.
virtual DtString prettyPrint () const
 Routine to return a human readable form of the reader/writer variable.
virtual void bindVariables (DtVariableBindingsList variableBindings)
 Runs a variable binding pass on this reader writer and any of its children.
virtual std::list
< DtVariableNameType
unboundVariables () const
bool invalid () const
virtual bool hasChild (const DtReaderWriter *p) const
 Returns true if this variable has a child p in it's chain.
virtual void setValueSpecified (bool specified, bool recurse=false)
 The specified flags are used for optional values.
virtual bool valueSpecified () const
 The specified flags are used for optional values.
virtual bool isVariableReference () const
 Specifies whether or not this reader writer is really a variable that is specified elsewhere.
virtual void setIsVariableReference (bool value)
virtual DtSymbolString variableName () const
 The variable name, if this object is a variable reference.
virtual void setVariableName (const DtSymbolString variableName)
 The variable name, if this object is a variable reference.
const DtReaderWriterRegistryregistry () const
 Collection of child DtReaderWriter nodes owned by this object.
DtReaderWriterRegistryregistry ()
 Collection of child DtReaderWriter nodes owned by this object.

Protected Member Functions

virtual void processAwaitingTask ()
 Awaiting task then (re)starts execution of plan.
virtual void createMainBlock ()
 Create the Main Block.
virtual void copyMainBlock (const DtPlan &otherPlan)
 Copy the main block (and all nested blocks) and the Execution Stack from another Plan, and translate any/all DtStmtIndex objects to point into the new main block structure.
virtual void copyAndTranslateExecutionStack (const DtPlan &otherPlan)
 Copy the other Plan's execution stack and translate all DtStmtIndex objects in the execution stack to point into the new main block.
virtual void copyAndTranslateTriggers (const DtPlan &otherPlan)
 Copy the other Plan's pending triggers and translate all DtStmtIndex objects in the triggers to point into the new main block.
virtual void curStmtChanged ()
 Whenever a change is made that changes the effective current statement, this function is called so that the front end can be told of the change.
virtual void continuePlan ()
 ContinuePlan will continue the Plan execution until either the task request pending flag is cleared, or the plan complete flag is set.
virtual void stepStatement ()
 StepStatement will step to the next statement in the Plan.
virtual void executeStatement ()
 ExecuteStatement will execute the current statement in the Plan.
virtual void clearTriggerList ()
 ClearTriggerList deletes the registered triggers and clears the pending trigger list.
virtual void clearExecutionStack ()
 ClearExecutionStack clears the execution stack and resets the Plan.
virtual void emtpyExecutionStack ()
 Removes and deletes all DtStmtIndex* entries from the execution stack.
virtual int statementIdToCursor (DtStmtIdType statementId)
 Maps statementId to cursor and vice-versa.
virtual DtStmtIdType cursorToStatementId (int cursor)
virtual DtSimStatementlookupStatementByCursor (int cursor)
 Look up statement at the given cursor location (an integer identifying the overall position of a statement in a plan.
virtual void mapExecutionStackToRwExecutionStack (DtRwPlanExecutionStack &rwExecutionStack)
 Called by putSelf().
virtual void mapPendingTriggersToPendingTriggerDataList ()
 Called by putSelf().
virtual void mapOldExecutionCursorStackToExecutionStack (const DtRwIntegerList &executionCursorStack)
 Called by getSelf().
virtual void mapRwExecutionStackToExecutionStack (const DtRwPlanExecutionStack &rwExecutionStack)
 Fills myExecutionStack with the data from rwExecutionStack.
virtual void mapPendingTriggerDataToPendingTriggers ()
 Called by getSelf().
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 Copies values from the specified DtReaderWriter.
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 Checks to see if this RW object is a variable reference that can be bound using the provided bindings.
virtual void putData (FILE *fp, int indentLevel=0)
 Deriving class overrides these to get/put class specific data.
virtual DtlObjPtr getData (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings)
 Deriving class overrides these to get/put class specific data.

Protected Attributes

DtRwBoolean myTaskRequestPending
 The TaskRequestPending flag is set to true when an Entity requests a new task, and is cleared when a new task is sent by the Plan engine.
DtPlanBlockmyMainBlock
 The main Block is the top-level Block of the plan and is the only Block that is considered to be "owned" by this DtPlan object.
DtList myExecutionStack
 The top of the execution stack is the Plan's current statement (fetched with currentStmt()).
DtRwBoolean myIsComplete
 myIsComplete Disables awaitingTask() and causes it to emit continuous Wait tasks.
DtRwBoolean myAbandoned
 True if this plan has been abandoned.
DtList myPendingTriggers
 A list of all registered DtSimTriggers.
DtCallbackList< const DtPlan & > myStatementChangedCbs
 A list of all the DtCurrentStatementChangedCallbackFcn callbacks.
DtRwTriggerDataList myPendingTriggerDataList
 Reader-writer members used to hold checkpoint information about the plan.
bool myExecutionIsEnabled
 Flag indication whether execution is enabled (can we start or advance through plan statements?).
bool myAwaitingTaskFlag
 Flag indicating we've received an awaiting task request.
DtRwString myPlanName
bool myContinuePlan
DtPlanExecutormyPlanExecutor
DtPlanStatus myLastSentStatus
 The status that was last sent out though the curretStatement callbacks.
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
DtReaderWriterRegistry myRegistry
bool myValueSpecified
bool myReadOnlyFlag
bool myIsVariableReference
DtSymbolString myVariableName
bool myVariableIsBound
aliasContainer myAliases
 Container for the aliases which represent alternative names for the object.
bool myInvalid
 Set to true if there is a problem reading this item.

Additional Inherited Members

- Public Types inherited from DtReaderWriter
typedef std::vector
< DtSymbolString
aliasContainer
typedef std::vector
< DtSymbolString >::iterator 
aliasIter
typedef std::vector
< DtSymbolString >
::const_iterator 
aliasConstIter
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
- Static Public Member Functions inherited from DtReaderWriter
static void putIndent (FILE *fp, int indentLevel)
static const
DtVariableBindingsList
nullVariableReference ()
static void setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData)
static void setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData)
static const DtFilename & appPath ()
 Gets the current working directory.
static DtReaderWriterFactoryfactory ()
- Static Protected Attributes inherited from DtReaderWriter
static DtString theUnspecifiedValue
static DtGetSelfCallbackInfo thePostGetSelfCallback
static DtPutSelfCallbackInfo thePrePutSelfCallback
static const DtVariableBindingsList theEmptyVariableBindingsList
static DtReaderWriterFactory theFactory

Detailed Description

class DtPlan:

Instances of DtPlan represent the Plan associated with a single name.

Examples

Constructor & Destructor Documentation

DtPlan::DtPlan ( )

constructor for use from within a front-end application, or when creating a plan to be assigned through DtCgf's assignPlan() function.

Note: the init function must be called after using this constructor.

DtPlan::DtPlan ( const DtString planName,
DtPlanExecutor planExecutor,
const DtString name = "Plan",
DtReaderWriterRegistry parentRegistry = NULL 
)

constructor for use from within a back-end application

Note: the init function must be called after using this constructor.

DtPlan::DtPlan ( const DtString name,
const DtString planName,
const DtPlan orig,
DtReaderWriterRegistry parentRegistry = NULL 
)

copy constructor

This is a copy constructor that can register as a Readable-Writable member.

virtual DtPlan::~DtPlan ( )
virtual

destructor

Member Function Documentation

virtual void DtPlan::init ( )
virtual

The init function must be called after any non-copy constructor!

virtual DtPlan* DtPlan::clone ( const DtString name,
const DtString planName,
DtReaderWriterRegistry parentRegistry = NULL 
) const
virtual

Returns a newly created copy of ourself.

name is the DtReaderWriter name of the plan.

DtPlan& DtPlan::operator= ( const DtPlan orig)

Note: this will NOT copy the DtSimPlanManager pointer, and will only copy the planName if *this is not currently registered with a DtSimPlanManager (because either the DtSimPlanManager pointer is NULL or the current planName is empty).

virtual bool DtPlan::operator== ( const DtPlan orig) const
virtual

Equality operator.

virtual DtString DtPlan::planName ( ) const
virtual
virtual void DtPlan::setPlanName ( const DtString name)
virtual
virtual const DtString& DtPlan::objectName ( ) const
virtual

Get/set the object name of entity associated with this plan.

virtual void DtPlan::setObjectName ( const DtString objectName)
virtual
virtual bool DtPlan::objectNameSpecified ( ) const
virtual

true if the object name was specified in the RW structure.

virtual void DtPlan::setPlanExecutor ( DtPlanExecutor planExecutor)
virtual

Get a pointer to the sim manager.

virtual DtPlanExecutor* DtPlan::planExecutor ( ) const
virtual
virtual void DtPlan::enableExecutionState ( )
virtual

Enable/disable plan execution state.

Plan will not start or advance through statements unless execution state is enabled.

virtual void DtPlan::disableExecutionState ( )
virtual
virtual bool DtPlan::executionState ( ) const
virtual
virtual void DtPlan::awaitingTask ( )
virtual

Sets our awaiting task flag (it will be handled in processAwaitingTask(), called from tick if/when plan execution state is enabled.

virtual bool DtPlan::isAwatingTask ( ) const
virtual
Returns
the current value of myAwaitingTaskFlag.
virtual void DtPlan::pushExecutionStack ( )
virtual

When a retasking trigger fires, it first calls pushExecutionStack on the DtPlan.

This has the effect of duplicating the currentStmt index at the top of the stack. It does not, of itself, cause any new statements to get executed or sent to the entity. It is assumed that this call will be followed by a call to executeTrigger(), or at least setCurrentStmt().

virtual void DtPlan::popExecutionStack ( bool  forceStep = false)
virtual

When a retasking trigger completes, it calls popExecutionStack on the DtPlan.

This has the effect of popping the execution stack back to the statement that was interrupted by the trigger. If the forceStep parameter is true, this will step to the statement following the one on the stack. If false, then the plan will check to see if the new top statement is still executing. If so, it will continue with that statement, otherwise it will step to the next statement.

virtual void DtPlan::executeTrigger ( DtWhenBlock whenBlock)
virtual

When a DtSimTrigger gets executed, it calls the executeTrigger function which begins execution of the whenBlock.

virtual void DtPlan::executeBlock ( DtSimBlock block)
virtual

Begin execution of a block of tasks.

virtual bool DtPlan::taskRequestPending ( ) const
virtual

Get the TaskRequestPending flag.

virtual void DtPlan::setTaskRequestPending ( bool  newValue = true)
virtual

Set or clear the TaskRequestPending flag.

virtual bool DtPlan::executeTask ( const DtSimTask taskToSend) const
virtual

Uses the plan executor to execute the specified task in the context of this plan.

Returns
True if successful.
virtual bool DtPlan::executeSetDataRequest ( const DtSetDataRequest setToSend) const
virtual

Uses the plan executor to execute the specified set data request in the context of this plan.

Returns
True if successful.
virtual bool DtPlan::executeSimCommand ( const DtSimCommand command) const
virtual

Uses the plan executor to execute the specified simulation command in the context of this plan.

Returns
True if successful.
virtual bool DtPlan::evaluateConditional ( const DtSimCondExpr condExpr) const
virtual

Uses myPlanExecutor to evaluate the conditional expression.

False is returned if there is not plan executor.

virtual DtStmtIndex DtPlan::firstStmt ( ) const
virtual

Get the index of the first statement in the plan.

virtual DtPlanBlock* DtPlan::mainBlock ( ) const
virtual

Get a pointer to the Plan's main Block.

virtual bool DtPlan::isEmpty ( ) const
virtual

True if the Plan is considered "Empty" (containing no statements).

virtual DtList* DtPlan::triggerList ( )
virtual

Get a pointer to the list of pending triggers.

virtual const DtList* DtPlan::triggerList ( ) const
virtual
virtual void DtPlan::addTrigger ( DtSimTrigger trigger)
virtual

Add a trigger to the pending trigger list.

virtual void DtPlan::removeTrigger ( DtSimTrigger trigger)
virtual

Remove a trigger from the pending trigger list.

virtual DtList* DtPlan::executionStack ( )
virtual

Get a pointer to the execution stack.

virtual const DtList* DtPlan::executionStack ( ) const
virtual
virtual bool DtPlan::validatePlan ( )
virtual

Checks, and potentially fixes, the plan.

Returns
True if the plan is valid.
virtual const DtStmtIndex& DtPlan::currentStmt ( ) const
virtual

Get the index of the Plan's "current" statement.

This is either zero (if the Plan has not yet begun to execute), or indicates the last statement executed.

virtual void DtPlan::setCurrentStmt ( const DtStmtIndex nextStatement)
virtual

Set the Plan's "current" statement.

virtual void DtPlan::setCurrentStatementExecutionId ( int  id)
virtual

Sets the current task execution ID to the value specified.

virtual bool DtPlan::isComplete ( ) const
virtual

True if the Plan is considered "Complete" and no longer active.

virtual void DtPlan::setIsComplete ( bool  completeFlag = true)
virtual

Set the Plan's completion flag, if true, further execution of the Plan is disabled.

virtual bool DtPlan::isAbandoned ( ) const
virtual
Returns
True if the plan has been abandoned.
Note
The plan will also return true of isComplete() if it has been abandoned.
virtual void DtPlan::setIsAbandoned ( bool  v)
virtual

Sets whether or not the plan is abandoned.

This should not normally be called from outside this class.

virtual bool DtPlan::isExecuting ( ) const
virtual
Returns
True if the plan is running.
virtual DtPlanStatus DtPlan::currentStatus ( ) const
virtual
Returns
A filled out DtPlanStatus entry with the current state of the plan.
virtual void DtPlan::reset ( )
virtual

Clear all registered triggers and reset the Plan to its initial state.

virtual void DtPlan::abandonPlan ( bool  sendWaitTask)
virtual

Reset the plan, but then set isComplete and set the current statement to the last one in the Main Block.

Parameters
sendWaitTaskindicates whether or not a wait task will be sent to the entity when its plan is abandoned. This will stop its current task, if true.
virtual void DtPlan::restartPlan ( bool  sendWaitTask = true)
virtual

Reset sthe plan.

Parameters
sendWaitTaskindicates whether or not a wait task will be sent to the entity when its plan is abandoned. This will stop its current task, if true.
virtual bool DtPlan::translateIndex ( DtStmtIndex stmtIndex) const
virtual

If you have a DtStmtIndex object that used to point into the original DtPlan before it was copied/cloned into this one, use the translateIndex function to convert it to point into this DtPlan.

Returns true if a match was found, false otherwise.

virtual void DtPlan::translateIndices ( DtList &  stmtIndexList) const
virtual

If you have a list of DtStmtIndex objects that used to point into the original DtPlan before it was copied/cloned into this one, use the translateIndicies function to convert them to point into this DtPlan.

virtual void DtPlan::tick ( )
virtual

The Plan tick function. Presently this ticks all the Plan's triggers.

virtual void DtPlan::mergeEditedPlanWith ( const DtPlan oldPlan)
virtual

This plan is an edited version of an old one, copy and/or translate over any information that we want to preserve when we replace the old plan with this one (e.g.

current statement subscriber).

virtual DtRecursiveSimBlockIterator* DtPlan::spawnRecursiveIterator ( ) const
virtual

Spawns an iterator that iterates over the statements in the plan.

The caller MUST DELETE the iterator when doen using it!

virtual void DtPlan::putSelf ( FILE *  fp,
int  indentLevel = 0,
bool  writeUnspecified = false,
const DtFilename &  path = DtReaderWriter::appPath() 
)
virtual

This is the top-level reader-writer member function for saving self to file.

Override to get a chance to set reader-writer member variables before saving.

Reimplemented from DtReaderWriter.

virtual void DtPlan::getSelf ( DtlObjPtr  args,
const DtFilename &  searchPath,
const DtVariableBindingsList variableBindings 
)
virtual

This is the top-level reader-writer member function for reading in self from file.

Override to get a chance to initialize plan from reader-writer members.

Reimplemented from DtReaderWriter.

virtual void DtPlan::addStatementChangedCallback ( DtCurrentStatementChangedCallbackFcn  fcn,
void *  usrData 
)
virtual

Adds a callback which is called whenever the current statement changes or whenever the status of the plan changes.

(abandoned, complete, executing)

virtual void DtPlan::removeStatementChangedCallback ( DtCurrentStatementChangedCallbackFcn  fcn,
void *  usrData 
)
virtual

Removes a statement changed callback.

virtual void DtPlan::processAwaitingTask ( )
protectedvirtual

Awaiting task then (re)starts execution of plan.

virtual void DtPlan::createMainBlock ( )
protectedvirtual

Create the Main Block.

This is only called by init(), and should only be called once.

virtual void DtPlan::copyMainBlock ( const DtPlan otherPlan)
protectedvirtual

Copy the main block (and all nested blocks) and the Execution Stack from another Plan, and translate any/all DtStmtIndex objects to point into the new main block structure.

virtual void DtPlan::copyAndTranslateExecutionStack ( const DtPlan otherPlan)
protectedvirtual

Copy the other Plan's execution stack and translate all DtStmtIndex objects in the execution stack to point into the new main block.

(Called by copyMainBlock.)

virtual void DtPlan::copyAndTranslateTriggers ( const DtPlan otherPlan)
protectedvirtual

Copy the other Plan's pending triggers and translate all DtStmtIndex objects in the triggers to point into the new main block.

(Called by copyMainBlock.)

virtual void DtPlan::curStmtChanged ( )
protectedvirtual

Whenever a change is made that changes the effective current statement, this function is called so that the front end can be told of the change.

virtual void DtPlan::continuePlan ( )
protectedvirtual

ContinuePlan will continue the Plan execution until either the task request pending flag is cleared, or the plan complete flag is set.

virtual void DtPlan::stepStatement ( )
protectedvirtual

StepStatement will step to the next statement in the Plan.

This is usually the first half of an execution cycle. Note: this assumes that !isComplete() and !myCurrentStmt.isNull().

virtual void DtPlan::executeStatement ( )
protectedvirtual

ExecuteStatement will execute the current statement in the Plan.

This is usually the second half of an execution cycle. Note: this assumes that !isComplete() and !myCurrentStmt.isNull().

virtual void DtPlan::clearTriggerList ( )
protectedvirtual

ClearTriggerList deletes the registered triggers and clears the pending trigger list.

virtual void DtPlan::clearExecutionStack ( )
protectedvirtual

ClearExecutionStack clears the execution stack and resets the Plan.

Adds a single NULL DtStmtIndex item to its list (indicating the start of the plan).

virtual void DtPlan::emtpyExecutionStack ( )
protectedvirtual

Removes and deletes all DtStmtIndex* entries from the execution stack.

virtual void DtPlan::mapExecutionStackToRwExecutionStack ( DtRwPlanExecutionStack rwExecutionStack)
protectedvirtual

Called by putSelf().

Fills the specified rwExecutionStack with the data from myExecutionStack.

virtual void DtPlan::mapPendingTriggersToPendingTriggerDataList ( )
protectedvirtual

Called by putSelf().

Fills the specified rwExecutionStack with the data from myExecutionStack.

virtual void DtPlan::mapOldExecutionCursorStackToExecutionStack ( const DtRwIntegerList executionCursorStack)
protectedvirtual

Called by getSelf().

Fills myExecutionStack with the data from the Pre VRF 3.12 style executionCursorStack.

virtual void DtPlan::mapRwExecutionStackToExecutionStack ( const DtRwPlanExecutionStack rwExecutionStack)
protectedvirtual

Fills myExecutionStack with the data from rwExecutionStack.

virtual void DtPlan::mapPendingTriggerDataToPendingTriggers ( )
protectedvirtual

Called by getSelf().

Fills myExecutionStack with the data from the Pre VRF 3.12 style executionCursorStack.

virtual int DtPlan::statementIdToCursor ( DtStmtIdType  statementId)
protectedvirtual

Maps statementId to cursor and vice-versa.

Cursor is the overall position of a statement in the plan.

virtual DtStmtIdType DtPlan::cursorToStatementId ( int  cursor)
protectedvirtual
virtual DtSimStatement* DtPlan::lookupStatementByCursor ( int  cursor)
protectedvirtual

Look up statement at the given cursor location (an integer identifying the overall position of a statement in a plan.

Member Data Documentation

DtRwBoolean DtPlan::myTaskRequestPending
protected

The TaskRequestPending flag is set to true when an Entity requests a new task, and is cleared when a new task is sent by the Plan engine.

There may be any number of non-task statements processed between these two events. Further processing of the entity's plan is paused when this flag is cleared.

DtPlanBlock* DtPlan::myMainBlock
protected

The main Block is the top-level Block of the plan and is the only Block that is considered to be "owned" by this DtPlan object.

DtList DtPlan::myExecutionStack
protected

The top of the execution stack is the Plan's current statement (fetched with currentStmt()).

Whenever a retasking trigger fires, it pushes this stack down so that the Plan can pick up where it left off at the end of the trigger.

DtRwBoolean DtPlan::myIsComplete
protected

myIsComplete Disables awaitingTask() and causes it to emit continuous Wait tasks.

DtRwBoolean DtPlan::myAbandoned
protected

True if this plan has been abandoned.

If the plan is abandoned, it will also show as "complete", since it is not running.

DtList DtPlan::myPendingTriggers
protected

A list of all registered DtSimTriggers.

DtCallbackList<const DtPlan&> DtPlan::myStatementChangedCbs
protected

A list of all the DtCurrentStatementChangedCallbackFcn callbacks.

DtRwTriggerDataList DtPlan::myPendingTriggerDataList
protected

Reader-writer members used to hold checkpoint information about the plan.

These variables only contain valid data just before writing to file, and just after reading from file. List of DtTriggerData items, representing the list of pending triggers.

bool DtPlan::myExecutionIsEnabled
protected

Flag indication whether execution is enabled (can we start or advance through plan statements?).

bool DtPlan::myAwaitingTaskFlag
protected

Flag indicating we've received an awaiting task request.

DtRwString DtPlan::myPlanName
protected
bool DtPlan::myContinuePlan
protected
DtPlanExecutor* DtPlan::myPlanExecutor
protected
DtPlanStatus DtPlan::myLastSentStatus
protected

The status that was last sent out though the curretStatement callbacks.


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

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)