VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 
13 #include "vrfutil/rwUUID.h"
15 #include <vlutil/vlNetTypes.h>
16 #include "tdbutil/tdbUnits.h"
17 #include "vrfutil/vrfutilDefines.h"
18 
19 class DtEvaluator;
21 class DtUUID;
22 class DtPlan;
23 class DtLocalObject;
24 
54 {
55 public:
56 
58  DtSimCondExpr();
59 
61  DtSimCondExpr(const DtString & name,
62  DtReaderWriterRegistry* parentRegistry = NULL);
63 
65  DtSimCondExpr(const DtSimCondExpr& orig,
66  DtReaderWriterRegistry* parentRegistry = NULL);
67 
69  virtual ~DtSimCondExpr();
70 
73  virtual bool init();
74 
77 
79  virtual DtSimCondExpr* clone(
80  DtReaderWriterRegistry* parentRegistry = NULL) const = 0;
81 
83  virtual int type() const = 0;
84 
89  virtual void setEvaluator(DtEvaluator* evaluator);
90  DtEvaluator* evaluator() { return myEvaluator; };
91 
101  virtual bool evaluate(DtLocalObject* owner,
102  const DtSimulationServices* simManager, const DtPlan* = 0) const;
103 
105  virtual int subExprCount() const;
109  virtual DtSimCondExpr* subExpr(int index);
110 
112  virtual DtString modifierStringRep(const DtString&) const;
113 
114 #ifndef WIN32
115  static const int DtSR_EXPR = -1;
117 #else
118  enum
120  {
122  DtSR_EXPR = -1
123  };
124 #endif
125 
135  virtual DtString stringRep(int subExprIndex = DtSR_EXPR) const = 0;
136 
140  DtString stringRepFull() const;
141 
142  virtual char* netRep();
143 
145  virtual int netRepSize() const
146  { return 0; }
147 
148  virtual bool setFromNet(const char* contentBuffer,
149  unsigned contentSize)
150  {(void) &contentBuffer; (void) &contentSize; return false; }
151 
152  virtual bool setToNet()
153  { return false; }
154 
158 
162  virtual const DtUUID& simulationObject() const;
163 
173  static DtSimCondExpr * createCondExpr(DtlObjPtr mtlStream);
174 
177  static void addCondExprCreatorFcn(const DtString & type, const int intType,
179 
180  static void setFactory(DtCondExprFactory * factory);
181  static DtCondExprFactory * factory();
182 
183 protected:
184 
185  virtual char* createNetworkBuffer();
186 
187 protected:
189 
190  char* myNetRep;
191 
193 };
194 
195 namespace DtBufferSerialize
196 {
197  DT_DLL_vrfutil char *encode(const DtSimCondExpr* val, char *buffer);
198  DT_DLL_vrfutil const char *decode(DtSimCondExpr*& val, const char *buffer);
200 }
UUID is a unique ID wrapper class.
Definition: rwUUID.h:226
DT_DLL_readerWriter int getSize(const DtString &val)
The number of bytes required to encode the value.
char * myNetRep
Definition: simCondExpr.h:190
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Definition: simCondExpr.h:148
Definition: readerWriter.h:85
Definition: readerWriterRegistry.h:39
Contains the DtUUID class declaration.
DtEvaluator * evaluator()
Definition: simCondExpr.h:90
static DtReaderWriterFactory * factory()
virtual int netRepSize() const
These 3 should become pure virtual functions.
Definition: simCondExpr.h:145
class DtEvaluator:
Definition: evaluator.h:35
DtEvaluator * myEvaluator
Definition: simCondExpr.h:192
DT_DLL_readerWriter char * encode(const DtFilename &val, char *buffer)
Serializes the provided value val into buffer. buffer must have at least the number of bytes returned...
class DtPlan:
Definition: plan.h:92
DtSimCondExpr is an abstract base class representing various Conditional Expressions used by the Plan...
Definition: simCondExpr.h:53
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:89
static DtCondExprFactory * myFactory
Definition: simCondExpr.h:188
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
const DtReaderWriter & operator=(const DtReaderWriter &orig)
assignment operator
DT_DLL_readerWriter const char * decode(DtString &val, const char *buffer)
Decodes a value from buffer and places the result in val of the type specified by val...
class DtCondExprFactory:
Definition: condExprFactory.h:38
virtual bool setToNet()
Definition: simCondExpr.h:152
DtSimCondExpr *(* DtCondExprCreatorFcn)()
Definition: condExprFactory.h:28
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)