Apama 10.15.0 | Connecting Apama Applications to External Components | Working with IAF Plug-ins | C/C++ Codec Plug-in Development | The C/C++ codec plug-in development specification | Defining the codec function tables | The codec encoder function table
 
The codec encoder function table
If the codec being implemented is to act as an encoder, it needs to implement the encoder functions listed previously and map them in an encoder function table. This structure is defined in EventCodec.h as an AP_EventEncoder_Functions structure with the following functions:
*sendNormalisedEvent
*flushUpstream
*getLastError
*addEventTransport
*removeEventTransport
See the AP_EventEncoder_Functions structure in the API Reference for C++ (Doxygen) for detailed information.
In the implementation of an encoding codec, this function table could be implemented as follows:
static struct AP_EventEncoder_Functions EventEncoder_Functions = {
  sendNormalisedEvent,
  flushUpstream,
  getLastErrorEncoder,
  addEventTransport,
  removeEventTransport
};
This time, the library functions sendNormalisedEvent, flushUpstream,getLastError, addEventTransport and removeEventTransport are being defined as the implementations of the Codec Development Specification's sendNormalisedEvent, flushUpstream,getLastError, addEventTransport and removeEventTransport function definitions respectively.