Developing Apama Applications > Developing Adapters > C/C++ Codec Plug-in Development > The C/C++ codec Plug-in Development Specification > Other codec definitions
Other codec definitions
EventCodec.h also provides some additional definitions that the codec author needs to be aware of.
First of these are the codec capability bits. These are returned by the ‘information’ function previously illustrated to define whether the codec can decode or encode messages.
#define AP_EVENTCODEC_CAP_ENCODER 0x0001
#define AP_EVENTCODEC_CAP_DECODER 0x0002
Next is the set of error codes that can be returned by the codec’s functions:
/**
* 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.
*/
typedef enum {
 AP_EventCodec_OK = 0, /* 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 */
} AP_EventCodecError;
Next is a definition for a configuration property. This corresponds to the properties that can be passed in as initialization or re-configuration parameters from the configuration file of the IAF.
/**
* AP_EventCodecProperty
*
* A single codec property, corresponding to a <property> element in the
* adapter configuration file.
*/
typedef struct {
  AP_char8* name;
  AP_char8* value;
} AP_EventCodecProperty;
Properties are passed to the event transport within an AP_EventCodecProperties structure:
/**
* AP_EventCodecProperties
*
* Properties for the codec, extracted from the <codec> element in the
* adapter configuration file.
*/
typedef struct {
  AP_char8* name;
  AP_EventCodecProperty** properties;
} AP_EventCodecProperties;
Finally, the status of a codec is reported in an AP_EventCodecStatus structure:
/**
* AP_EventCodecStatus
*
* Codec status information structure, filled in by the getStatus call.
*/
typedef struct {
  AP_char8* status;
  AP_uint64 totalDecoded;
  AP_uint64 totalEncoded;
  AP_NormalisedEvent* statusDictionary;
} AP_EventCodecStatus;
You are advised to peruse EventCodec.h for the complete definitions. EventTransport.h and SemanticMapper.h are also relevant as they define the functions that a codec author can invoke within the transport layer and the Semantic Mapper, respectively.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.