![]() |
MAK RTIspy API Documentation for HLA Evolved
|
00001 /********************************************************************* 00002 ** Copyright (c) 1998 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: interactMsg.h,v $ $Revision: 1.26 $ $State: Exp $ 00007 *********************************************************************/ 00008 00011 00012 #ifndef DtInteractMsg_H_ 00013 #define DtInteractMsg_H_ 00014 00015 #include "rtiMsConfig.h" 00016 #include "rtiMsg.h" 00017 #include "netParms.h" 00018 00019 class DtConnectionMgr; 00020 class DtInteractionMsg; 00021 class DtPhvps; 00022 class DtInteractionClassInfo; 00023 typedef void (*DtInteractionCb)(const DtInteractionMsg& inter, void* usr); 00024 00025 00027 class DT_DLL_LRC DtInteractionMsg : public DtRtiMsg 00028 { 00029 public: 00030 00032 DtInteractionMsg(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00033 00035 virtual ~DtInteractionMsg(); 00036 00038 virtual void setChannel(unsigned long handleValue); 00039 virtual unsigned long channel() const; 00040 00042 virtual void setHandle(DtInteractionClassHandle hand) = 0; 00043 virtual DtInteractionClassHandle handle() const = 0; 00044 00046 #ifdef DtIFSPEC1516 00047 virtual void setTag(rti1516::VariableLengthData const& tag); 00048 virtual rti1516::VariableLengthData const& tag() const; 00049 #elif defined(DtIFSPEC1516E) 00050 virtual void setTag(rti1516e::VariableLengthData const& tag); 00051 virtual rti1516e::VariableLengthData const& tag() const; 00052 #else 00053 virtual void setTag(char const * tag); 00054 virtual char const * tag() const; 00055 #endif 00056 00058 virtual void setParams(const DtPhvps& theParameters, 00059 bool checkBufferSize=true); 00060 00065 virtual void getParams(DtPhvps& params, bool useMsgMemory, 00066 DtInteractionClassInfo* classInfo=NULL) const; 00067 00069 virtual unsigned long numParams() const; 00070 00071 public: 00072 00074 static void setChannelIncluded(bool includeChannel); 00075 static bool channelIncluded(); 00076 00077 protected: 00078 00080 virtual void setTagSize(int size) = 0; 00081 virtual int tagSize() const = 0; 00082 00084 virtual DtNetU32* channelPtr() const=0; 00085 00087 virtual char* tagPtr() = 0; 00088 00090 virtual DtNetParams* netParams() = 0; 00092 virtual DtNetBigParams* netBigParams() = 0; 00093 00095 virtual DtNetParamValue* nextNetParam(DtNetParamValue* netParam) const; 00097 virtual DtNetBigParamValue* nextNetBigParam( 00098 DtNetBigParamValue* netParam) const; 00099 00105 virtual void fillFromNetParams( 00106 const DtNetParams* netRepParams, 00107 DtPhvps& params, 00108 bool useMsgMemory, 00109 DtInteractionClassInfo* classInfo=NULL) const; 00110 00117 virtual void fillFromNetBigParams( 00118 const DtNetBigParams* netRepParams, 00119 DtPhvps& params, 00120 bool useMsgMemory, 00121 DtInteractionClassInfo* classInfo=NULL) const; 00122 00124 virtual void fillNetParams( 00125 const DtPhvps& theParameters, 00126 DtNetParams* netRepParams); 00128 virtual void fillNetBigParams( 00129 const DtPhvps& theParameters, 00130 DtNetBigParams* netRepParams); 00131 00133 virtual void setSizeOfNetParams(unsigned long size); 00134 00136 virtual unsigned long sizeNeededForNetParams( 00137 const DtPhvps& params) const; 00138 00140 virtual int channelFieldSize() const; 00141 00143 virtual int tagFieldSize() const; 00144 00147 virtual DtInteractionMsg* self() const; 00148 00149 protected: 00150 00151 #ifdef DtIFSPEC1516 00152 rti1516::VariableLengthData* myTag; 00153 #elif defined(DtIFSPEC1516E) 00154 rti1516e::VariableLengthData* myTag; 00155 #else 00156 char* myTag; 00157 #endif 00158 unsigned long myParamFieldLength; 00159 00160 protected: 00161 static bool theChannelIncluded; 00162 }; 00163 00164 00165 inline DtInteractionMsg* DtInteractionMsg::self() const 00166 { 00167 return const_cast<DtInteractionMsg*>( this ); 00168 } 00169 00170 inline bool DtInteractionMsg::channelIncluded() 00171 { 00172 return theChannelIncluded; 00173 } 00174 00175 #endif 00176