Apama 10.3.1 | Apama Documentation | 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 | Defining the transport function table
 
Defining the transport function table
The EventTransport.h header file provides a definition for an AP_EventTransport_Functions structure. This defines a function table whose elements must be set to point to the implementations of the above functions. See the AP_EventTransport_Functions structure in the API Reference for C++ (Doxygen) for more information.
Note that the order of the function pointers within the function table is critical to the reliable operation of the IAF. However, the order that the function definitions appear within the plug-in source code, and indeed the names of the functions, are not important. Apama recommends that the functions be declared static, so that they are not globally visible and can only be accessed via the function table.
It is therefore not obligatory to implement the functions with the same names as per the definitions, as long as the mapping is performed correctly in an instantiation of AP_EventTransport_Functions. A definition in an event transport implementation would look as follows:
static struct AP_EventTransport_Functions EventTransport_Functions
  = {
  updateProperties,
  sendTransportEvent,
  addEventDecoder,
  removeEventDecoder,
  flushUpstream,
  flushDownstream,
  start,
  stop,
  getLastError,
  getStatus
};
The function table created above needs to be placed in an AP_EventTransport object, and one such object needs to be created for every plug-in within its constructor function. See the AP_EventTransport_Functions structure in the API Reference for C++ (Doxygen) for more information.

Copyright © 2013-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.