00001 00052 #define _EXPORT_CCL_ 00053 00054 #include "CigiEventNotificationV3.h" 00055 #include "CigiSwapping.h" 00056 #include "CigiExceptions.h" 00057 00058 00059 // ==================================================================== 00060 // Construction/Destruction 00061 // ==================================================================== 00062 00063 00064 // ================================================ 00065 // CigiEventNotificationV3 00066 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 00067 CigiEventNotificationV3::CigiEventNotificationV3() 00068 { 00069 00070 PacketID = CIGI_EVENT_NOTIFICATION_PACKET_ID_V3; 00071 PacketSize = CIGI_EVENT_NOTIFICATION_PACKET_SIZE_V3; 00072 Version = 3; 00073 MinorVersion = 0; 00074 00075 EventID = 0; 00076 EventData.ul[0] = 0; 00077 EventData.ul[1] = 0; 00078 EventData.ul[2] = 0; 00079 00080 } 00081 00082 // ================================================ 00083 // ~CigiEventNotificationV3 00084 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 00085 CigiEventNotificationV3::~CigiEventNotificationV3() 00086 { 00087 00088 } 00089 00090 // ==================================================================== 00091 // Pack and Unpack 00092 // ==================================================================== 00093 00094 // ================================================ 00095 // Pack 00096 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 00097 int CigiEventNotificationV3::Pack(CigiBasePacket * Base, Cigi_uint8 * Buff, void *Spec) const 00098 { 00099 PackPointer CDta; 00100 00101 CigiBaseEventNotification * Data = ( CigiBaseEventNotification *)Base; 00102 00103 CDta.c = Buff; 00104 00105 *CDta.c++ = PacketID; 00106 *CDta.c++ = PacketSize; 00107 00108 *CDta.s++ = Data->EventID; 00109 *CDta.l++ = Data->EventData.l[0]; 00110 *CDta.l++ = Data->EventData.l[1]; 00111 *CDta.l++ = Data->EventData.l[2]; 00112 00113 return(PacketSize); 00114 00115 } 00116 00117 // ================================================ 00118 // Unpack 00119 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 00120 int CigiEventNotificationV3::Unpack(Cigi_uint8 * Buff, bool Swap, void *Spec) 00121 { 00122 PackPointer CDta; 00123 00124 CDta.c = Buff; 00125 00126 CDta.c += 2; // Step over packet id and size 00127 00128 if(!Swap) 00129 { 00130 EventID = *CDta.s++; 00131 EventData.l[0] = *CDta.l++; 00132 EventData.l[1] = *CDta.l++; 00133 EventData.l[2] = *CDta.l++; 00134 } 00135 else 00136 { 00137 CigiSwap2(&EventID, CDta.s++); 00138 CigiSwap4(&EventData.l[0], CDta.l++); 00139 CigiSwap4(&EventData.l[1], CDta.l++); 00140 CigiSwap4(&EventData.l[2], CDta.l++); 00141 } 00142 00143 return(PacketSize); 00144 00145 } 00146 00147 00148 00149 // ==================================================================== 00150 // Accessors 00151 // ==================================================================== 00152 00153