![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /********************************************************************* 00002 ** Copyright (c) 1999 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: ifStmt.h,v $ $Revision: 1.18 $ $State: Exp $ 00007 *********************************************************************/ 00008 00011 00012 #ifndef DtIfStmt_H_ 00013 #define DtIfStmt_H_ 00014 00015 class DtIfStmt; 00016 00017 #include "vrfutil/condExpr.h" 00018 #include "vrfplan/rwCondExpr.h" 00019 #include "vrfplan/simStmt.h" 00020 #include <vlutil/vlNetTypes.h> 00021 00022 const char DtIfStmtTypeName[] = "If"; 00023 00024 class DtRwCondExpr; 00025 class DtIfBlock; 00026 00027 00028 00031 struct DtNetIfStatement 00032 { 00033 DtNetU16 myCondExprSize; 00034 DtNetU8 myCondExprType; 00035 DtNetU8 myThenBlockStatementCount; 00036 DtNetU8 myElseBlockStatementCount; 00037 DtNetU8 myPadding1; 00038 DtNetU16 myPadding2; 00039 }; 00040 00049 #include "vrfplan/vrfplanDefines.h" 00050 class DT_DLL_vrfplan DtIfStmt : public DtSimStatement 00051 { 00052 public: 00053 00056 00058 DtIfStmt(DtReaderWriterRegistry* parentRegistry = NULL); 00059 00061 DtIfStmt(const DtIfStmt& orig, 00062 DtReaderWriterRegistry* parentRegistry = NULL); 00063 00065 virtual ~DtIfStmt(); 00066 00068 DtIfStmt& operator=(const DtIfStmt& orig); 00069 00071 00072 virtual DtSimStatement* clone( 00073 DtReaderWriterRegistry* parentRegistry = NULL) const; 00074 00076 virtual int type() const; 00077 00080 virtual void execute(DtPlan& planContext); 00081 00084 virtual void step(DtPlan& planContext); 00085 00087 virtual int subBlockCount() const; 00089 virtual DtSimBlock* subBlock(int index); 00090 00101 virtual DtString stringRep(int subBlockIndex = DtSR_STMT) const; 00102 00105 virtual void exitFromIf(DtPlan& planContext); 00106 00108 virtual const DtSimCondExpr* condExpr() const; 00109 virtual void setCondExpr(DtSimCondExpr* arg); 00110 00112 virtual DtIfBlock* thenBlock() const; 00113 virtual void setThenBlock(DtIfBlock* arg); 00114 00116 virtual DtIfBlock* elseBlock() const; 00117 virtual void setElseBlock(DtIfBlock* arg); 00118 00130 virtual int netRepSize() const; 00131 00133 virtual bool setFromNet(const char* contentBuffer, 00134 unsigned contentSize); 00135 00147 virtual bool setToNet(); 00148 00149 public: 00150 00151 static DtSimStatement * creator(DtReaderWriterRegistry* parentRegistry = NULL); 00152 00153 protected: 00154 virtual bool compare(DtSimStatement* rhs); 00155 00156 protected: 00157 00158 DtRwCondExpr myCondExpr; 00159 00162 bool myResult; 00163 00164 DtIfBlock* myThenBlock; 00165 DtIfBlock* myElseBlock; 00166 }; 00167 00168 #endif