CigiShortCompCtrlV3_3 Class Reference

#include <CigiShortCompCtrlV3_3.h>

Inheritance diagram for CigiShortCompCtrlV3_3:

CigiBaseCompCtrl CigiBasePacket List of all members.

Public Member Functions

 CigiShortCompCtrlV3_3 ()
virtual ~CigiShortCompCtrlV3_3 ()
virtual int Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const
virtual int Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec)
virtual int GetCnvt (CigiVersionID &CnvtVersion, CigiCnvtInfoType::Type &CnvtInfo)
int SetInstanceID (const Cigi_uint16 InstanceIDIn, bool bndchk=true)
Cigi_uint16 GetInstanceID (void) const
int SetCompState (const Cigi_uint8 CompStateIn, bool bndchk=true)
Cigi_uint8 GetCompState (void)
int SetCompClassV3 (const CompClassV3Grp CompClassV3In, bool bndchk=true)
CompClassV3Grp GetCompClassV3 (void) const
int SetCompData (const Cigi_uint8 CompDataIn, const unsigned int Word, const BytePos Pos, bool bndchk=true)
int SetCompData (const Cigi_int8 CompDataIn, const unsigned int Word, const BytePos Pos, bool bndchk=true)
int SetCompData (const Cigi_uint16 CompDataIn, const unsigned int Word, const HalfWordPos Pos, bool bndchk=true)
int SetCompData (const Cigi_int16 CompDataIn, const unsigned int Word, const HalfWordPos Pos, bool bndchk=true)
int SetCompData (const Cigi_uint32 CompDataIn, const unsigned int Word, bool bndchk=true)
int SetCompData (const Cigi_int32 CompDataIn, const unsigned int Word, bool bndchk=true)
int SetCompData (const float CompDataIn, const unsigned int Word, bool bndchk=true)
int SetCompData (const Cigi_uint64 CompDataIn, const unsigned int Pos, bool bndchk=true)
int SetCompData (const double CompDataIn, const unsigned int Pos, bool bndchk=true)
Cigi_uint8 GetUCharCompData (const unsigned int Word, const BytePos Pos)
Cigi_int8 GetCharCompData (const unsigned int Word, const BytePos Pos)
Cigi_uint16 GetUShortCompData (const unsigned int Word, const HalfWordPos Pos)
Cigi_int16 GetShortCompData (const unsigned int Word, const HalfWordPos Pos)
Cigi_uint32 GetULongCompData (const unsigned int Word)
Cigi_int32 GetLongCompData (const unsigned int Word)
float GetFloatCompData (const unsigned int Word)
Cigi_uint64 GetI64CompData (const unsigned int Pos)
double GetDoubleCompData (const unsigned int Pos)

Static Protected Attributes

static const int CompClassCnvtSz = 16
static const CompAssocGrp CompClassV3xV1 [16]
static const CompClassV2Grp CompClassV3xV2 [16]

Detailed Description

Definition at line 70 of file CigiShortCompCtrlV3_3.h.


Constructor & Destructor Documentation

CigiShortCompCtrlV3_3::CigiShortCompCtrlV3_3 (  ) 

General Constructor

Definition at line 107 of file CigiShortCompCtrlV3_3.cpp.

References CIGI_SHORT_COMP_CTRL_PACKET_ID_V3_3, CIGI_SHORT_COMP_CTRL_PACKET_SIZE_V3_3, CigiBaseCompCtrl::CompAssoc, CigiBaseCompCtrl::CompClassV2, CigiBaseCompCtrl::CompClassV3, CigiBaseCompCtrl::CompData, CigiBaseCompCtrl::CompID, CigiBaseCompCtrl::CompState, CigiBaseCompCtrl::Entity, CigiBaseCompCtrl::EntityID, CigiBaseCompCtrl::EntityV2, CigiBaseCompCtrl::EntityV3, CigiBaseCompCtrl::InstanceID, CigiBasePacket::MinorVersion, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBasePacket::Version, and CigiBaseCompCtrl::ViewID.

00108 {
00109 
00110    PacketID = CIGI_SHORT_COMP_CTRL_PACKET_ID_V3_3;
00111    PacketSize = CIGI_SHORT_COMP_CTRL_PACKET_SIZE_V3_3;
00112    Version = 3;
00113    MinorVersion = 3;
00114 
00115    CompID = 0;
00116    InstanceID = 0;
00117    EntityID = 0;
00118    ViewID = 0;
00119    CompState = 0;
00120    CompAssoc = Entity;
00121    CompClassV2 = EntityV2;
00122    CompClassV3 = EntityV3;
00123    CompData[0] = 0;
00124    CompData[1] = 0;
00125    CompData[2] = 0;
00126    CompData[3] = 0;
00127    CompData[4] = 0;
00128    CompData[5] = 0;
00129 
00130 }

CigiShortCompCtrlV3_3::~CigiShortCompCtrlV3_3 (  )  [virtual]

General Destructor

Definition at line 135 of file CigiShortCompCtrlV3_3.cpp.

00136 {
00137 
00138 }


Member Function Documentation

Cigi_int8 CigiShortCompCtrlV3_3::GetCharCompData ( const unsigned int  Word,
const BytePos  Pos 
)

Gets the specified CompData

Parameters:
Word - The word position
Pos - The byte position
Returns:
This returns the specified Cigi_int8 value.

Definition at line 712 of file CigiShortCompCtrlV3_3.cpp.

References CigiBaseCompCtrl::CompData.

00714 {
00715    union {
00716       Cigi_int8 sc;
00717       Cigi_uint8 uc;
00718    } tDta;
00719 
00720    int Err = 0;
00721 
00722    if(Word > 1)
00723       Err = 1;
00724    else if((Pos < 0) || (Pos > 3))
00725       Err = 2;
00726 
00727    if(Err != 0)
00728    {
00729 #ifndef CIGI_NO_EXCEPT
00730       if(Err == 1)
00731          throw CigiValueOutOfRangeException("Word",Word,0,1);
00732       else
00733          throw CigiValueOutOfRangeException("Pos",Pos,0,3);
00734 #endif
00735 
00736       tDta.uc = 0;
00737    }
00738    else
00739       tDta.uc = (Cigi_uint8)((CompData[Word] >> (Pos * 8)) & 0x000000ff);
00740 
00741    return(tDta.sc);
00742 }

int CigiShortCompCtrlV3_3::GetCnvt ( CigiVersionID CnvtVersion,
CigiCnvtInfoType::Type CnvtInfo 
) [virtual]

A virtual Conversion Information function. This function provides conversion information for this packet.

Parameters:
CnvtVersion - The CIGI version to which this packet is being converted.
CnvtInfo - The information needed for conversion
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseCompCtrl.

Definition at line 230 of file CigiShortCompCtrlV3_3.cpp.

References CIGI_COMP_CTRL_PACKET_ID_V1, CIGI_COMP_CTRL_PACKET_ID_V2, CIGI_SHORT_COMP_CTRL_PACKET_ID_V3, CIGI_SHORT_COMP_CTRL_PACKET_ID_V3_3, CIGI_SUCCESS, CigiVersionID::CigiMajorVersion, CigiVersionID::CigiMinorVersion, CigiCnvtInfoType::CigiCnvtInfoStruct::CnvtPacketID, CigiBaseCompCtrl::CompAssoc, CigiBaseCompCtrl::CompClassV2, CigiBaseCompCtrl::CompClassV3, CigiBaseCompCtrl::Entity, CigiBaseCompCtrl::EntityV2, CigiBaseCompCtrl::EntityV3, CigiCnvtInfoType::CigiCnvtInfoStruct::ProcID, CigiBaseCompCtrl::SystemV2, CigiBaseCompCtrl::SystemV3, CigiProcessType::TwoPassCnvtProcNone, CigiProcessType::TwoPassCnvtProcStd, and CigiBaseCompCtrl::View.

00232 {
00233    // Do not convert unless a conversion is found
00234    CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcNone;
00235    CnvtInfo.CnvtPacketID = 0;
00236 
00237    if(CnvtVersion.CigiMajorVersion == 3)
00238    {
00239       // All Component control packets from version 3 and above
00240       //  use the same packet id number
00241 
00242       if(CnvtVersion.CigiMinorVersion < 3)
00243       {
00244          if((CompClassV3 >= EntityV3)&&(CompClassV3 <= SystemV3))
00245          {
00246             CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd;
00247             CnvtInfo.CnvtPacketID = CIGI_SHORT_COMP_CTRL_PACKET_ID_V3;
00248          }
00249       }
00250       else
00251       {
00252          CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd;
00253          CnvtInfo.CnvtPacketID = CIGI_SHORT_COMP_CTRL_PACKET_ID_V3_3;
00254       }
00255    }
00256    else if(CnvtVersion.CigiMajorVersion == 2)
00257    {
00258       if((CompClassV2 >= EntityV2)&&(CompClassV2 <= SystemV2))
00259       {
00260          CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd;
00261          CnvtInfo.CnvtPacketID = CIGI_COMP_CTRL_PACKET_ID_V2;
00262       }
00263    }
00264    else if(CnvtVersion.CigiMajorVersion == 1)
00265    {
00266       if((CompAssoc >= Entity)&&(CompAssoc <= View))
00267       {
00268          CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd;
00269          CnvtInfo.CnvtPacketID = CIGI_COMP_CTRL_PACKET_ID_V1;
00270       }
00271    }
00272    else
00273    {
00274       // All Component control packets from version 3 and above
00275       //  use the same packet id number
00276       CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd;
00277       CnvtInfo.CnvtPacketID = CIGI_SHORT_COMP_CTRL_PACKET_ID_V3_3;
00278    }
00279 
00280    return(CIGI_SUCCESS);
00281 
00282 }

CompClassV3Grp CigiShortCompCtrlV3_3::GetCompClassV3 ( void   )  const [inline]

Gets the CompClassV3 value.

Returns:
the current CompClassV3.

Definition at line 211 of file CigiShortCompCtrlV3_3.h.

00211 { return(CompClassV3); }

Cigi_uint8 CigiShortCompCtrlV3_3::GetCompState ( void   )  [inline]

Gets the CompState value.

Returns:
the current CompState.

Definition at line 173 of file CigiShortCompCtrlV3_3.h.

00174    {
00175       Cigi_uint8 tState = (Cigi_uint8)((CompState > 0x00ff) ?
00176                           0x00ff : CompState);
00177 
00178       return(tState);
00179    }

double CigiShortCompCtrlV3_3::GetDoubleCompData ( const unsigned int  Pos  ) 

Gets the specified CompData

Parameters:
Pos - The double word position
Returns:
This returns the specified double value.

Definition at line 930 of file CigiShortCompCtrlV3_3.cpp.

References _I64_CONST_, and CigiBaseCompCtrl::CompData.

00931 {
00932 
00933    union DtaXfer {
00934       Cigi_uint64 i;
00935       double d;
00936    } XDta;
00937 
00938    if(Pos > 0)
00939    {
00940 #ifndef CIGI_NO_EXCEPT
00941       throw CigiValueOutOfRangeException("Pos",Pos,0,0);
00942 #endif
00943 
00944       XDta.d = 0.0;
00945    }
00946    else
00947    {
00948 
00949       int Word = Pos * 2;
00950       Cigi_uint64 tDtah = (Cigi_uint64)(CompData[Word++]);
00951       tDtah = (tDtah << 32) & _I64_CONST_(0xffffffff00000000);
00952 
00953       Cigi_uint64 tDtal = (Cigi_uint64)(CompData[Word]);
00954       tDtal &= _I64_CONST_(0x00000000ffffffff);
00955 
00956       XDta.i = tDtah | tDtal;
00957 
00958    }
00959 
00960    return(XDta.d);
00961 }

float CigiShortCompCtrlV3_3::GetFloatCompData ( const unsigned int  Word  ) 

Gets the specified CompData

Parameters:
Word - The word position
Returns:
This returns the specified float value.

Definition at line 869 of file CigiShortCompCtrlV3_3.cpp.

References CigiBaseCompCtrl::CompData.

00870 {
00871 
00872    union {
00873       Cigi_uint32 u32;
00874       float f32;
00875    } tDta;
00876 
00877    if(Word > 1)
00878    {
00879 #ifndef CIGI_NO_EXCEPT
00880       throw CigiValueOutOfRangeException("Word",Word,0,1);
00881 #endif
00882 
00883       tDta.u32 = 0;
00884    }
00885    else
00886       tDta.u32 = (Cigi_uint32)(CompData[Word]);
00887 
00888    return(tDta.f32);
00889 }

Cigi_uint64 CigiShortCompCtrlV3_3::GetI64CompData ( const unsigned int  Pos  ) 

Gets the specified CompData

Parameters:
Pos - The double word position
Returns:
This returns the specified Int64 value.

Definition at line 896 of file CigiShortCompCtrlV3_3.cpp.

References _I64_CONST_, and CigiBaseCompCtrl::CompData.

00897 {
00898 
00899    Cigi_uint64 tDta;
00900 
00901    if(Pos > 0)
00902    {
00903 #ifndef CIGI_NO_EXCEPT
00904       throw CigiValueOutOfRangeException("Pos",Pos,0,0);
00905 #endif
00906 
00907       tDta = 0;
00908    }
00909    else
00910    {
00911       int Word = Pos * 2;
00912       Cigi_uint64 tDtah = (Cigi_uint64)(CompData[Word++]);
00913       tDtah = (tDtah << 32) & _I64_CONST_(0xffffffff00000000);
00914 
00915       Cigi_uint64 tDtal = (Cigi_uint64)(CompData[Word]);
00916       tDtal &= _I64_CONST_(0x00000000ffffffff);
00917 
00918       tDta = tDtah | tDtal;
00919    }
00920 
00921 
00922    return(tDta);
00923 }

Cigi_uint16 CigiShortCompCtrlV3_3::GetInstanceID ( void   )  const [inline]

Gets the InstanceID value.

Returns:
the current InstanceID.

Definition at line 152 of file CigiShortCompCtrlV3_3.h.

00152 { return(InstanceID); }

Cigi_int32 CigiShortCompCtrlV3_3::GetLongCompData ( const unsigned int  Word  ) 

Gets the specified CompData

Parameters:
Word - The word position
Returns:
This returns the specified Long value.

Definition at line 842 of file CigiShortCompCtrlV3_3.cpp.

References CigiBaseCompCtrl::CompData.

00843 {
00844 
00845    union {
00846       Cigi_int32 s32;
00847       Cigi_uint32 u32;
00848    } tDta;
00849 
00850    if(Word > 1)
00851    {
00852 #ifndef CIGI_NO_EXCEPT
00853       throw CigiValueOutOfRangeException("Word",Word,0,1);
00854 #endif
00855 
00856       tDta.u32 = 0;
00857    }
00858    else
00859       tDta.u32 = (Cigi_uint32)(CompData[Word]);
00860 
00861    return(tDta.s32);
00862 }

Cigi_int16 CigiShortCompCtrlV3_3::GetShortCompData ( const unsigned int  Word,
const HalfWordPos  Pos 
)

Gets the specified CompData

Parameters:
Word - The word position
Pos - The half word position
Returns:
This returns the specified Cigi_int16 value.

Definition at line 781 of file CigiShortCompCtrlV3_3.cpp.

References CigiBaseCompCtrl::CompData.

00783 {
00784    union {
00785       Cigi_int16 s16;
00786       Cigi_uint16 u16;
00787    } tDta;
00788 
00789    int Err = 0;
00790 
00791    if(Word > 1)
00792       Err = 1;
00793    else if((Pos < 0) || (Pos > 1))
00794       Err = 2;
00795 
00796    if(Err != 0)
00797    {
00798 #ifndef CIGI_NO_EXCEPT
00799       if(Err == 1)
00800          throw CigiValueOutOfRangeException("Word",Word,0,1);
00801       else
00802          throw CigiValueOutOfRangeException("Pos",Pos,0,1);
00803 #endif
00804 
00805       tDta.u16 = 0;
00806    }
00807    else
00808       tDta.u16 = (Cigi_uint16)((CompData[Word] >> (Pos * 16)) & 0x0000ffff);
00809 
00810    return(tDta.s16);
00811 }

Cigi_uint8 CigiShortCompCtrlV3_3::GetUCharCompData ( const unsigned int  Word,
const BytePos  Pos 
)

Gets the specified CompData

Parameters:
Word - The word position
Pos - The byte position
Returns:
This returns the specified Cigi_uint8 value.

Definition at line 678 of file CigiShortCompCtrlV3_3.cpp.

References CigiBaseCompCtrl::CompData.

00680 {
00681 
00682    Cigi_uint8 tDta;
00683 
00684    int Err = 0;
00685 
00686    if(Word > 1)
00687       Err = 1;
00688    else if((Pos < 0) || (Pos > 3))
00689       Err = 2;
00690 
00691    if(Err != 0)
00692    {
00693 #ifndef CIGI_NO_EXCEPT
00694       if(Err == 1)
00695          throw CigiValueOutOfRangeException("Word",Word,0,1);
00696       else
00697          throw CigiValueOutOfRangeException("Pos",Pos,0,3);
00698 #endif
00699 
00700       tDta = 0;
00701    }
00702    else
00703       tDta = (Cigi_uint8)((CompData[Word] >> (Pos * 8)) & 0x000000ff);
00704 
00705    return(tDta);
00706 }

Cigi_uint32 CigiShortCompCtrlV3_3::GetULongCompData ( const unsigned int  Word  ) 

Gets the specified CompData

Parameters:
Word - The word position
Returns:
This returns the specified unsigned Long value.

Definition at line 817 of file CigiShortCompCtrlV3_3.cpp.

References CigiBaseCompCtrl::CompData.

00818 {
00819 
00820    Cigi_uint32 tDta;
00821 
00822 
00823    if(Word > 1)
00824    {
00825 #ifndef CIGI_NO_EXCEPT
00826       throw CigiValueOutOfRangeException("Word",Word,0,1);
00827 #endif
00828 
00829       tDta = 0;
00830    }
00831    else
00832       tDta = CompData[Word];
00833 
00834    return(tDta);
00835 }

Cigi_uint16 CigiShortCompCtrlV3_3::GetUShortCompData ( const unsigned int  Word,
const HalfWordPos  Pos 
)

Gets the specified CompData

Parameters:
Word - The word position
Pos - The half word position
Returns:
This returns the specified Cigi_uint16 value.

Definition at line 748 of file CigiShortCompCtrlV3_3.cpp.

References CigiBaseCompCtrl::CompData.

00750 {
00751    Cigi_uint16 tDta;
00752 
00753    int Err = 0;
00754 
00755    if(Word > 1)
00756       Err = 1;
00757    else if((Pos < 0) || (Pos > 1))
00758       Err = 2;
00759 
00760    if(Err != 0)
00761    {
00762 #ifndef CIGI_NO_EXCEPT
00763       if(Err == 1)
00764          throw CigiValueOutOfRangeException("Word",Word,0,1);
00765       else
00766          throw CigiValueOutOfRangeException("Pos",Pos,0,1);
00767 #endif
00768 
00769       tDta = 0;
00770    }
00771    else
00772       tDta = (Cigi_uint16)((CompData[Word] >> (Pos * 16)) & 0x0000ffff);
00773 
00774    return(tDta);
00775 }

int CigiShortCompCtrlV3_3::Pack ( CigiBasePacket Base,
Cigi_uint8 Buff,
void *  Spec 
) const [virtual]

The virtual Pack function for CIGI 3

Parameters:
Base - A pointer to the instance of the packet to be packed. (Downcast to CigiBasePacket)
Buff - A pointer to the current pack point.
Spec - A pointer to special data - This is not used in this class.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseCompCtrl.

Definition at line 147 of file CigiShortCompCtrlV3_3.cpp.

References PackPointerUnion::c, CigiBaseCompCtrl::CompClassV3, CigiBaseCompCtrl::CompData, CigiBaseCompCtrl::CompID, CigiBaseCompCtrl::CompState, CigiBaseCompCtrl::InstanceID, PackPointerUnion::l, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, and PackPointerUnion::s.

00148 {
00149    PackPointer CDta;
00150 
00151    CigiBaseCompCtrl * Data = ( CigiBaseCompCtrl *)Base;
00152 
00153    CDta.c = Buff;
00154 
00155    *CDta.c++ = PacketID;
00156    *CDta.c++ = PacketSize;
00157 
00158    *CDta.s++ = Data->CompID;
00159    *CDta.s++ = Data->InstanceID;
00160 
00161    *CDta.c++ = Data->CompClassV3 & 0x3f;
00162 
00163    *CDta.c++ = (Cigi_uint8)((Data->CompState > 0x00ff) ?
00164                                  0x00ff : Data->CompState);
00165 
00166    *CDta.l++ = Data->CompData[0];
00167    *CDta.l++ = Data->CompData[1];
00168 
00169    return(PacketSize);
00170 
00171 }

int CigiShortCompCtrlV3_3::SetCompClassV3 ( const CompClassV3Grp  CompClassV3In,
bool  bndchk = true 
)

Sets the CompClassV3 with bound checking control

Parameters:
CompClassV3In -
EntityV3=0
ViewV3=1
ViewGrpV3=2
SensorV3=3
RegionalSeaSurfaceV3=4
RegionalTerrainSurfaceV3=5
RegionalLayeredWeatherV3=6
GlobalSeaSurfaceV3=7
GlobalTerrainSurfaceV3=8
GlobalLayeredWeatherV3=9
AtmosphereV3=10
CelestialSphereV3=11
EventV3=12
SystemV3=13
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 294 of file CigiShortCompCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, CigiBaseCompCtrl::CompAssoc, CigiBaseCompCtrl::CompClassV2, CigiBaseCompCtrl::CompClassV3, CompClassV3xV1, and CompClassV3xV2.

00295 {
00296 
00297 #ifndef CIGI_NO_BND_CHK
00298    if(bndchk && ((CompClassV3In < 0)||(CompClassV3In > 15)))
00299    {
00300 #ifndef CIGI_NO_EXCEPT
00301       throw CigiValueOutOfRangeException("CompClassV3",(CompClassV3Grp)CompClassV3In,0,15);
00302 #endif
00303       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00304    }
00305 #endif
00306 
00307    CompClassV3 = CompClassV3In;
00308 
00309    CompAssoc = CompClassV3xV1[CompClassV3];
00310    CompClassV2 = CompClassV3xV2[CompClassV3];
00311 
00312    return(CIGI_SUCCESS);
00313 
00314 }

int CigiShortCompCtrlV3_3::SetCompData ( const double  CompDataIn,
const unsigned int  Pos,
bool  bndchk = true 
)

Sets the specified CompData with bound checking control

Parameters:
CompDataIn - The byte data
Pos - The double word position
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 635 of file CigiShortCompCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.

00638 {
00639 
00640    if(Pos > 0)
00641    {
00642 #ifndef CIGI_NO_BND_CHK
00643       if(bndchk)
00644       {
00645 #ifndef CIGI_NO_EXCEPT
00646          throw CigiValueOutOfRangeException("Pos",Pos,0,0);
00647 #endif
00648       }
00649 #endif
00650       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00651    }
00652 
00653    union DtaXfer {
00654       Cigi_uint64 i;
00655       double d;
00656    } XDta;
00657 
00658    XDta.d = CompDataIn;
00659 
00660    int Word = Pos * 2;
00661 
00662    CompData[Word++] = (Cigi_uint32)((XDta.i >> 32) & 0x00000000ffffffff);
00663    CompData[Word] = (Cigi_uint32)(XDta.i & 0x00000000ffffffff);
00664 
00665 
00666    return(CIGI_SUCCESS);
00667 }

int CigiShortCompCtrlV3_3::SetCompData ( const Cigi_uint64  CompDataIn,
const unsigned int  Pos,
bool  bndchk = true 
)

Sets the specified CompData with bound checking control

Parameters:
CompDataIn - The byte data
Pos - The double word position
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 604 of file CigiShortCompCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.

00607 {
00608 
00609    if(Pos > 0)
00610    {
00611 #ifndef CIGI_NO_BND_CHK
00612       if(bndchk)
00613       {
00614 #ifndef CIGI_NO_EXCEPT
00615          throw CigiValueOutOfRangeException("Pos",Pos,0,0);
00616 #endif
00617       }
00618 #endif
00619       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00620    }
00621 
00622 
00623    int Word = Pos * 2;
00624 
00625    CompData[Word++] = (Cigi_uint32)((CompDataIn >> 32) & 0x00000000ffffffff);
00626    CompData[Word] = (Cigi_uint32)(CompDataIn & 0x00000000ffffffff);
00627 
00628    return(CIGI_SUCCESS);
00629 }

int CigiShortCompCtrlV3_3::SetCompData ( const float  CompDataIn,
const unsigned int  Word,
bool  bndchk = true 
)

Sets the specified CompData with bound checking control

Parameters:
CompDataIn - The byte data
Word - The word position
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 571 of file CigiShortCompCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.

00574 {
00575 
00576    union {
00577       Cigi_uint32 u32;
00578       float f32;
00579    } tDta;
00580 
00581    if(Word > 1)
00582    {
00583 #ifndef CIGI_NO_BND_CHK
00584       if(bndchk)
00585       {
00586 #ifndef CIGI_NO_EXCEPT
00587          throw CigiValueOutOfRangeException("Word",Word,0,1);
00588 #endif
00589       }
00590 #endif
00591       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00592    }
00593 
00594    tDta.f32 = CompDataIn;
00595    CompData[Word] = tDta.u32;
00596 
00597    return(CIGI_SUCCESS);
00598 }

int CigiShortCompCtrlV3_3::SetCompData ( const Cigi_int32  CompDataIn,
const unsigned int  Word,
bool  bndchk = true 
)

Sets the specified CompData with bound checking control

Parameters:
CompDataIn - The byte data
Word - The word position
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 537 of file CigiShortCompCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.

00540 {
00541 
00542    union {
00543       Cigi_uint32 u32;
00544       Cigi_int32 s32;
00545    } tDta;
00546 
00547    if(Word > 1)
00548    {
00549 #ifndef CIGI_NO_BND_CHK
00550       if(bndchk)
00551       {
00552 #ifndef CIGI_NO_EXCEPT
00553          throw CigiValueOutOfRangeException("Word",Word,0,1);
00554 #endif
00555       }
00556 #endif
00557       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00558    }
00559 
00560    tDta.s32 = CompDataIn;
00561    CompData[Word] = tDta.u32;
00562 
00563 
00564    return(CIGI_SUCCESS);
00565 }

int CigiShortCompCtrlV3_3::SetCompData ( const Cigi_uint32  CompDataIn,
const unsigned int  Word,
bool  bndchk = true 
)

Sets the specified CompData with bound checking control

Parameters:
CompDataIn - The byte data
Word - The word position
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 509 of file CigiShortCompCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.

00512 {
00513 
00514    if(Word > 1)
00515    {
00516 #ifndef CIGI_NO_BND_CHK
00517       if(bndchk)
00518       {
00519 #ifndef CIGI_NO_EXCEPT
00520          throw CigiValueOutOfRangeException("Word",Word,0,1);
00521 #endif
00522       }
00523 #endif
00524       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00525    }
00526 
00527 
00528    CompData[Word] = CompDataIn;
00529 
00530    return(CIGI_SUCCESS);
00531 }

int CigiShortCompCtrlV3_3::SetCompData ( const Cigi_int16  CompDataIn,
const unsigned int  Word,
const HalfWordPos  Pos,
bool  bndchk = true 
)

Sets the specified CompData with bound checking control

Parameters:
CompDataIn - The byte data
Word - The word position
Pos - The half word position
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 459 of file CigiShortCompCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.

00463 {
00464 
00465    union {
00466       Cigi_int16 s16;
00467       Cigi_uint16 u16;
00468    } sxfer;
00469 
00470    int Err = 0;
00471 
00472    if(Word > 1)
00473       Err = 1;
00474    else if((Pos < 0) || (Pos > 1))
00475       Err = 2;
00476 
00477    if(Err != 0)
00478    {
00479 #ifndef CIGI_NO_BND_CHK
00480       if(bndchk)
00481       {
00482 #ifndef CIGI_NO_EXCEPT
00483          if(Err == 1)
00484             throw CigiValueOutOfRangeException("Word",Word,0,1);
00485          else
00486             throw CigiValueOutOfRangeException("Pos",Pos,0,3);
00487 #endif
00488       }
00489 #endif
00490       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00491    }
00492 
00493 
00494    int bitPos = Pos * 16;
00495 
00496    sxfer.s16 = CompDataIn;
00497    Cigi_uint32 tDta = (Cigi_uint32)sxfer.u16;
00498 
00499    CompData[Word] &= ~(0x0000ffff << bitPos);
00500    CompData[Word] |= ((tDta & 0x0000ffff) << bitPos);
00501 
00502    return(CIGI_SUCCESS);
00503 }

int CigiShortCompCtrlV3_3::SetCompData ( const Cigi_uint16  CompDataIn,
const unsigned int  Word,
const HalfWordPos  Pos,
bool  bndchk = true 
)

Sets the specified CompData with bound checking control

Parameters:
CompDataIn - The byte data
Word - The word position
Pos - The half word position
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 415 of file CigiShortCompCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.

00419 {
00420 
00421    int Err = 0;
00422 
00423    if(Word > 1)
00424       Err = 1;
00425    else if((Pos < 0) || (Pos > 1))
00426       Err = 2;
00427 
00428    if(Err != 0)
00429    {
00430 #ifndef CIGI_NO_BND_CHK
00431       if(bndchk)
00432       {
00433 #ifndef CIGI_NO_EXCEPT
00434          if(Err == 1)
00435             throw CigiValueOutOfRangeException("Word",Word,0,1);
00436          else
00437             throw CigiValueOutOfRangeException("Pos",Pos,0,3);
00438 #endif
00439       }
00440 #endif
00441       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00442    }
00443 
00444 
00445    int bitPos = Pos * 16;
00446 
00447    Cigi_uint32 tDta = (Cigi_uint32)CompDataIn;
00448 
00449    CompData[Word] &= ~(0x0000ffff << bitPos);
00450    CompData[Word] |= ((tDta & 0x0000ffff) << bitPos);
00451 
00452    return(CIGI_SUCCESS);
00453 }

int CigiShortCompCtrlV3_3::SetCompData ( const Cigi_int8  CompDataIn,
const unsigned int  Word,
const BytePos  Pos,
bool  bndchk = true 
)

Sets the specified CompData with bound checking control

Parameters:
CompDataIn - The byte data
Word - The word position
Pos - The byte position
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 365 of file CigiShortCompCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.

00369 {
00370 
00371    union {
00372       Cigi_int8 sc;
00373       Cigi_uint8 uc;
00374    } bxfer;
00375 
00376    int Err = 0;
00377 
00378    if(Word > 1)
00379       Err = 1;
00380    else if((Pos < 0) || (Pos > 3))
00381       Err = 2;
00382 
00383    if(Err != 0)
00384    {
00385 #ifndef CIGI_NO_BND_CHK
00386       if(bndchk)
00387       {
00388 #ifndef CIGI_NO_EXCEPT
00389          if(Err == 1)
00390             throw CigiValueOutOfRangeException("Word",Word,0,1);
00391          else
00392             throw CigiValueOutOfRangeException("Pos",Pos,0,3);
00393 #endif
00394       }
00395 #endif
00396       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00397    }
00398 
00399 
00400    int bitPos = Pos * 8;
00401 
00402    bxfer.sc = CompDataIn;
00403    Cigi_uint32 tDta = (Cigi_uint32)bxfer.uc;
00404 
00405    CompData[Word] &= ~(0x000000ff << bitPos);
00406    CompData[Word] |= ((tDta & 0x000000ff) << bitPos);
00407 
00408    return(CIGI_SUCCESS);
00409 }

int CigiShortCompCtrlV3_3::SetCompData ( const Cigi_uint8  CompDataIn,
const unsigned int  Word,
const BytePos  Pos,
bool  bndchk = true 
)

Sets the specified CompData with bound checking control

Parameters:
CompDataIn - The byte data
Word - The word position
Pos - The byte position
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 321 of file CigiShortCompCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.

00325 {
00326 
00327    int Err = 0;
00328 
00329    if(Word > 1)
00330       Err = 1;
00331    else if((Pos < 0) || (Pos > 3))
00332       Err = 2;
00333 
00334    if(Err != 0)
00335    {
00336 #ifndef CIGI_NO_BND_CHK
00337       if(bndchk)
00338       {
00339 #ifndef CIGI_NO_EXCEPT
00340          if(Err == 1)
00341             throw CigiValueOutOfRangeException("Word",Word,0,1);
00342          else
00343             throw CigiValueOutOfRangeException("Pos",Pos,0,3);
00344 #endif
00345       }
00346 #endif
00347       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00348    }
00349 
00350 
00351    int bitPos = Pos * 8;
00352 
00353    Cigi_uint32 tDta = (Cigi_uint32)CompDataIn;
00354 
00355    CompData[Word] &= ~(0x000000ff << bitPos);
00356    CompData[Word] |= ((tDta & 0x000000ff) << bitPos);
00357 
00358    return(CIGI_SUCCESS);
00359 }

int CigiShortCompCtrlV3_3::SetCompState ( const Cigi_uint8  CompStateIn,
bool  bndchk = true 
) [inline]

Sets the CompState with bound checking control

Parameters:
CompStateIn - the State value
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 164 of file CigiShortCompCtrlV3_3.h.

References CIGI_SUCCESS.

00165    {
00166       CompState = (Cigi_uint16)CompStateIn;
00167       return(CIGI_SUCCESS);
00168    }

int CigiShortCompCtrlV3_3::SetInstanceID ( const Cigi_uint16  InstanceIDIn,
bool  bndchk = true 
) [inline]

Sets the InstanceID with bound checking control

Parameters:
InstanceIDIn -
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 143 of file CigiShortCompCtrlV3_3.h.

References CIGI_SUCCESS.

00144    {
00145       InstanceID = InstanceIDIn;
00146       return(CIGI_SUCCESS);
00147    }

int CigiShortCompCtrlV3_3::Unpack ( Cigi_uint8 Buff,
bool  Swap,
void *  Spec 
) [virtual]

The virtual Unpack function for CIGI 3

Parameters:
Buff - A pointer to the current pack point.
Swap - N/A for V1 & V2
Spec - A pointer to special data - This is not used in this class.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseCompCtrl.

Definition at line 176 of file CigiShortCompCtrlV3_3.cpp.

References PackPointerUnion::c, CigiSwap2(), CigiSwap4(), CigiBaseCompCtrl::CompAssoc, CigiBaseCompCtrl::CompClassV2, CigiBaseCompCtrl::CompClassV3, CompClassV3xV1, CompClassV3xV2, CigiBaseCompCtrl::CompData, CigiBaseCompCtrl::CompID, CigiBaseCompCtrl::CompState, CigiBaseCompCtrl::EntityV3, CigiBaseCompCtrl::InstanceID, PackPointerUnion::l, CigiBaseCompCtrl::NoCnvtV1, CigiBaseCompCtrl::NoCnvtV2, CigiBasePacket::PacketSize, PackPointerUnion::s, and CigiBaseCompCtrl::SymbolV3_3.

00177 {
00178    PackPointer CDta;
00179 
00180    CDta.c = Buff;
00181 
00182    CDta.c += 2;  // Step over packet id and size
00183 
00184    if(!Swap)
00185    {
00186       CompID = *CDta.s++;
00187       InstanceID = *CDta.s++;
00188 
00189       CompClassV3 = (CompClassV3Grp)(*CDta.c++ & 0x3f);
00190 
00191       CompState = (Cigi_uint16)*CDta.c++;
00192 
00193       CompData[0] = *CDta.l++;
00194       CompData[1] = *CDta.l++;
00195    }
00196    else
00197    {
00198       CigiSwap2(&CompID, CDta.s++);
00199       CigiSwap2(&InstanceID, CDta.s++);
00200 
00201       CompClassV3 = (CompClassV3Grp)(*CDta.c++ & 0x3f);
00202 
00203       CompState = (Cigi_uint16)*CDta.c++;
00204 
00205       CigiSwap4(&CompData[0], CDta.l++);
00206       CigiSwap4(&CompData[1], CDta.l++);
00207    }
00208 
00209 
00210    if((CompClassV3 >= CigiBaseCompCtrl::EntityV3) &&
00211       (CompClassV3 <= CigiBaseCompCtrl::SymbolV3_3))
00212    {
00213       CompAssoc = CompClassV3xV1[CompClassV3];
00214       CompClassV2 = CompClassV3xV2[CompClassV3];
00215    }
00216    else
00217    {
00218       CompAssoc = NoCnvtV1;
00219       CompClassV2 = NoCnvtV2;
00220    }
00221 
00222    return(PacketSize);
00223 
00224 }


Member Data Documentation

const int CigiShortCompCtrlV3_3::CompClassCnvtSz = 16 [static, protected]

Definition at line 410 of file CigiShortCompCtrlV3_3.h.

const CigiBaseCompCtrl::CompAssocGrp CigiShortCompCtrlV3_3::CompClassV3xV1 [static, protected]

Initial value:

{
   Entity,  
   View,    
   NoCnvtV1, 
   NoCnvtV1,  
   NoCnvtV1,  
   NoCnvtV1,  
   NoCnvtV1,  
   NoCnvtV1,  
   NoCnvtV1,  
   NoCnvtV1,  
   Environment,  
   Environment,  
   NoCnvtV1,  
   NoCnvtV1,  
   NoCnvtV1,  
   NoCnvtV1   
}

Definition at line 411 of file CigiShortCompCtrlV3_3.h.

Referenced by SetCompClassV3(), and Unpack().

const CigiBaseCompCtrl::CompClassV2Grp CigiShortCompCtrlV3_3::CompClassV3xV2 [static, protected]

Initial value:

{
   EntityV2,  
   ViewV2,    
   ViewGrpV2, 
   SensorV2,  
   NoCnvtV2,  
   NoCnvtV2,  
   NoCnvtV2,  
   NoCnvtV2,  
   NoCnvtV2,  
   NoCnvtV2,  
   EnvironmentV2,  
   EnvironmentV2,  
   NoCnvtV2,  
   SystemV2,  
   NoCnvtV2,  
   NoCnvtV2   
}

Definition at line 412 of file CigiShortCompCtrlV3_3.h.

Referenced by SetCompClassV3(), and Unpack().


The documentation for this class was generated from the following files:
Generated on Wed Apr 29 09:00:10 2009 for CCL by  doxygen 1.4.7