VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtWhenStmt Class Reference

8 bytes total More...

Inheritance diagram for DtWhenStmt:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtWhenStmt (DtReaderWriterRegistry *parentRegistry=NULL)
 default constructor
 DtWhenStmt (const DtWhenStmt &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 copy constructor
virtual ~DtWhenStmt ()
 destructor
DtWhenStmtoperator= (const DtWhenStmt &orig)
 assignment operator
virtual DtSimStatementclone (DtReaderWriterRegistry *parentRegistry=NULL) const
 virtual copy constructor
virtual int type () const
 Returns DtWhenStatementType (defined in simStmtTypes.h)
virtual void execute (DtPlan &planContext)
 Execute the current statement and make any changes to the Plan state as appropriate.
virtual int subBlockCount () const
 Get the number of blocks nested inside this statement.
virtual DtSimBlocksubBlock (int index)
 Get the a pointer to each particular block nested inside this statement.
virtual DtString stringRep (int subBlockIndex=DtSR_STMT) const
 Get a readable string representation of this When statement.
virtual void exitFromTrigger (DtPlan &planContext)
 The exitFromTrigger function is called when the trigger "When" block is complete, handles popping the plan's trigger stack if the "ReTask" option is given.
virtual const DtStringtriggerName () const
virtual void setTriggerName (const DtString &arg)
virtual const DtSimCondExprcondExpr () const
virtual void setCondExpr (DtSimCondExpr *arg)
virtual const DtStringoption () const
 Get the option value, if any (ie.
virtual void setOption (const DtString &arg)
 Set the option value (eg. "ReTask" or "").
virtual DtWhenBlockwhenBlock () const
virtual void setWhenBlock (DtWhenBlock *arg)
virtual int netRepSize () const
 Returns the size of the full network representation padded to an 8-byte boundary.
virtual bool setFromNet (const char *contentBuffer, unsigned contentSize)
 Fills in the request from the network buffer.
virtual bool setToNet ()
 Fills in the network buffer (created by base class sim statement) with the set data request contents.

Static Public Member Functions

static DtSimStatementcreator (DtReaderWriterRegistry *parentRegistry=NULL)

Protected Member Functions

virtual bool compare (DtSimStatement *)
 Called from isSameStatement.

Protected Attributes

DtRwString myTriggerName
DtRwCondExpr myCondExpr
DtRwString myOption
DtWhenBlockmyBlock

Detailed Description

8 bytes total

class DtWhenStmt:

Instances of DtWhenStmt represent a trigger ("When" statement). They contain one conditional expression and one sub-block which will be executed once if and when the condition evaluates to True. Executing the "When" statement itself only registers the trigger for continuous checking, the sub-block is not executed until/unless the trigger files.


Constructor & Destructor Documentation

DtWhenStmt::DtWhenStmt ( DtReaderWriterRegistry parentRegistry = NULL)

default constructor

DtWhenStmt::DtWhenStmt ( const DtWhenStmt orig,
DtReaderWriterRegistry parentRegistry = NULL 
)

copy constructor

virtual DtWhenStmt::~DtWhenStmt ( ) [virtual]

destructor


Member Function Documentation

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

assignment operator

virtual DtSimStatement* DtWhenStmt::clone ( DtReaderWriterRegistry parentRegistry = NULL) const [virtual]

virtual copy constructor

Implements DtSimStatement.

virtual int DtWhenStmt::type ( ) const [virtual]

Returns DtWhenStatementType (defined in simStmtTypes.h)

Implements DtSimStatement.

virtual void DtWhenStmt::execute ( DtPlan planContext) [virtual]

Execute the current statement and make any changes to the Plan state as appropriate.

Implements DtSimStatement.

virtual int DtWhenStmt::subBlockCount ( ) const [virtual]

Get the number of blocks nested inside this statement.

Reimplemented from DtSimStatement.

virtual DtSimBlock* DtWhenStmt::subBlock ( int  index) [virtual]

Get the a pointer to each particular block nested inside this statement.

Reimplemented from DtSimStatement.

virtual DtString DtWhenStmt::stringRep ( int  subBlockIndex = DtSR_STMT) const [virtual]

Get a readable string representation of this When statement.

The subBlockIndex argument indicates which stringRep to get as a prefix for a given sub-block. For a When statement, the first (0) sub-block's prefix is the "when (...) do" part, and if a subBlockIndex value of DtSimStatement::DtSR_STMT is given, the "endwhen" part is returned.

See the documentation for DtSimStatement::stringRep for more information.

Implements DtSimStatement.

virtual void DtWhenStmt::exitFromTrigger ( DtPlan planContext) [virtual]

The exitFromTrigger function is called when the trigger "When" block is complete, handles popping the plan's trigger stack if the "ReTask" option is given.

virtual const DtString& DtWhenStmt::triggerName ( ) const [virtual]
virtual void DtWhenStmt::setTriggerName ( const DtString arg) [virtual]
virtual const DtSimCondExpr* DtWhenStmt::condExpr ( ) const [virtual]
virtual void DtWhenStmt::setCondExpr ( DtSimCondExpr arg) [virtual]
virtual const DtString& DtWhenStmt::option ( ) const [virtual]

Get the option value, if any (ie.

"ReTask" or ""). The option string is used to modify the behavior of the trigger. The VR-Forces front-end always uses an option string of “ReTask”. If it is unspecified (or “Replace”), the trigger considers the end of the trigger block to be the end of the plan.

virtual void DtWhenStmt::setOption ( const DtString arg) [virtual]

Set the option value (eg. "ReTask" or "").

virtual DtWhenBlock* DtWhenStmt::whenBlock ( ) const [virtual]
virtual void DtWhenStmt::setWhenBlock ( DtWhenBlock arg) [virtual]
virtual int DtWhenStmt::netRepSize ( ) const [virtual]

Returns the size of the full network representation padded to an 8-byte boundary.

Size is computed from the following:

sizeof(DtNetSimStatement) + sizeof(DtNetWhenStatement) + myTask->netRepSize()

Reimplemented from DtSimStatement.

virtual bool DtWhenStmt::setFromNet ( const char *  contentBuffer,
unsigned  contentSize 
) [virtual]

Fills in the request from the network buffer.

Reimplemented from DtSimStatement.

virtual bool DtWhenStmt::setToNet ( ) [virtual]

Fills in the network buffer (created by base class sim statement) with the set data request contents.

Network buffer is filled in as follows:

DtNetSimStatement DtNetWhenStatment <statement data 1> . . . <statement data="" n>="">

n is the number of top-level statements in the when block, and statement data is the net representation of a DtSimStatement.

Reimplemented from DtSimStatement.

static DtSimStatement* DtWhenStmt::creator ( DtReaderWriterRegistry parentRegistry = NULL) [static]
virtual bool DtWhenStmt::compare ( DtSimStatement ) [protected, virtual]

Called from isSameStatement.

Compares net reps to see if they are the same. Override to do different comparrison

Reimplemented from DtSimStatement.


Member Data Documentation


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)