CigiCollDetVolRespV2 Class Reference

#include <CigiCollDetVolRespV2.h>

Inheritance diagram for CigiCollDetVolRespV2:

CigiBaseCollDetVolResp CigiBasePacket List of all members.

Public Member Functions

 CigiCollDetVolRespV2 ()
virtual ~CigiCollDetVolRespV2 ()
virtual int Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const
virtual int Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec)
int SetVolID (const Cigi_uint8 VolIDIn, bool bndchk=true)
Cigi_uint8 GetVolID (void) const

Detailed Description

Definition at line 57 of file CigiCollDetVolRespV2.h.


Constructor & Destructor Documentation

CigiCollDetVolRespV2::CigiCollDetVolRespV2 (  ) 

General Constructor

Definition at line 82 of file CigiCollDetVolRespV2.cpp.

References CIGI_COLL_DET_VOL_RESP_PACKET_ID_V2, CIGI_COLL_DET_VOL_RESP_PACKET_SIZE_V2, CigiBaseCollDetVolResp::CollEntityID, CigiBaseCollDetVolResp::CollType, CigiBaseCollDetVolResp::CollVolID, CigiBaseCollDetVolResp::EntityID, CigiBasePacket::MinorVersion, CigiBaseCollDetVolResp::NonEntity, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBasePacket::Version, and CigiBaseCollDetVolResp::VolID.

00083 {
00084 
00085    PacketID = CIGI_COLL_DET_VOL_RESP_PACKET_ID_V2;
00086    PacketSize = CIGI_COLL_DET_VOL_RESP_PACKET_SIZE_V2;
00087    Version = 2;
00088    MinorVersion = 0;
00089 
00090    EntityID = 0;
00091    VolID = 0;
00092    CollType = NonEntity;
00093    CollEntityID = 0;
00094    CollVolID = 0;
00095 
00096 }

CigiCollDetVolRespV2::~CigiCollDetVolRespV2 (  )  [virtual]

General Destructor

Definition at line 101 of file CigiCollDetVolRespV2.cpp.

00102 {
00103 
00104 }


Member Function Documentation

Cigi_uint8 CigiCollDetVolRespV2::GetVolID ( void   )  const [inline]

Gets the VolID value.

Returns:
the current VolID.

Definition at line 120 of file CigiCollDetVolRespV2.h.

00120 { return(VolID); }

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

The virtual Pack function for CIGI 2

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 CigiBaseCollDetVolResp.

Definition at line 113 of file CigiCollDetVolRespV2.cpp.

References PackPointerUnion::c, CIGI_COLL_DET_VOL_RESP_PACKET_SIZE_V2, CIGI_SCOPY2, CigiBaseCollDetVolResp::CollEntityID, CigiBaseCollDetVolResp::CollType, PackPointerUnion::d, CigiBaseCollDetVolResp::EntityID, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, PackPointerUnion::s, and CigiBaseCollDetVolResp::VolID.

00114 {
00115    double DBuf[6];
00116 
00117    Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf;
00118 
00119    PackPointer CDta;
00120 
00121    CigiBaseCollDetVolResp * Data = ( CigiBaseCollDetVolResp *)Base;
00122 
00123    CDta.d = DBuf;
00124 
00125    *CDta.c++ = PacketID;
00126    *CDta.c++ = PacketSize;
00127 
00128    CIGI_SCOPY2(CDta.s++, &Data->EntityID);
00129 
00130    Cigi_uint8 HDta = (Data->VolID << 1) & 0xfe;
00131    HDta |= (Cigi_uint16)(Data->CollType & 0x01);
00132    *CDta.c++ = HDta;
00133 
00134    *CDta.c++ = 0;
00135 
00136    CIGI_SCOPY2(CDta.s++, &Data->CollEntityID);
00137 
00138    memcpy(Buff,tBuf,CIGI_COLL_DET_VOL_RESP_PACKET_SIZE_V2);
00139 
00140    return(PacketSize);
00141 
00142 }

int CigiCollDetVolRespV2::SetVolID ( const Cigi_uint8  VolIDIn,
bool  bndchk = true 
)

Sets the VolID with bound checking control

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

Definition at line 185 of file CigiCollDetVolRespV2.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCollDetVolResp::VolID.

00186 {
00187 
00188 #ifndef CIGI_NO_BND_CHK
00189    if(bndchk && ((VolIDIn < 0)||(VolIDIn > 127)))
00190    {
00191 #ifndef CIGI_NO_EXCEPT
00192       throw CigiValueOutOfRangeException("VolID",(Cigi_uint8)VolIDIn,0,127);
00193 #endif
00194       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00195    }
00196 #endif
00197 
00198    VolID = VolIDIn;
00199    return(CIGI_SUCCESS);
00200 
00201 }

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

The virtual Unpack function for CIGI 2

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 CigiBaseCollDetVolResp.

Definition at line 147 of file CigiCollDetVolRespV2.cpp.

References PackPointerUnion::c, CIGI_COLL_DET_VOL_RESP_PACKET_SIZE_V2, CIGI_SCOPY2, CigiBaseCollDetVolResp::CollEntityID, CigiBaseCollDetVolResp::CollType, PackPointerUnion::d, CigiBaseCollDetVolResp::EntityID, CigiBasePacket::PacketSize, PackPointerUnion::s, and CigiBaseCollDetVolResp::VolID.

00148 {
00149    double DBuf[6];
00150 
00151    Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf;
00152 
00153    PackPointer CDta;
00154 
00155    memcpy(tBuf,Buff,CIGI_COLL_DET_VOL_RESP_PACKET_SIZE_V2);
00156 
00157    CDta.d = DBuf;
00158 
00159    CDta.c += 2;  // Step over packet id and size
00160 
00161    CIGI_SCOPY2(&EntityID, CDta.s++);
00162 
00163    Cigi_uint8 HDta = *CDta.c++;
00164    VolID = (HDta >> 1) & 0x7f;
00165    CollType = (CollTypeGrp)(HDta & 0x01);
00166 
00167    CDta.c++;
00168 
00169    CIGI_SCOPY2(&CollEntityID, CDta.s++);
00170 
00171    return(PacketSize);
00172 
00173 }


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