![]() |
VR-Link API Documentation for HLA 1.3
|
00001 /********************************************************************* 00002 * ** Copyright (c) 1992-2010 VT MAK 00003 * ** All rights reserved. 00004 * *********************************************************************/ 00005 /********************************************************************* 00006 * ** $RCSfile: hIffEnc.h,v $ $Revision: 1.1 $ $State: Exp $ 00007 * *********************************************************************/ 00008 00009 #if DtHLA 00010 00011 #ifndef DtIffEncoder_H_ 00012 #define DtIffEncoder_H_ 00013 00014 00015 #include "hBaseEmbedEnc.h" 00016 00020 00023 class DT_DLL_VL DtIffStateRepository; 00024 00027 00030 #define DtDECLARE_IFF_ATTR_CHECKER(attrName) \ 00031 DtDECLARE_ATTR_CHECKER(DtIffStateRepository, attrName) 00032 00035 #define DtDECLARE_IFF_ATTR_ENCODER(attrName) \ 00036 DtDECLARE_ATTR_ENCODER(DtIffStateRepository, attrName) 00037 00042 #define DtDEFINE_SIMPLE_IFF_ATTR_ENCODER( \ 00043 attrName, netType, inspector) \ 00044 DtDEFINE_SIMPLE_ATTR_ENCODER(DtIffEncoder, \ 00045 DtIffStateRepository, attrName, netType, inspector) 00046 00052 #define DtDEFINE_SIMPLE_IFF_ATTR_CHECKER( \ 00053 attrName, inspector) \ 00054 DtDEFINE_SIMPLE_ATTR_CHECKER(DtIffEncoder, \ 00055 DtIffStateRepository, attrName, inspector) 00056 00062 #define DtDEFINE_SIMPLE_IFF_ATTR_ENCODER_WITH_PARAM( \ 00063 encClass, attrName, netType, inspector, param) \ 00064 void encClass::encode##attrName(const DtIffStateRepository& rep, \ 00065 RTI::AttributeHandleValuePairSet* attrs, \ 00066 RTI::AttributeHandle attrHandle) \ 00067 { \ 00068 netType netVal; \ 00069 netVal = rep.inspector(param); \ 00070 attrs->add(attrHandle, (char*) &netVal, sizeof(netType)); \ 00071 } 00072 00078 #define DtDEFINE_SIMPLE_IFF_ATTR_CHECKER_WITH_PARAM( \ 00079 encClass, attrName, inspector, param) \ 00080 bool encClass::need##attrName(const DtIffStateRepository& stateRep, \ 00081 const DtIffStateRepository& asSeenByRemote) \ 00082 { \ 00083 return (bool) !(stateRep.inspector(param) == \ 00084 asSeenByRemote.inspector(param)); \ 00085 } 00086 00087 00089 00090 class DT_DLL_VL DtIffEncoder : public DtBaseEmbeddedSystemEncoder 00091 { 00092 public: 00093 00095 DtIffEncoder( 00096 DtExerciseConn* exConn, 00097 DtObjClassDesc* classDesc); 00098 00100 virtual ~DtIffEncoder(); 00101 00103 DtIffEncoder(const DtIffEncoder& orig); 00104 00106 DtIffEncoder& operator=(const DtIffEncoder& orig); 00107 00108 public: 00109 00110 static DtHlaStateEncoder* create( 00111 DtExerciseConn* exConn, 00112 DtObjClassDesc* classDesc); 00113 00114 protected: 00115 00116 DtDECLARE_IFF_ATTR_CHECKER(EventIdentifier); 00117 DtDECLARE_IFF_ATTR_CHECKER(SystemMode); 00118 DtDECLARE_IFF_ATTR_CHECKER(SystemName); 00119 DtDECLARE_IFF_ATTR_CHECKER(SystemType); 00120 DtDECLARE_IFF_ATTR_CHECKER(SystemIsOn); 00121 DtDECLARE_IFF_ATTR_CHECKER(SystemIsOperational); 00122 00124 DtDECLARE_IFF_ATTR_CHECKER(BeamAzimuthCenter); 00125 DtDECLARE_IFF_ATTR_CHECKER(BeamAzimuthSweep); 00126 DtDECLARE_IFF_ATTR_CHECKER(BeamElevationCenter); 00127 DtDECLARE_IFF_ATTR_CHECKER(BeamElevationSweep); 00128 DtDECLARE_IFF_ATTR_CHECKER(BeamSweepSync); 00129 DtDECLARE_IFF_ATTR_CHECKER(Layer2DataAvailable); 00130 DtDECLARE_IFF_ATTR_CHECKER(FundamentalParameterData); 00131 DtDECLARE_IFF_ATTR_CHECKER(SecondaryOperationalDataParameter1); 00132 DtDECLARE_IFF_ATTR_CHECKER(SecondaryOperationalDataParameter2); 00133 00134 00135 DtDECLARE_IFF_ATTR_ENCODER(EventIdentifier); 00136 DtDECLARE_IFF_ATTR_ENCODER(SystemMode); 00137 DtDECLARE_IFF_ATTR_ENCODER(SystemName); 00138 DtDECLARE_IFF_ATTR_ENCODER(SystemType); 00139 DtDECLARE_IFF_ATTR_ENCODER(SystemIsOn); 00140 DtDECLARE_IFF_ATTR_ENCODER(SystemIsOperational); 00141 00143 DtDECLARE_IFF_ATTR_ENCODER(BeamAzimuthCenter); 00144 DtDECLARE_IFF_ATTR_ENCODER(BeamAzimuthSweep); 00145 DtDECLARE_IFF_ATTR_ENCODER(BeamElevationCenter); 00146 DtDECLARE_IFF_ATTR_ENCODER(BeamElevationSweep); 00147 DtDECLARE_IFF_ATTR_ENCODER(BeamSweepSync); 00148 DtDECLARE_IFF_ATTR_ENCODER(Layer2DataAvailable); 00149 DtDECLARE_IFF_ATTR_ENCODER(FundamentalParameterData); 00150 DtDECLARE_IFF_ATTR_ENCODER(SecondaryOperationalDataParameter1); 00151 DtDECLARE_IFF_ATTR_ENCODER(SecondaryOperationalDataParameter2); 00152 00153 }; 00154 00155 #endif 00156 #endif 00157 00158