VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
simCondExpr.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include "vrfutil/readerWriter.h"
13 #include "vrfutil/rwUUID.h"
15 #include <vlutil/vlNetTypes.h>
16 #include "tdbutil/unitFormatter.h"
17 #include "tdbutil/tdbUnits.h"
18 
19 class DtEvaluator;
20 class DtSimManager;
21 class DtUUID;
22 class DtPlan;
23 
30 #include "vrfutil/vrfutilDefines.h"
32 {
33 public:
34 
36  DtSimCondExpr();
37 
39  DtSimCondExpr(const DtString & name,
40  DtReaderWriterRegistry* parentRegistry = NULL);
41 
43  DtSimCondExpr(const DtSimCondExpr& orig,
44  DtReaderWriterRegistry* parentRegistry = NULL);
45 
47  virtual ~DtSimCondExpr();
48 
51  virtual bool init();
52 
55 
57  virtual DtSimCondExpr* clone(
58  DtReaderWriterRegistry* parentRegistry = NULL) const = 0;
59 
61  virtual int type() const = 0;
62 
67  virtual void setEvaluator(DtEvaluator* evaluator);
68  DtEvaluator* evaluator() { return myEvaluator; };
69 
77  virtual bool evaluate(const DtUUID& object,
78  DtSimManager* simManager, const DtPlan* = 0) const;
79 
81  virtual int subExprCount() const;
85  virtual DtSimCondExpr* subExpr(int index);
86 
88  virtual DtString modifierStringRep(const DtString&) const;
89 
90 #ifndef WIN32
91 
92  static const int DtSR_EXPR = -1;
93 #else
94 
95  enum
96  {
98  DtSR_EXPR = -1
99  };
100 #endif
101 
111  virtual DtString stringRep(int subExprIndex = DtSR_EXPR) const = 0;
112 
116  DtString stringRepFull() const;
117 
118  virtual char* netRep();
119 
121  virtual int netRepSize() const
122  { return 0; }
123 
124  virtual bool setFromNet(const char* contentBuffer,
125  unsigned contentSize)
126  {(void) &contentBuffer; (void) &contentSize; return false; }
127 
128  virtual bool setToNet()
129  { return false; }
130 
134 
138  virtual const DtUUID& simulationObject() const;
139 
149  static DtSimCondExpr * createCondExpr(DtlObjPtr mtlStream);
150 
153  static void addCondExprCreatorFcn(const DtString & type, const int intType,
155 
156  static void setFactory(DtCondExprFactory * factory);
157  static DtCondExprFactory * factory();
158 
159 protected:
160 
161  virtual char* createNetworkBuffer();
162 
163 protected:
165 
166  char* myNetRep;
167 
169 };
170 
171 namespace DtBufferSerialize
172 {
173  DT_DLL_vrfutil char *encode(const DtSimCondExpr* val, char *buffer);
174  DT_DLL_vrfutil const char *decode(DtSimCondExpr*& val, const char *buffer);
176 }

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)