Apama 10.15.0 | Connecting Apama Applications to External Components | Working with IAF Plug-ins | C/C++ Transport Plug-in Development | The C/C++ transport plug-in development specification | Communication with the codec layer
 
Communication with the codec layer
If a transport layer plug-in is to be able to receive messages and then pass them on to the codec layer, it must be able to communicate with appropriate decoding codecs. A decoding codec is one that can accept messages from the transport layer and parse them (decode them) into the normalized event format accepted by the Semantic Mapper.
When a codec is loaded into the IAF, its details are passed to all transport layer plug-ins by calling their addEventDecoder function. This tells the transport layer plug-in the name of the decoding codec and provides a reference to its AP_EventDecoder structure.
The reference to AP_EventDecoder gives the transport layer plug-in access to the following functions:
*sendTransportEvent
*getLastError
See AP_EventTransport_Functions in the API Reference for C++ (Doxygen) for more information on these functions.
Assuming the reference to the AP_EventDecoder structure has been stored in a variable called decoder, the functions can be called as follows:
errorCode = decoder->functions->sendTransportEvent(decoder, event);
errorMessage = decoder->functions->getLastError(decoder);