![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 1999 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: condExpr.h,v $ $Revision: 1.11 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00011 00012 #ifndef DtSimCondExpr_H_ 00013 #define DtSimCondExpr_H_ 00014 00015 #include "vrfutil/rdrWritr.h" 00016 #include "vrfutil/ceFactory.h" 00017 #include <vlutil/vlNetTypes.h> 00018 #include "tdbutil/translation.h" 00019 #include "tdbutil/tdbUnits.h" 00020 00021 class DtEvaluator; 00022 class DtSimManager; 00023 00030 #include "vrfutil/vrfutilDefines.h" 00031 class DT_DLL_vrfutil DtSimCondExpr : public DtReaderWriter 00032 { 00033 public: 00034 00036 DtSimCondExpr(); 00037 00039 DtSimCondExpr(const DtString & name, 00040 DtReaderWriterRegistry* parentRegistry = NULL); 00041 00043 DtSimCondExpr(const DtSimCondExpr& orig, 00044 DtReaderWriterRegistry* parentRegistry = NULL); 00045 00047 virtual ~DtSimCondExpr(); 00048 00051 virtual bool init(); 00052 00054 DtSimCondExpr& operator=(const DtSimCondExpr& orig); 00055 00057 virtual DtSimCondExpr* clone( 00058 DtReaderWriterRegistry* parentRegistry = NULL) = 0; 00059 00061 virtual int type() const = 0; 00062 00067 virtual void setEvaluator(DtEvaluator* evaluator); 00068 00076 virtual bool evaluate(const DtString& objectName, 00077 DtSimManager* simManager) const; 00078 00080 virtual int subExprCount() const; 00084 virtual DtSimCondExpr* subExpr(int index); 00085 00086 #ifndef WIN32 00087 00088 static const int DtSR_EXPR = -1; 00089 #else 00090 00091 enum 00092 { 00094 DtSR_EXPR = -1 00095 }; 00096 #endif 00097 00107 virtual DtString stringRep(int subExprIndex = DtSR_EXPR) const = 0; 00108 00112 DtString stringRepFull() const; 00113 00114 virtual char* netRep(); 00115 00117 virtual int netRepSize() const 00118 { return 0; } 00119 00120 virtual bool setFromNet(const char* contentBuffer, 00121 unsigned contentSize) 00122 {(void) &contentBuffer; (void) &contentSize; return false; } 00123 00124 virtual bool setToNet() 00125 { return false; } 00126 00130 00140 static DtSimCondExpr * createCondExpr(DtlObjPtr mtlStream); 00141 00144 static void addCondExprCreatorFcn(const DtString & type, const int intType, 00145 DtCondExprCreatorFcn fcn); 00146 00147 static void setFactory(DtCondExprFactory * factory); 00148 static DtCondExprFactory * factory(); 00149 00150 protected: 00151 00152 virtual char* createNetworkBuffer(); 00153 00154 protected: 00155 static DtCondExprFactory * myFactory; 00156 00157 char* myNetRep; 00158 00159 DtEvaluator* myEvaluator; 00160 }; 00161 00162 #endif 00163