Apama  10.3.1.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EventCodec.h File Reference

EventCodec. More...

#include <AP_Types.h>
#include <IAF_Platform.h>
#include <NormalisedEvent.h>
#include <EventTransport.h>
#include <SemanticMapper.h>
#include <AP_TimestampSet.h>
#include <IAF_TimestampConfig.h>

Go to the source code of this file.

Classes

struct  AP_EventCodecProperty
 AP_EventCodecProperty. More...
 
struct  AP_EventCodecProperties
 AP_EventCodecProperties. More...
 
struct  AP_EventCodecStatus
 AP_EventCodecStatus. More...
 
struct  AP_EventCodec_Functions
 AP_EventCodec_Functions. More...
 
struct  AP_EventEncoder_Functions
 AP_EventEncoder_Functions. More...
 
struct  AP_EventDecoder_Functions
 AP_EventDecoder_Functions. More...
 
struct  AP_EventEncoder
 AP_EventEncoder. More...
 
struct  AP_EventDecoder
 AP_EventDecoder. More...
 
struct  AP_EventCodec
 AP_EventCodec. More...
 

Macros

#define AP_EVENTCODEC_VERSION   0x00040000
 Codec API version. More...
 
#define AP_EVENTCODEC_CAP_ENCODER   0x0001
 Codec capabilities bits. More...
 
#define AP_EVENTCODEC_INFO_FUNCTION_NAME   AP_EventCodec_info
 Names of functions exported from shared library. More...
 

Typedefs

typedef AP_EVENTCODEC_API void(AP_EVENTCODEC_CALL * AP_EventCodecInfoPtr )(AP_uint32 *version, AP_uint32 *capabilities)
 AP_EventCodecInfoPtr. More...
 
typedef AP_EVENTCODEC_API
AP_EventCodec
*(AP_EVENTCODEC_CALL * 
AP_EventCodecCtorPtr )(AP_char8 *name, AP_EventCodecProperties *properties, AP_EventCodecError *err, AP_char8 **errMsg, IAF_TimestampConfig *timestampConfig)
 AP_EventCodecCtorPtr. More...
 
typedef AP_EVENTCODEC_API void(AP_EVENTCODEC_CALL * AP_EventCodecDtorPtr )(AP_EventCodec *codec)
 AP_EventCodecDtorPtr. More...
 

Enumerations

enum  AP_EventCodecError {
  AP_EventCodec_OK = 0, AP_EventCodec_InternalError, AP_EventCodec_EncodingFailure, AP_EventCodec_DecodingFailure,
  AP_EventCodec_TransportFailure, AP_EventCodec_MappingFailure, AP_EventCodec_BadProperties
}
 AP_EventCodecError. More...
 

Detailed Description

EventCodec.

External (client-visible) interface to event encoding/decoding (codec) plugin libraries within the Apama Integration Adapter Framework (IAF). This is the interface that must be implemented by all codec libraries in order to be successfully loaded and integrated by the IAF.

Macro Definition Documentation

#define AP_EVENTCODEC_CAP_ENCODER   0x0001

Codec capabilities bits.

Used in the 'info' function exported from the codec library.

#define AP_EVENTCODEC_INFO_FUNCTION_NAME   AP_EventCodec_info

Names of functions exported from shared library.

The IAF will search for these functions by name when the library is loaded, so you must use these exact names when implementing a codec library.

#define AP_EVENTCODEC_VERSION   0x00040000

Codec API version.

The upper 16 bits identify the major release of the API; the lower 16 bits indicate minor versions within that release. No changes that break backward binary compatibility will be made within a given major release of the API. That is, minor releases may add functionality and fix bugs, but will not change or remove any documented behaviour.

Version history: 1.0 First public version, released with Apama 2.2.0 1.1 Add versioning and multiple transport support for Apama 2.2.1 2.0 Add char8free method to the NormalisedEvent functions Remove deprecated setEventTransport() function 4.0 Addition of high-accuracy timestamps for latency measurement.

Typedef Documentation

typedef AP_EVENTCODEC_API AP_EventCodec*(AP_EVENTCODEC_CALL* AP_EventCodecCtorPtr)(AP_char8 *name, AP_EventCodecProperties *properties, AP_EventCodecError *err, AP_char8 **errMsg, IAF_TimestampConfig *timestampConfig)

AP_EventCodecCtorPtr.

Pointer to the constructor function for the codec library. Each codec plugin library must export a function with this signature, named using the AP_EVENTCODEC_CTOR_FUNCTION_NAME macro.

Constructs a new instance of the event codec. This function will be called by the adapter main program when the adapter starts up.

Note that the input parameters (name, properties, timestampConfig) are owned by the caller. The IAF framework guarantees that properties and timestampConfig will remain valid until after a subsequent call to updateProperties(), so it is safe to hold a pointer to this structure. You should, however, copy the name string if you wish to keep it. The contents of the output parameter errMsg belongs to the codec.

Parameters
nameThe name of this codec instance, also found in properties
propertiesCodec property set derived from the IAF config file
err'Out' parameter for error code if constructor fails
errMsg'Out' parameter for error message if constructor fails
timestampConfigTimestamp recording/logging settings
Returns
Pointer to a new codec instance or NULL if the constructor fails for some reason. In the case of failure, err and errMsg should be filled in with an appropriate error code and message describing the failure.
typedef AP_EVENTCODEC_API void(AP_EVENTCODEC_CALL* AP_EventCodecDtorPtr)(AP_EventCodec *codec)

AP_EventCodecDtorPtr.

Pointer to the destructor function for the codec library. Each codec plugin library must export a function with this signature, named using the AP_EVENTCODEC_DTOR_FUNCTION_NAME macro.

Destroys an instance of the event codec that was previously created by AP_EventCodec_ctor. The codec may assume that it has been flushed before the destructor is called.

Parameters
codecThe event codec object to be destroyed
typedef AP_EVENTCODEC_API void(AP_EVENTCODEC_CALL* AP_EventCodecInfoPtr)(AP_uint32 *version, AP_uint32 *capabilities)

AP_EventCodecInfoPtr.

Pointer to the info function for the codec library. Each codec plugin library must export a function with this signature, named using the AP_EVENTCODEC_INFO_FUNCTION_NAME macro.

Returns basic information about the codecs implemented by this shared library, specifically whether they are encoders, decoders or bidirectional codecs.

Parameters
version'Out' parameter for version number of codec library. This should be the value of AP_EVENTCODEC_VERSION that was defined in EventCodec.h when the codec was built. The IAF will check the version number to ensure that it can support all the capabilities offered by the codec.
capabilities'Out' parameter for the capabilities of the codecs provided by this library. This should be the sum of the appropriate AP_EVENTCODEC_CAP_* constants found in EventCodec.h.

Enumeration Type Documentation

AP_EventCodecError.

Error codes that can be returned by codec library functions. The enumeration values follow the normal UNIX convention of zero == OK and non-zero == error.

Enumerator
AP_EventCodec_OK 

Everything is fine.

AP_EventCodec_InternalError 

Some unspecified internal error occurred.

AP_EventCodec_EncodingFailure 

Couldn't encode an incoming normalised event.

AP_EventCodec_DecodingFailure 

Couldn't decode an incoming customer event.

AP_EventCodec_TransportFailure 

Trouble sending encoded event to transport.

AP_EventCodec_MappingFailure 

Trouble sending decoded event to Semantic Mapper.

AP_EventCodec_BadProperties 

Codec was passed an invalid property set.