Apama  10.7.2.2
EventCodec.h
Go to the documentation of this file.
1 /*
2  * EventCodec.h
3  *
4  * External (client-visible) interface to event encoding/decoding (codec)
5  * plugin libraries within the Apama Integration Adapter Framework (IAF).
6  * This is the interface that must be implemented by all codec libraries in
7  * order to be successfully loaded and integrated by the IAF.
8  *
9  * $Copyright(c) 2002-2007, 2008 Progress Software Corporation (PSC). All rights reserved.$
10  * $Copyright (c) 2013, 2016-2018 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.$
11  * Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG
12  *
13  * $Revision: 340684 $
14  */
15 
16 #ifndef AP_EVENT_CODEC_H
17 #define AP_EVENT_CODEC_H
18 
19 
20 #include <AP_Types.h>
21 #include <IAF_Platform.h>
22 #include <NormalisedEvent.h>
23 #include <EventTransport.h>
24 #include <SemanticMapper.h>
25 #include <AP_TimestampSet.h>
26 #include <IAF_TimestampConfig.h>
27 
51 #define AP_EVENTCODEC_VERSION 0x00040000
52 
53 
58 #define AP_EVENTCODEC_CAP_ENCODER 0x0001
59 #define AP_EVENTCODEC_CAP_DECODER 0x0002
60 
61 
67 #define AP_EVENTCODEC_INFO_FUNCTION_NAME AP_EventCodec_info
68 #define AP_EVENTCODEC_CTOR_FUNCTION_NAME AP_EventCodec_ctor
69 #define AP_EVENTCODEC_DTOR_FUNCTION_NAME AP_EventCodec_dtor
70 
71 
72 #ifdef __cplusplus
73 extern "C" {
74 #endif /* __cplusplus */
75 
76 
77 /*
78  * Forward-declare some structures
79  */
80 struct AP_EventCodec;
81 struct AP_EventEncoder;
82 struct AP_EventDecoder;
83 struct AP_EventTransport;
84 
85 
93 typedef enum {
109 
110 
117 typedef struct {
119  AP_char8* name;
121  AP_char8* value;
123 
124 
125 
132 typedef struct {
134  AP_char8* name;
138 
139 
152 typedef struct {
157  AP_char8* status;
161  AP_uint64 totalDecoded;
165  AP_uint64 totalEncoded;
180 
181 
195 
217 
227  const AP_char8* (*getLastError)(struct AP_EventCodec* codec);
228 
240  void (*getStatus)(struct AP_EventCodec* codec, AP_EventCodecStatus* status);
241 };
242 
243 
256 
273 
287 
298  const AP_char8* (*getLastError)(struct AP_EventEncoder* encoder);
299 
312  void (*addEventTransport)(struct AP_EventEncoder* encoder, const AP_char8* name, struct AP_EventTransport* transport);
313 
325  void (*removeEventTransport)(struct AP_EventEncoder* encoder, const AP_char8* name);
326 };
327 
328 
341 
360  AP_EventCodecError (*sendTransportEvent)(struct AP_EventDecoder* decoder, AP_TransportEvent event, AP_TimestampSet* timeStamp);
361 
371  void (*setSemanticMapper)(struct AP_EventDecoder* decoder, AP_SemanticMapper* mapper);
372 
386 
397  const AP_char8* (*getLastError)(struct AP_EventDecoder* decoder);
398 };
399 
400 
414 
418  void* reserved;
419 
425 };
426 typedef struct AP_EventEncoder AP_EventEncoder;
427 
428 
442 
446  void* reserved;
447 
453 };
454 typedef struct AP_EventDecoder AP_EventDecoder;
455 
456 
471 
475  void* reserved;
476 
482 
487 
492 };
493 typedef struct AP_EventCodec AP_EventCodec;
494 
495 
516 typedef AP_EVENTCODEC_API void (AP_EVENTCODEC_CALL* AP_EventCodecInfoPtr)(AP_uint32* version, AP_uint32* capabilities);
517 
518 
545 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);
546 
547 
561 typedef AP_EVENTCODEC_API void (AP_EVENTCODEC_CALL* AP_EventCodecDtorPtr)(AP_EventCodec* codec);
562 
563 
564 #ifdef __cplusplus
565 } /* extern "C" */
566 #endif /* __cplusplus */
567 
568 
569 #endif /* AP_EVENT_CODEC_H */
AP_EventCodecError(* flushDownstream)(struct AP_EventDecoder *decoder)
flushDownstream
Definition: EventCodec.h:385
AP_EventCodecError
AP_EventCodecError.
Definition: EventCodec.h:93
AP_EVENTCODEC_API void(AP_EVENTCODEC_CALL * AP_EventCodecInfoPtr)(AP_uint32 *version, AP_uint32 *capabilities)
AP_EventCodecInfoPtr.
Definition: EventCodec.h:516
void(* setSemanticMapper)(struct AP_EventDecoder *decoder, AP_SemanticMapper *mapper)
setSemanticMapper
Definition: EventCodec.h:371
Semantic Mapper.
void * reserved
Pointer to private internal data.
Definition: EventCodec.h:418
Normalised Event.
AP_EventCodec_Functions.
Definition: EventCodec.h:194
AP_EventCodecError(* updateProperties)(struct AP_EventCodec *codec, AP_EventCodecProperties *properties, IAF_TimestampConfig *timestampConfig)
updateProperties
Definition: EventCodec.h:216
AP_EventEncoder * encoder
Pointer to embedded encoder.
Definition: EventCodec.h:486
Everything is fine.
Definition: EventCodec.h:95
AP_uint64 totalDecoded
Total number of downstream events decoded since IAF was run.
Definition: EventCodec.h:161
AP_char8 * name
properties name
Definition: EventCodec.h:134
Trouble sending encoded event to transport.
Definition: EventCodec.h:103
AP_EventDecoder * decoder
Pointer to embedded decoder.
Definition: EventCodec.h:491
AP_EventCodec.
Definition: EventCodec.h:470
void(* addEventTransport)(struct AP_EventEncoder *encoder, const AP_char8 *name, struct AP_EventTransport *transport)
addEventTransport
Definition: EventCodec.h:312
AP_EventEncoder.
Definition: EventCodec.h:413
struct AP_EventDecoder_Functions * functions
Function table of decoder operations.
Definition: EventCodec.h:452
AP_EventCodecProperty.
Definition: EventCodec.h:117
AP_EventEncoder_Functions.
Definition: EventCodec.h:255
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.
Definition: EventCodec.h:545
void(* getStatus)(struct AP_EventCodec *codec, AP_EventCodecStatus *status)
getStatus
Definition: EventCodec.h:240
AP_EventCodecProperties.
Definition: EventCodec.h:132
External (client-visible) interface to Transport Integration Layer (TIL) plugin libraries within the ...
AP_EventDecoder.
Definition: EventCodec.h:441
struct AP_EventEncoder_Functions * functions
Function table of encoder operations.
Definition: EventCodec.h:424
AP_NormalisedEvent * statusDictionary
Additional status information about this codec.
Definition: EventCodec.h:178
AP_char8 * value
property value
Definition: EventCodec.h:121
AP_uint64 totalEncoded
Total number of encoded events since the IAF was run.
Definition: EventCodec.h:165
IAF_TimestampConfig.
Definition: IAF_TimestampConfig.h:29
AP_NormalisedEvent.
Definition: NormalisedEvent.h:455
void * reserved
Pointer to private internal data.
Definition: EventCodec.h:446
Couldn't decode an incoming customer event.
Definition: EventCodec.h:101
void * reserved
Pointer to private internal data.
Definition: EventCodec.h:475
Hires Timestamps.
AP_EventDecoder_Functions.
Definition: EventCodec.h:340
void(* removeEventTransport)(struct AP_EventEncoder *encoder, const AP_char8 *name)
removeEventTransport
Definition: EventCodec.h:325
AP_EventCodecError(* sendNormalisedEvent)(struct AP_EventEncoder *encoder, AP_NormalisedEvent *event, AP_TimestampSet *timeStamp)
sendNormalisedEvent
Definition: EventCodec.h:272
Couldn't encode an incoming normalised event.
Definition: EventCodec.h:99
Hires Timestamps configuration support.
AP_EventCodecStatus.
Definition: EventCodec.h:152
AP_char8 * name
property name
Definition: EventCodec.h:119
Trouble sending decoded event to Semantic Mapper.
Definition: EventCodec.h:105
AP_SemanticMapper.
Definition: SemanticMapper.h:175
AP_EventTransport.
Definition: EventTransport.h:397
AP_EVENTCODEC_API void(AP_EVENTCODEC_CALL * AP_EventCodecDtorPtr)(AP_EventCodec *codec)
AP_EventCodecDtorPtr.
Definition: EventCodec.h:561
AP_TimestampSet.
Definition: AP_TimestampSet.h:307
AP_EventCodecProperty ** properties
array of codec property values
Definition: EventCodec.h:136
struct AP_EventCodec_Functions * functions
Function table of codec operations.
Definition: EventCodec.h:481
AP_EventCodecError(* flushUpstream)(struct AP_EventEncoder *encoder)
flushUpstream
Definition: EventCodec.h:286
AP_EventCodecError(* sendTransportEvent)(struct AP_EventDecoder *decoder, AP_TransportEvent event, AP_TimestampSet *timeStamp)
sendTransportEvent
Definition: EventCodec.h:360
Codec was passed an invalid property set.
Definition: EventCodec.h:107
AP_char8 * status
Free form text string containing a codec specific status message.
Definition: EventCodec.h:157
Some unspecified internal error occurred.
Definition: EventCodec.h:97