VR-Link API Documentation for DIS
hIffDec.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  * ** Copyright (c) 1992-2010 VT MAK
00003  * ** All rights reserved.
00004  * *********************************************************************/
00005 /*********************************************************************
00006  * ** $RCSfile: hIffDec.h,v $ $Revision: 1.1 $ $State: Exp $
00007  * *********************************************************************/
00008 
00009 #if DtHLA
00010 
00011 #ifndef DtIffDecoder_H_
00012 #define DtIffDecoder_H_
00013 
00014 
00015 #include "hBaseEmbedDec.h"
00016 
00020 
00023 class DT_DLL_VL DtIffStateRepository;
00024 
00027 
00031 #define DtDECLARE_IFF_ATTR_DECODER(attrName) \
00032    DtDECLARE_ATTR_DECODER(DtIffStateRepository, attrName)
00033 
00041 #define DtDEFINE_SIMPLE_IFF_ATTR_DECODER( \
00042    attrName, netType, inspector) \
00043    DtDEFINE_SIMPLE_IFF_ATTR_DECODER_WITH_CAST( \
00044       attrName, netType, inspector, (netType))
00045 
00051 #define DtDEFINE_SIMPLE_IFF_ATTR_DECODER_WITH_CAST( \
00052    attrName, netType, mutator, castExpr) \
00053    DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST( \
00054       DtIffDecoder, DtIffStateRepository, \
00055       attrName, netType, mutator, castExpr)
00056 
00057 #define DtDEFINE_SIMPLE_IFF_ATTR_DECODER_WITH_CAST_AND_PARAM( \
00058    decClass, attrName, netType, mutator, param, castExpr) \
00059 void decClass::decode##attrName( \
00060    DtIffStateRepository* stateRep, \
00061    const RTI::AttributeHandleValuePairSet& attrs, \
00062    int pairSetIndex) \
00063 { \
00064    RTI::ULong length = attrs.getValueLength(pairSetIndex); \
00065    netType netVal; \
00066    if (length > sizeof(netType)) \
00067    { \
00068       DtWarn("Size of value decoded from RTI update for attribute %s (%d)\n", \
00069          #attrName, length); \
00070       DtWarn(" is larger than size of %s (%d)\n", #netType, sizeof(netType)); \
00071       return; \
00072    } \
00073    attrs.getValue(pairSetIndex, (char*) &netVal, length); \
00074    stateRep->mutator(param, castExpr netVal); \
00075 }
00076 
00078 
00079 class DT_DLL_VL DtIffDecoder : public DtBaseEmbeddedSystemDecoder
00080 {
00081 public:
00082 
00084    DtIffDecoder(
00085       DtExerciseConn* exConn,
00086       DtObjClassDesc* classDesc);
00087 
00089    virtual ~DtIffDecoder();
00090 
00092    DtIffDecoder(const DtIffDecoder& orig);
00093 
00095    DtIffDecoder& operator=(const DtIffDecoder& orig);
00096 
00097 public:
00098 
00099   static DtHlaStateDecoder* create(
00100       DtExerciseConn* exConn,
00101       DtObjClassDesc* classDesc);
00102 
00103 protected:
00104 
00105    DtDECLARE_IFF_ATTR_DECODER(EventIdentifier); 
00106    DtDECLARE_IFF_ATTR_DECODER(SystemMode); 
00107    DtDECLARE_IFF_ATTR_DECODER(SystemName); 
00108    DtDECLARE_IFF_ATTR_DECODER(SystemType); 
00109    DtDECLARE_IFF_ATTR_DECODER(SystemIsOn); 
00110    DtDECLARE_IFF_ATTR_DECODER(SystemIsOperational); 
00111 
00113    DtDECLARE_IFF_ATTR_DECODER(BeamAzimuthCenter);
00114    DtDECLARE_IFF_ATTR_DECODER(BeamAzimuthSweep);
00115    DtDECLARE_IFF_ATTR_DECODER(BeamElevationCenter);
00116    DtDECLARE_IFF_ATTR_DECODER(BeamElevationSweep);
00117    DtDECLARE_IFF_ATTR_DECODER(BeamSweepSync);
00118    DtDECLARE_IFF_ATTR_DECODER(Layer2DataAvailable);
00119    DtDECLARE_IFF_ATTR_DECODER(FundamentalParameterData);
00120    DtDECLARE_IFF_ATTR_DECODER(SecondaryOperationalDataParameter1);
00121    DtDECLARE_IFF_ATTR_DECODER(SecondaryOperationalDataParameter2);
00122 };
00123 
00124 #endif
00125 #endif
00126 
00127 

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)