VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simStatement.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
12 
13 #include <vlutil/vlString.h>
14 #include <vlutil/vlList.h>
18 #include "vrfutil/rwUUID.h"
19 #include <readerWriter/rwString.h>
21 #include <vlutil/vlNetTypes.h>
22 #include "tdbutil/unitFormatter.h"
23 #include "tdbutil/tdbUnits.h"
24 
25 #include <boost/unordered_map.hpp>
26 
27 typedef int DtStmtIdType;
28 
29 class DtPlan;
30 class DtSimBlock;
31 class DtStmtIndex;
33 
40 #include "vrfplan/vrfplanDefines.h"
42 {
43 public:
44  friend class DtStmtIndex;
45 
48 
51  DtSimStatement(const DtString& name,
52  DtReaderWriterRegistry* parentRegistry = NULL);
53 
55  DtSimStatement(const DtSimStatement& orig,
56  DtReaderWriterRegistry* parentRegistry = NULL);
57 
59  virtual ~DtSimStatement();
60 
63  virtual bool init();
64 
67 
71  virtual DtSimStatement* clone(
72  DtReaderWriterRegistry* parentRegistry = NULL) const = 0;
73 
75  virtual int type() const = 0;
76 
80  virtual bool validate();
81 
87  virtual void execute(DtPlan& planContext) = 0;
88 
95  virtual void step(DtPlan& planContext, bool forceStep = false);
96 
102  DtSimStatement* nextStmt() const;
103  DtSimStatement* prevStmt() const;
104 
106  virtual DtStmtIdType statementId() const;
107  virtual void setStatementId(DtStmtIdType arg);
108 
111  virtual DtSimBlock* parentBlock() const;
112  virtual void setParentBlock(DtSimBlock* arg);
113 
115  virtual int subBlockCount() const;
116 
119  virtual DtSimBlock* subBlock(int index);
120 
121 #ifndef WIN32
122 
123  static const int DtSR_STMT = -1;
124 #else
125 
126  enum
127  {
129  DtSR_STMT = -1
130  };
131 #endif
132 
136  virtual DtRecursiveSimStatementIterator* spawnRecursiveIterator() const;
137 
140  virtual DtSimStatement* lookupStatement(DtStmtIdType statementId);
141 
143  virtual void setStatementDescription(const DtString&);
144  virtual const DtString& statementDescription() const;
145 
154  virtual DtString stringRep(int subBlockIndex = DtSR_STMT) const = 0;
155 
156  virtual char* netRep();
157 
162  virtual int netRepSize() const;
163 
167  virtual bool setFromNet(const char* contentBuffer, unsigned contentSize);
168 
173  virtual bool setToNet();
174 
175  static DtStmtIdType generateNewStmtId();
176 
180 
189  static DtSimStatement * createStatement(DtlObjPtr mtlStream,
190  DtReaderWriterRegistry* parentRegistry = NULL);
191  static DtSimStatement * createStatement(int statementType,
192  DtReaderWriterRegistry* parentRegistry = NULL);
193 
198 
200  static void addStatementCreatorFcn(const DtString & type, int intType,
202 
203  static void setFactory(DtStatementFactory * factory);
204  static DtStatementFactory * factory();
205 
206 
207  static bool getStatementNameFromStatementType(int statementType, DtString& statementName);
208  static bool getStatementTypeFromStatementName(const DtString& statementName,
209  int& statementType);
210 
211  static bool addStatementTypeMapping(const DtString& statementName, int taskType);
212  static bool removeStatementTypeMapping(const DtString& statementName,
213  int statementType);
214 
216  virtual bool isSameStatement(DtSimStatement*);
217 
219  virtual void upgradeTriggerUUID(const boost::unordered_map<DtUUID, DtUUID>&);
220 
222  virtual void reset();
223 
224 protected:
225  virtual char* createNetworkBuffer();
226 
229  virtual bool compare(DtSimStatement*);
230 
231 protected:
232 
236 
239 
242 
243  char* myNetRep;
244 
246 
248 };
249 
254 {
255  return (DtSimStatement*) next();
256 }
258 {
259  return (DtSimStatement*) prev();
260 }
261 
262 namespace DtBufferSerialize
263 {
264  DT_DLL_vrfplan char *encode(const DtSimStatement* val, char *buffer);
265  DT_DLL_vrfplan const char *decode(DtSimStatement*& val, const char *buffer);
267 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)