CigiEarthModelDefV3 Class Reference

#include <CigiEarthModelDefV3.h>

Inheritance diagram for CigiEarthModelDefV3:

CigiBaseEarthModelDef CigiBasePacket List of all members.

Public Member Functions

 CigiEarthModelDefV3 ()
virtual ~CigiEarthModelDefV3 ()
virtual int Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const
virtual int Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec)

Detailed Description

Definition at line 57 of file CigiEarthModelDefV3.h.


Constructor & Destructor Documentation

CigiEarthModelDefV3::CigiEarthModelDefV3 (  ) 

General Constructor

Definition at line 67 of file CigiEarthModelDefV3.cpp.

References CIGI_EARTH_MODEL_DEF_PACKET_ID_V3, CIGI_EARTH_MODEL_DEF_PACKET_SIZE_V3, CigiBaseEarthModelDef::CustomERMEn, CigiBaseEarthModelDef::EquatorialRadius, CigiBaseEarthModelDef::Flattening, CigiBasePacket::MinorVersion, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, and CigiBasePacket::Version.

00068 {
00069 
00070    PacketID = CIGI_EARTH_MODEL_DEF_PACKET_ID_V3;
00071    PacketSize = CIGI_EARTH_MODEL_DEF_PACKET_SIZE_V3;
00072    Version = 3;
00073    MinorVersion = 0;
00074 
00075    CustomERMEn = false;
00076    EquatorialRadius = 0.0;
00077    Flattening = 0.0;
00078 
00079 }

CigiEarthModelDefV3::~CigiEarthModelDefV3 (  )  [virtual]

General Destructor

Definition at line 84 of file CigiEarthModelDefV3.cpp.

00085 {
00086 
00087 }


Member Function Documentation

int CigiEarthModelDefV3::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 CigiBaseEarthModelDef.

Definition at line 96 of file CigiEarthModelDefV3.cpp.

References PackPointerUnion::c, CigiBaseEarthModelDef::CustomERMEn, PackPointerUnion::d, CigiBaseEarthModelDef::EquatorialRadius, CigiBaseEarthModelDef::Flattening, PackPointerUnion::l, CigiBasePacket::PacketID, and CigiBasePacket::PacketSize.

00097 {
00098    PackPointer CDta;
00099 
00100    CigiBaseEarthModelDef * Data = ( CigiBaseEarthModelDef *)Base;
00101 
00102    CDta.c = Buff;
00103 
00104    *CDta.c++ = PacketID;
00105    *CDta.c++ = PacketSize;
00106 
00107    *CDta.c++ = (Data->CustomERMEn) ? 0x01 : 0;
00108 
00109    *CDta.c++ = 0;
00110    *CDta.l++ = 0;
00111 
00112    *CDta.d++ = Data->EquatorialRadius;
00113    *CDta.d++ = Data->Flattening;
00114 
00115    return(PacketSize);
00116 
00117 }

int CigiEarthModelDefV3::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 CigiBaseEarthModelDef.

Definition at line 122 of file CigiEarthModelDefV3.cpp.

References PackPointerUnion::c, CigiSwap8(), CigiBaseEarthModelDef::CustomERMEn, PackPointerUnion::d, CigiBaseEarthModelDef::EquatorialRadius, CigiBaseEarthModelDef::Flattening, and CigiBasePacket::PacketSize.

00123 {
00124    PackPointer CDta;
00125 
00126    CDta.c = Buff;
00127 
00128    CDta.c += 2;  // Step over packet id and size
00129 
00130    CustomERMEn = ((*CDta.c++ & 0x01) != 0);
00131 
00132    CDta.c += 5;
00133 
00134    if(!Swap)
00135    {
00136       EquatorialRadius = *CDta.d++;
00137       Flattening = *CDta.d++;
00138    }
00139    else
00140    {
00141       CigiSwap8(&EquatorialRadius, CDta.d++);
00142       CigiSwap8(&Flattening, CDta.d++);
00143    }
00144 
00145    return(PacketSize);
00146 
00147 }


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