![]() |
VR-Forces 4.0.4 Class Documentation
|
8 bytes total More...

Public Member Functions | |
| DtIfStmt (DtReaderWriterRegistry *parentRegistry=NULL) | |
| default constructor DtIfStmt(); | |
| DtIfStmt (const DtIfStmt &orig, DtReaderWriterRegistry *parentRegistry=NULL) | |
| copy constructor | |
| virtual | ~DtIfStmt () |
| destructor | |
| DtIfStmt & | operator= (const DtIfStmt &orig) |
| assignment operator | |
| virtual DtSimStatement * | clone (DtReaderWriterRegistry *parentRegistry=NULL) const |
| virtual copy constructor | |
| virtual int | type () const |
| Returns DtIfStatementType (defined in simStmtTypes.h) | |
| virtual void | execute (DtPlan &planContext) |
| Execute the current statement and make any changes to the Plan state as appropriate. | |
| virtual void | step (DtPlan &planContext) |
| Steps to the next statement by setting the plan context’s current statement, based on the result of the test. | |
| virtual int | subBlockCount () const |
| Get the number of blocks nested inside this statement. | |
| virtual DtSimBlock * | subBlock (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 If statement. | |
| virtual void | exitFromIf (DtPlan &planContext) |
| The exitFromIf function is called when one of the the "If" blocks is complete, it just steps to the next statement after the If. | |
| virtual const DtSimCondExpr * | condExpr () const |
| Get/set the conditional expression. | |
| virtual void | setCondExpr (DtSimCondExpr *arg) |
| virtual DtIfBlock * | thenBlock () const |
| Get/set the then block. | |
| virtual void | setThenBlock (DtIfBlock *arg) |
| virtual DtIfBlock * | elseBlock () const |
| Get/set the else block. | |
| virtual void | setElseBlock (DtIfBlock *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 if statement contents. | |
Static Public Member Functions | |
| static DtSimStatement * | creator (DtReaderWriterRegistry *parentRegistry=NULL) |
Protected Member Functions | |
| virtual bool | compare (DtSimStatement *rhs) |
| Called from isSameStatement. | |
Protected Attributes | |
| DtRwCondExpr | myCondExpr |
| bool | myResult |
| myResult temporarily holds the results of an evaluation of myCondExpr between the "execute" call and the "step" call. | |
| DtIfBlock * | myThenBlock |
| DtIfBlock * | myElseBlock |
8 bytes total
class DtIfStmt:
Instances of DtIfStmt represent a conditional ("If" statement). Currently, they can only have one condition, and one or two sub-Blocks ("Then" and "Else"), but in the future they might be extended to support multiple "ElseIf" conditions and sub-blocks as well.
| DtIfStmt::DtIfStmt | ( | DtReaderWriterRegistry * | parentRegistry = NULL | ) |
default constructor DtIfStmt();
Usual constructor
| DtIfStmt::DtIfStmt | ( | const DtIfStmt & | orig, |
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
copy constructor
| virtual DtIfStmt::~DtIfStmt | ( | ) | [virtual] |
destructor
| virtual DtSimStatement* DtIfStmt::clone | ( | DtReaderWriterRegistry * | parentRegistry = NULL | ) | const [virtual] |
virtual copy constructor
Implements DtSimStatement.
| virtual int DtIfStmt::type | ( | ) | const [virtual] |
Returns DtIfStatementType (defined in simStmtTypes.h)
Implements DtSimStatement.
| virtual void DtIfStmt::execute | ( | DtPlan & | planContext | ) | [virtual] |
Execute the current statement and make any changes to the Plan state as appropriate.
Implements DtSimStatement.
| virtual void DtIfStmt::step | ( | DtPlan & | planContext | ) | [virtual] |
Steps to the next statement by setting the plan context’s current statement, based on the result of the test.
Reimplemented from DtSimStatement.
| virtual int DtIfStmt::subBlockCount | ( | ) | const [virtual] |
Get the number of blocks nested inside this statement.
Reimplemented from DtSimStatement.
| virtual DtSimBlock* DtIfStmt::subBlock | ( | int | index | ) | [virtual] |
Get the a pointer to each particular block nested inside this statement.
Reimplemented from DtSimStatement.
| virtual DtString DtIfStmt::stringRep | ( | int | subBlockIndex = DtSR_STMT | ) | const [virtual] |
Get a readable string representation of this If statement.
The subBlockIndex argument indicates which stringRep to get as a prefix for a given sub-block. For an If statement, the first (0) sub-block's prefix is the "if (...) then" part, if a second sub-block exists, its prefix is the "else" part, and if a subBlockIndex value of DtSimStatement::DtSR_STMT is given, the "endif" part is returned.
See the documentation for DtSimStatement::stringRep for more information.
Implements DtSimStatement.
| virtual void DtIfStmt::exitFromIf | ( | DtPlan & | planContext | ) | [virtual] |
The exitFromIf function is called when one of the the "If" blocks is complete, it just steps to the next statement after the If.
| virtual const DtSimCondExpr* DtIfStmt::condExpr | ( | ) | const [virtual] |
Get/set the conditional expression.
| virtual void DtIfStmt::setCondExpr | ( | DtSimCondExpr * | arg | ) | [virtual] |
| virtual DtIfBlock* DtIfStmt::thenBlock | ( | ) | const [virtual] |
Get/set the then block.
| virtual void DtIfStmt::setThenBlock | ( | DtIfBlock * | arg | ) | [virtual] |
| virtual DtIfBlock* DtIfStmt::elseBlock | ( | ) | const [virtual] |
Get/set the else block.
| virtual void DtIfStmt::setElseBlock | ( | DtIfBlock * | arg | ) | [virtual] |
| virtual int DtIfStmt::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(DtNetIfStatement) + <myThenBlock->firstStmt()->netRepSize()> . . . <myThenBlock->lastStmt()->netRepSize()> <myElseBlock->firstStmt()->netRepSize()> . . . <myElseBlock->lastStmt()->netRepSize()>
Reimplemented from DtSimStatement.
| virtual bool DtIfStmt::setFromNet | ( | const char * | contentBuffer, |
| unsigned | contentSize | ||
| ) | [virtual] |
Fills in the request from the network buffer.
Reimplemented from DtSimStatement.
| virtual bool DtIfStmt::setToNet | ( | ) | [virtual] |
Fills in the network buffer (created by base class sim statement) with the if statement contents.
Network buffer is filled in as follows:
DtNetSimStatement DtNetIfStatment <myThenBlock->firstStmt()->netRep()> . . . <myThenBlock->lastStmt()->netRep()> <myElseBlock->firstStmt()->netRep()> . . . <myElseBlock->lastStmt()->netRep()>
Reimplemented from DtSimStatement.
| static DtSimStatement* DtIfStmt::creator | ( | DtReaderWriterRegistry * | parentRegistry = NULL | ) | [static] |
| virtual bool DtIfStmt::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.
DtRwCondExpr DtIfStmt::myCondExpr [protected] |
bool DtIfStmt::myResult [protected] |
myResult temporarily holds the results of an evaluation of myCondExpr between the "execute" call and the "step" call.
DtIfBlock* DtIfStmt::myThenBlock [protected] |
DtIfBlock* DtIfStmt::myElseBlock [protected] |