![]() |
MAK RTIspy API Documentation for HLA 1516
|
00001 /********************************************************************* 00002 ** Copyright (c) 1998 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: aHandValSet.h,v $ $Revision: 1.17 $ $State: Exp $ 00007 *********************************************************************/ 00008 00011 00012 #ifndef DtAhvps_H_ 00013 #define DtAhvps_H_ 00014 00015 #include "rtiMsConfig.h" 00016 #include <memory> 00017 #include <vector> 00018 #if defined(DtIFSPEC1516) || defined(DtIFSPEC1516E) 00019 #include "RTI/RTI1516.h" 00020 #else 00021 #ifdef DtIFSPEC13DLC 00022 #include "RTI13.h" 00023 #else 00024 #include "RTI.hh" 00025 #endif 00026 #endif 00027 #include "internalTypes.h" 00028 00029 class DtObjectClassInfo; 00030 00031 #ifdef DtIFSPEC1516 00032 00033 class DT_DLL_LRC DtAhvps 00034 { 00035 public: 00036 00038 DtAhvps(rti1516::AttributeHandleValueMap* ahvpm_i); 00039 00041 virtual ~DtAhvps(); 00042 00043 virtual MAKRti::DtU32 size() const; 00044 00045 virtual DtHandle getHandle(MAKRti::DtU32 i) const; 00046 00047 virtual MAKRti::DtU32 getValueLength(MAKRti::DtU32 i) const; 00048 00049 virtual void getValue(MAKRti::DtU32 i, char *buff, 00050 MAKRti::DtU32& valueLength) const; 00051 00052 virtual char *getValuePointer(MAKRti::DtU32 i, 00053 MAKRti::DtU32& valueLength) const; 00054 00055 virtual unsigned long getTransportType( MAKRti::DtU32 i) const; 00056 00057 virtual unsigned long getOrderType( MAKRti::DtU32 i) const; 00058 00059 virtual void print(DtObjectClassInfo* fomClass) const; 00060 00061 virtual void add(DtAttributeHandle h, const char *buff, 00062 MAKRti::DtU32 valueLength); 00063 00064 virtual void addPointer(DtAttributeHandle h, void const* buff, 00065 MAKRti::DtU32 valueLength); 00066 00067 virtual void remove(DtAttributeHandle h); 00068 00069 virtual void moveFrom(DtAhvps& ahvp, MAKRti::DtU32 &i); 00070 00071 virtual void empty(); 00072 00073 virtual MAKRti::DtU32 start() const; 00074 virtual MAKRti::DtU32 valid(MAKRti::DtU32 i) const; 00075 virtual MAKRti::DtU32 next(MAKRti::DtU32 i) const; 00076 00077 virtual rti1516::AttributeHandleValueMap::const_iterator 00078 getConstIterator(MAKRti::DtU32 i) const; 00079 virtual rti1516::AttributeHandleValueMap::iterator 00080 getIterator(MAKRti::DtU32 i); 00081 00082 virtual void print() const; 00083 00084 virtual rti1516::AttributeHandleValueMap* getImplementation() const; 00085 00087 virtual void setChannel(unsigned long channelValue); 00088 virtual unsigned long channel() const; 00089 00091 virtual void setTransportType(unsigned long type); 00092 virtual unsigned long transportType() const; 00093 00095 virtual void setOrderType(unsigned long type); 00096 virtual unsigned long orderType() const; 00097 00099 virtual void setOffset(MAKRti::DtU32 offset); 00100 virtual void setMinOffset(MAKRti::DtU32 offset); 00101 virtual MAKRti::DtU32 offset(void) const ; 00102 00103 public: 00104 static void setDefaultChannel(unsigned long defaultChannelValue); 00105 static unsigned long defaultChannel(); 00106 00107 private: 00109 DtAhvps(); 00110 00112 void buildAhvpCache() const; 00113 00115 void invalidateAhvpCache() const; 00116 00118 bool testInvariant() const; 00119 00120 protected: 00121 typedef std::vector< rti1516::AttributeHandleValueMap::iterator > 00122 DtAhvpmIteratorList; 00123 00124 static unsigned long theDefaultChannel; 00125 unsigned long myChannel; 00126 00127 00128 rti1516::AttributeHandleValueMap* myAhvpMap; 00129 00132 mutable DtAhvpmIteratorList myAhvpByIndexCache; 00133 mutable bool myAhvpByIndexCacheIsInvalid; 00134 00135 unsigned long myTransportType; 00136 unsigned long myOrderType; 00137 00139 MAKRti::DtU32 myUpdateRateOffset; 00140 }; 00141 00142 #elif defined(DtIFSPEC1516E) 00143 class DT_DLL_LRC DtAhvps 00144 { 00145 public: 00146 00148 DtAhvps(rti1516e::AttributeHandleValueMap* ahvpm_i); 00149 00151 virtual ~DtAhvps(); 00152 00153 virtual MAKRti::DtU32 size() const; 00154 00155 virtual DtHandle getHandle(MAKRti::DtU32 i) const; 00156 00157 virtual MAKRti::DtU32 getValueLength(MAKRti::DtU32 i) const; 00158 00159 virtual void getValue(MAKRti::DtU32 i, char *buff, 00160 MAKRti::DtU32& valueLength) const; 00161 00162 virtual char *getValuePointer(MAKRti::DtU32 i, 00163 MAKRti::DtU32& valueLength) const; 00164 00165 virtual unsigned long getTransportType( MAKRti::DtU32 i) const; 00166 00167 virtual unsigned long getOrderType( MAKRti::DtU32 i) const; 00168 00169 virtual void print(DtObjectClassInfo* fomClass) const; 00170 00171 virtual void add(DtAttributeHandle h, const char *buff, 00172 MAKRti::DtU32 valueLength); 00173 00174 virtual void addPointer(DtAttributeHandle h, void const* buff, 00175 MAKRti::DtU32 valueLength); 00176 00177 virtual void remove(DtAttributeHandle h); 00178 00179 virtual void moveFrom(DtAhvps& ahvp, MAKRti::DtU32 &i); 00180 00181 virtual void empty(); 00182 00183 virtual MAKRti::DtU32 start() const; 00184 virtual MAKRti::DtU32 valid(MAKRti::DtU32 i) const; 00185 virtual MAKRti::DtU32 next(MAKRti::DtU32 i) const; 00186 00187 virtual rti1516e::AttributeHandleValueMap::const_iterator 00188 getConstIterator(MAKRti::DtU32 i) const; 00189 virtual rti1516e::AttributeHandleValueMap::iterator 00190 getIterator(MAKRti::DtU32 i); 00191 00192 virtual void print() const; 00193 00194 virtual rti1516e::AttributeHandleValueMap* getImplementation() const; 00195 00197 virtual void setChannel(unsigned long channelValue); 00198 virtual unsigned long channel() const; 00199 00201 virtual void setTransportType(unsigned long type); 00202 virtual unsigned long transportType() const; 00203 00205 virtual void setOrderType(unsigned long type); 00206 virtual unsigned long orderType() const; 00207 00209 virtual void setOffset(MAKRti::DtU32 offset); 00210 virtual void setMinOffset(MAKRti::DtU32 offset); 00211 virtual MAKRti::DtU32 offset(void) const ; 00212 00213 public: 00214 static void setDefaultChannel(unsigned long defaultChannelValue); 00215 static unsigned long defaultChannel(); 00216 00217 private: 00219 DtAhvps(); 00220 00222 void buildAhvpCache() const; 00223 00225 void invalidateAhvpCache() const; 00226 00228 bool testInvariant() const; 00229 00230 protected: 00231 typedef std::vector< rti1516e::AttributeHandleValueMap::iterator > 00232 DtAhvpmIteratorList; 00233 00234 static unsigned long theDefaultChannel; 00235 unsigned long myChannel; 00236 00237 00238 rti1516e::AttributeHandleValueMap* myAhvpMap; 00239 00242 mutable DtAhvpmIteratorList myAhvpByIndexCache; 00243 mutable bool myAhvpByIndexCacheIsInvalid; 00244 00245 unsigned long myTransportType; 00246 unsigned long myOrderType; 00247 00249 MAKRti::DtU32 myUpdateRateOffset; 00250 }; 00251 00252 #else //! !DtIFSPEC1516 00253 00254 #define DtHvps DtAhvps 00255 #define HandleValuePairSet AttributeHandleValuePairSet 00256 #define DtDEFINING_AHVPS 1 00257 00258 #include "handleValSet.h" 00259 00260 #undef DtHvps 00261 #undef HandleValuePairSet 00262 #undef DtDEFINING_AHVPS 00263 00264 #endif //! DtIFSPEC1516 00265 00266 #endif