CigiBaseEventNotification.cpp

Go to the documentation of this file.
00001 
00048 #define _EXPORT_CCL_
00049 
00050 #include "CigiBaseEventNotification.h"
00051 #include "CigiSwapping.h"
00052 #include "CigiExceptions.h"
00053 
00054 // ====================================================================
00055 // Construction/Destruction
00056 // ====================================================================
00057 
00058 
00059 // ================================================
00060 // CigiBaseEnvRgnCtrl
00061 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00062 CigiBaseEventNotification::CigiBaseEventNotification()
00063 {
00064 
00065 }
00066 
00067 
00068 
00069 // ================================================
00070 // ~CigiBaseEnvRgnCtrl
00071 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00072 CigiBaseEventNotification::~CigiBaseEventNotification()
00073 {
00074 
00075 }
00076 
00077 
00078 // ====================================================================
00079 // Conversion Control
00080 // ====================================================================
00081 
00082 
00083 // ================================================
00084 // GetCnvt
00085 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00086 int CigiBaseEventNotification::GetCnvt(CigiVersionID &CnvtVersion,
00087                                        CigiCnvtInfoType::Type &CnvtInfo)
00088 {
00089    if(CnvtVersion.CigiMajorVersion < 3)
00090    {
00091       CnvtInfo.ProcID = CigiProcessType::ProcNone;
00092       CnvtInfo.CnvtPacketID = 0;
00093    }
00094    else
00095    {
00096       CnvtInfo.ProcID = CigiProcessType::ProcStd;
00097       CnvtInfo.CnvtPacketID = CIGI_EVENT_NOTIFICATION_PACKET_ID_V3;
00098    }
00099    return(CIGI_SUCCESS);
00100 }
00101 
00102 
00103 // ====================================================================
00104 // Accessors
00105 // ====================================================================
00106 
00107 
00108 
00109 // ================================================
00110 // RgnState
00111 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00112 int CigiBaseEventNotification::SetEventData(const Cigi_uint32 EventDataIn, int ndx, bool bndchk)
00113 {
00114    if((ndx < 0)||(ndx > 2))
00115    {
00116 #ifndef CIGI_NO_EXCEPT
00117       throw CigiValueOutOfRangeException("Event Data Index",ndx,0,2);
00118 #endif
00119       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00120    }
00121 
00122    EventData.ul[ndx] = EventDataIn;
00123    return(CIGI_SUCCESS);
00124 }
00125 
00126 
00127 
00128 // ================================================
00129 // RgnState
00130 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00131 int CigiBaseEventNotification::SetEventData(const Cigi_int32 EventDataIn, int ndx, bool bndchk)
00132 {
00133    if((ndx < 0)||(ndx > 2))
00134    {
00135 #ifndef CIGI_NO_EXCEPT
00136       throw CigiValueOutOfRangeException("Event Data Index",ndx,0,2);
00137 #endif
00138       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00139    }
00140 
00141    EventData.l[ndx] = EventDataIn;
00142    return(CIGI_SUCCESS);
00143 }
00144 
00145 
00146 
00147 // ================================================
00148 // RgnState
00149 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00150 int CigiBaseEventNotification::SetEventData(const float EventDataIn, int ndx, bool bndchk)
00151 {
00152    if((ndx < 0)||(ndx > 2))
00153    {
00154 #ifndef CIGI_NO_EXCEPT
00155       throw CigiValueOutOfRangeException("Event Data Index",ndx,0,2);
00156 #endif
00157       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00158    }
00159 
00160    EventData.f[ndx] = EventDataIn;
00161    return(CIGI_SUCCESS);
00162 }
00163 
00164 
00165 
00166 // ================================================
00167 // RgnState
00168 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00169 Cigi_uint32 CigiBaseEventNotification::GetULEventData(int ndx)
00170 {
00171    if((ndx < 0)||(ndx > 2))
00172    {
00173 #ifndef CIGI_NO_EXCEPT
00174       throw CigiValueOutOfRangeException("Event Data Index",ndx,0,2);
00175 #endif
00176       if(ndx < 0)
00177          return(EventData.ul[0]);
00178       else
00179          return(EventData.ul[2]);
00180    }
00181 
00182    return(EventData.ul[ndx]);
00183 }
00184 
00185 
00186 
00187 
00188 // ================================================
00189 // RgnState
00190 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00191 Cigi_int32 CigiBaseEventNotification::GetLEventData(int ndx)
00192 {
00193    if((ndx < 0)||(ndx > 2))
00194    {
00195 #ifndef CIGI_NO_EXCEPT
00196       throw CigiValueOutOfRangeException("Event Data Index",ndx,0,2);
00197 #endif
00198       if(ndx < 0)
00199          return(EventData.l[0]);
00200       else
00201          return(EventData.l[2]);
00202    }
00203 
00204    return(EventData.l[ndx]);
00205 }
00206 
00207 
00208 
00209 
00210 // ================================================
00211 // RgnState
00212 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00213 float CigiBaseEventNotification::GetFEventData(int ndx)
00214 {
00215    if((ndx < 0)||(ndx > 2))
00216    {
00217 #ifndef CIGI_NO_EXCEPT
00218       throw CigiValueOutOfRangeException("Event Data Index",ndx,0,2);
00219 #endif
00220       if(ndx < 0)
00221          return((float)EventData.ul[0]);
00222       else
00223          return((float)EventData.ul[2]);
00224    }
00225 
00226    return(EventData.f[ndx]);
00227 }
00228 
00229 
00230 
00231 
00232 

Generated on Wed Apr 29 08:59:57 2009 for CCL by  doxygen 1.4.7