VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
simStatement.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 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>
15 #include "vrfutil/readerWriter.h"
18 #include "vrfutil/rwString.h"
20 #include <vlutil/vlNetTypes.h>
21 #include "tdbutil/unitFormatter.h"
22 #include "tdbutil/tdbUnits.h"
23 
24 typedef int DtStmtIdType;
25 
26 class DtPlan;
27 class DtSimBlock;
28 class DtStmtIndex;
30 
37 #include "vrfplan/vrfplanDefines.h"
39 {
40 public:
41  friend class DtStmtIndex;
42 
45 
48  DtSimStatement(const DtString& name,
49  DtReaderWriterRegistry* parentRegistry = NULL);
50 
52  DtSimStatement(const DtSimStatement& orig,
53  DtReaderWriterRegistry* parentRegistry = NULL);
54 
56  virtual ~DtSimStatement();
57 
60  virtual bool init();
61 
64 
68  virtual DtSimStatement* clone(
69  DtReaderWriterRegistry* parentRegistry = NULL) const = 0;
70 
72  virtual int type() const = 0;
73 
77  virtual bool validate();
78 
84  virtual void execute(DtPlan& planContext) = 0;
85 
92  virtual void step(DtPlan& planContext, bool forceStep = false);
93 
99  DtSimStatement* nextStmt() const;
100  DtSimStatement* prevStmt() const;
101 
103  virtual DtStmtIdType statementId() const;
104  virtual void setStatementId(DtStmtIdType arg);
105 
108  virtual DtSimBlock* parentBlock() const;
109  virtual void setParentBlock(DtSimBlock* arg);
110 
112  virtual int subBlockCount() const;
113 
116  virtual DtSimBlock* subBlock(int index);
117 
118 #ifndef WIN32
119 
120  static const int DtSR_STMT = -1;
121 #else
122 
123  enum
124  {
126  DtSR_STMT = -1
127  };
128 #endif
129 
133  virtual DtRecursiveSimStatementIterator* spawnRecursiveIterator() const;
134 
137  virtual DtSimStatement* lookupStatement(DtStmtIdType statementId);
138 
140  virtual void setStatementDescription(const DtString&);
141  virtual const DtString& statementDescription() const;
142 
151  virtual DtString stringRep(int subBlockIndex = DtSR_STMT) const = 0;
152 
153  virtual char* netRep();
154 
159  virtual int netRepSize() const;
160 
164  virtual bool setFromNet(const char* contentBuffer, unsigned contentSize);
165 
170  virtual bool setToNet();
171 
172  static DtStmtIdType generateNewStmtId();
173 
177 
186  static DtSimStatement * createStatement(DtlObjPtr mtlStream,
187  DtReaderWriterRegistry* parentRegistry = NULL);
188  static DtSimStatement * createStatement(int statementType,
189  DtReaderWriterRegistry* parentRegistry = NULL);
190 
195 
197  static void addStatementCreatorFcn(const DtString & type, int intType,
199 
200  static void setFactory(DtStatementFactory * factory);
201  static DtStatementFactory * factory();
202 
203 
204  static bool getStatementNameFromStatementType(int statementType, DtString& statementName);
205  static bool getStatementTypeFromStatementName(const DtString& statementName,
206  int& statementType);
207 
208  static bool addStatementTypeMapping(const DtString& statementName, int taskType);
209  static bool removeStatementTypeMapping(const DtString& statementName,
210  int statementType);
211 
213  virtual bool isSameStatement(DtSimStatement*);
214 
215 protected:
216  virtual char* createNetworkBuffer();
217 
220  virtual bool compare(DtSimStatement*);
221 
222 protected:
223 
227 
230 
233 
234  char* myNetRep;
235 
237 
239 };
240 
245 {
246  return (DtSimStatement*) next();
247 }
249 {
250  return (DtSimStatement*) prev();
251 }
252 
253 namespace DtBufferSerialize
254 {
255  DT_DLL_vrfplan char *encode(const DtSimStatement* val, char *buffer);
256  DT_DLL_vrfplan const char *decode(DtSimStatement*& val, const char *buffer);
258 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)