VR-Forces 4.1 Class Documentation
simStmt.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1999 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: simStmt.h,v $ $Revision: 1.29 $ $State: Exp $
7 *******************************************************************************/
8 
11 
12 #ifndef DtSimStatement_H_
13 #define DtSimStatement_H_
14 
16 
17 #include <vlutil/vlString.h>
18 #include <vlutil/vlList.h>
19 #include "vrfutil/rdrWritr.h"
20 #include "vrfutil/rwIntList.h"
21 #include "vrfplan/stmtFactory.h"
22 #include "vrfutil/strIntMapper.h"
23 #include <vlutil/vlNetTypes.h>
24 #include "tdbutil/translation.h"
25 #include "tdbutil/tdbUnits.h"
26 
27 typedef int DtStmtIdType;
28 
29 class DtPlan;
30 class DtSimBlock;
31 class DtStmtIndex;
33 
38 {
39  DtNetU16 myStatementSize;
40  DtNetU16 myStatementId;
41  DtNetU8 myStatementType;
42  DtNetU8 myPadding1;
43  DtNetU16 myPadding2;
44 };
46 
53 #include "vrfplan/vrfplanDefines.h"
55 {
56 public:
57  friend class DtStmtIndex;
58 
61 
64  DtSimStatement(const DtString& name,
65  DtReaderWriterRegistry* parentRegistry = NULL);
66 
68  DtSimStatement(const DtSimStatement& orig,
69  DtReaderWriterRegistry* parentRegistry = NULL);
70 
72  virtual ~DtSimStatement();
73 
76  virtual bool init();
77 
80 
84  virtual DtSimStatement* clone(
85  DtReaderWriterRegistry* parentRegistry = NULL) const = 0;
86 
88  virtual int type() const = 0;
89 
93  virtual bool validate();
94 
100  virtual void execute(DtPlan& planContext) = 0;
101 
106  virtual void step(DtPlan& planContext);
107 
115  virtual bool translateIndex(DtStmtIndex& index);
116 
119  virtual void translateIndices(const DtList& indices);
120 
126  DtSimStatement* nextStmt() const;
127  DtSimStatement* prevStmt() const;
128 
130  virtual DtStmtIdType statementId() const;
131  virtual void setStatementId(DtStmtIdType arg);
132 
135  virtual DtSimBlock* parentBlock() const;
136  virtual void setParentBlock(DtSimBlock* arg);
137 
139  virtual int subBlockCount() const;
140 
143  virtual DtSimBlock* subBlock(int index);
144 
145 #ifndef WIN32
146 
147  static const int DtSR_STMT = -1;
148 #else
149 
150  enum
151  {
153  DtSR_STMT = -1
154  };
155 #endif
156 
160  virtual DtRecursiveSimStatementIterator* spawnRecursiveIterator() const;
161 
164  virtual DtSimStatement* lookupStatement(DtStmtIdType statementId);
165 
174  virtual DtString stringRep(int subBlockIndex = DtSR_STMT) const = 0;
175 
176  virtual char* netRep();
177 
182  virtual int netRepSize() const;
183 
187  virtual bool setFromNet(const char* contentBuffer, unsigned contentSize);
188 
193  virtual bool setToNet();
194 
195  static DtStmtIdType generateNewStmtId();
196 
200 
209  static DtSimStatement * createStatement(DtlObjPtr mtlStream,
210  DtReaderWriterRegistry* parentRegistry = NULL);
211  static DtSimStatement * createStatement(int statementType,
212  DtReaderWriterRegistry* parentRegistry = NULL);
213 
218 
220  static void addStatementCreatorFcn(const DtString & type, int intType,
222 
223  static void setFactory(DtStatementFactory * factory);
224  static DtStatementFactory * factory();
225 
226 
227  static bool getStatementNameFromStatementType(int statementType, DtString& statementName);
228  static bool getStatementTypeFromStatementName(const DtString& statementName,
229  int& statementType);
230 
231  static bool addStatementTypeMapping(const DtString& statementName, int taskType);
232  static bool removeStatementTypeMapping(const DtString& statementName,
233  int statementType);
234 
236  virtual bool isSameStatement(DtSimStatement*);
237 
238 protected:
239  virtual char* createNetworkBuffer();
240 
243  virtual bool compare(DtSimStatement*);
244 
245 protected:
246 
250 
253 
256 
257  char* myNetRep;
258 
260 };
261 
266 {
267  return (DtSimStatement*) next();
268 }
270 {
271  return (DtSimStatement*) prev();
272 }
273 
274 #endif
275 

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)