CIGI API Version 2.7.1 
CIGI API : Users' Guide
Implementation Notes

Implementation Notes

The following implementation notes are useful when programming or modifying the API.
 

Big and Little Endian Functions

The following API functions have separate implementations for little endian architectures, and are used when the CIGI_LITTLE_ENDIAN preprocessor definition is defined. For more information on the CIGI_LITTLE_ENDIAN preprocessor definition, please refer to the topic on preprocessor definitions.

Note that the little endian function versions are named the same as the big endian functions, but with the LE suffix, as shown in the following table. The little endian functions are not called directly, but are defined in the cigi_api.h header file to take the place of calls to the big endian functions. These include the CigiSyncFrameCounter, CigiProcessIncomingMsgBuffer, CigiGetFirstPacket, and all of the CigiAddPacketXXX methods.
 

Table : Big and Little Endian Function Versions
Big Endian Version Little Endian Version
CigiSyncFrameCounter CigiSyncFrameCounterLE
CigiProcessIncomingMsgBuffer CigiProcessIncomingMsgBufferLE
CigiGetFirstPacket CigiGetFirstPacketLE
CigiAddPacketIGCtrl CigiAddPacketIGCtrlLE
CigiAddPacketEntityCtrl CigiAddPacketEntityCtrlLE
CigiAddPacketComponentCtrl CigiAddPacketComponentCtrlLE
CigiAddPacketArtPartCtrl CigiAddPacketArtPartCtrlLE
CigiAddPacketRateCtrl CigiAddPacketRateCtrlLE
CigiAddPacketEnvCtrl CigiAddPacketEnvCtrlLE
CigiAddPacketWeatherCtrl CigiAddPacketWeatherCtrlLE
CigiAddPacketViewCtrl CigiAddPacketViewCtrlLE
CigiAddPacketSensorCtrl CigiAddPacketSensorCtrlLE
CigiAddPacketTrajectoryDef CigiAddPacketTrajectoryDefLE
CigiAddPacketEffectDef CigiAddPacketEffectDefLE
CigiAddPacketViewDef CigiAddPacketViewDefLE
CigiAddPacketCollisionDetDef CigiAddPacketCollisionDetDefLE
CigiAddPacketVolumeCollDetDef CigiAddPacketVolumeCollDetDefLE
CigiAddPacketHatReq CigiAddPacketHatReqLE
CigiAddPacketLosOccultReq CigiAddPacketLosOccultReqLE
CigiAddPacketLosRangeReq CigiAddPacketLosRangeReqLE
CigiAddPacketHotReq CigiAddPacketHotReqLE
CigiAddPacketSof CigiAddPacketSofLE
CigiAddPacketHatResp CigiAddPacketHatRespLE
CigiAddPacketLosResp CigiAddPacketLosRespLE
CigiAddPacketColResp CigiAddPacketColRespLE
CigiAddPacketSensorResp CigiAddPacketSensorRespLE
CigiAddPacketHotResp CigiAddPacketHotRespLE
CigiAddPacketVolumeCollDetResp CigiAddPacketVolumeCollDetRespLE
CigiAddPacketIGResponseMessage CigiAddPacketIGResponseMessageLE

 

Memory Allocation

In general, dynamic memory allocation, using the malloc() function, should be avoided during the communication between the host and IG. Thus the API allocates the memory needed to manage sessions during the CigiInit() initialization function, and the memory needed by a particular session is allocated when the session is created, through a call to the CigiCreateSession() function.
 

Multiple Threaded Applications

The API is not thread-safe, and thus the responsibility is on the user of the API to access it in a thread-safe way. Notice also, the use of static variables in the function definitions, meaning that functions should not entered and completed one at a time.

Static variables have been used in functions, so that they would not be created on the stack each time a function is called, making the API faster, but harder to synchronize from multiple threads. The API also uses static memory, which is global to the API in all threads.
 

Sessions

-
SourceForge LogoBoeing
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********