Apama  10.15.6.0
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, 2013, 2016-2018, 2022 Cumulocity GmbH, Duesseldorf, Germany and/or its affiliates and/or their licensors.$
10  * Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Cumulocity GmbH.
11  *
12  */
13 
14 #ifndef AP_EVENT_CODEC_H
15 #define AP_EVENT_CODEC_H
16 
17 
18 #include <AP_Types.h>
19 #include <IAF_Platform.h>
20 #include <NormalisedEvent.h>
21 #include <EventTransport.h>
22 #include <SemanticMapper.h>
23 #include <AP_TimestampSet.h>
24 #include <IAF_TimestampConfig.h>
25 
49 #define AP_EVENTCODEC_VERSION 0x00040000
50 
51 
56 #define AP_EVENTCODEC_CAP_ENCODER 0x0001
57 #define AP_EVENTCODEC_CAP_DECODER 0x0002
58 
59 
65 #define AP_EVENTCODEC_INFO_FUNCTION_NAME AP_EventCodec_info
66 #define AP_EVENTCODEC_CTOR_FUNCTION_NAME AP_EventCodec_ctor
67 #define AP_EVENTCODEC_DTOR_FUNCTION_NAME AP_EventCodec_dtor
68 
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif /* __cplusplus */
73 
74 
75 /*
76  * Forward-declare some structures
77  */
78 struct AP_EventCodec;
79 struct AP_EventEncoder;
80 struct AP_EventDecoder;
81 struct AP_EventTransport;
82 
83 
91 typedef enum {
107 
108 
115 typedef struct {
117  AP_char8* name;
119  AP_char8* value;
121 
122 
123 
130 typedef struct {
132  AP_char8* name;
136 
137 
150 typedef struct {
155  AP_char8* status;
159  AP_uint64 totalDecoded;
163  AP_uint64 totalEncoded;
178 
179 
193 
215 
225  const AP_char8* (*getLastError)(struct AP_EventCodec* codec);
226 
238  void (*getStatus)(struct AP_EventCodec* codec, AP_EventCodecStatus* status);
239 };
240 
241 
254 
271 
285 
296  const AP_char8* (*getLastError)(struct AP_EventEncoder* encoder);
297 
310  void (*addEventTransport)(struct AP_EventEncoder* encoder, const AP_char8* name, struct AP_EventTransport* transport);
311 
323  void (*removeEventTransport)(struct AP_EventEncoder* encoder, const AP_char8* name);
324 };
325 
326 
339 
358  AP_EventCodecError (*sendTransportEvent)(struct AP_EventDecoder* decoder, AP_TransportEvent event, AP_TimestampSet* timeStamp);
359 
369  void (*setSemanticMapper)(struct AP_EventDecoder* decoder, AP_SemanticMapper* mapper);
370 
384 
395  const AP_char8* (*getLastError)(struct AP_EventDecoder* decoder);
396 };
397 
398 
412 
416  void* reserved;
417 
423 };
424 typedef struct AP_EventEncoder AP_EventEncoder;
425 
426 
440 
444  void* reserved;
445 
451 };
452 typedef struct AP_EventDecoder AP_EventDecoder;
453 
454 
469 
473  void* reserved;
474 
480 
485 
490 };
491 typedef struct AP_EventCodec AP_EventCodec;
492 
493 
514 typedef AP_EVENTCODEC_API void (AP_EVENTCODEC_CALL* AP_EventCodecInfoPtr)(AP_uint32* version, AP_uint32* capabilities);
515 
516 
543 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);
544 
545 
559 typedef AP_EVENTCODEC_API void (AP_EVENTCODEC_CALL* AP_EventCodecDtorPtr)(AP_EventCodec* codec);
560 
561 
562 #ifdef __cplusplus
563 } /* extern "C" */
564 #endif /* __cplusplus */
565 
566 
567 #endif /* AP_EVENT_CODEC_H */
AP_EventCodecError(* flushDownstream)(struct AP_EventDecoder *decoder)
flushDownstream
Definition: EventCodec.h:383
AP_EventCodecError
AP_EventCodecError.
Definition: EventCodec.h:91
AP_EVENTCODEC_API void(AP_EVENTCODEC_CALL * AP_EventCodecInfoPtr)(AP_uint32 *version, AP_uint32 *capabilities)
AP_EventCodecInfoPtr.
Definition: EventCodec.h:514
void(* setSemanticMapper)(struct AP_EventDecoder *decoder, AP_SemanticMapper *mapper)
setSemanticMapper
Definition: EventCodec.h:369
Semantic Mapper.
void * reserved
Pointer to private internal data.
Definition: EventCodec.h:416
Normalised Event.
AP_EventCodec_Functions.
Definition: EventCodec.h:192
AP_EventCodecError(* updateProperties)(struct AP_EventCodec *codec, AP_EventCodecProperties *properties, IAF_TimestampConfig *timestampConfig)
updateProperties
Definition: EventCodec.h:214
AP_EventEncoder * encoder
Pointer to embedded encoder.
Definition: EventCodec.h:484
Everything is fine.
Definition: EventCodec.h:93
AP_uint64 totalDecoded
Total number of downstream events decoded since IAF was run.
Definition: EventCodec.h:159
AP_char8 * name
properties name
Definition: EventCodec.h:132
Trouble sending encoded event to transport.
Definition: EventCodec.h:101
AP_EventDecoder * decoder
Pointer to embedded decoder.
Definition: EventCodec.h:489
AP_EventCodec.
Definition: EventCodec.h:468
void(* addEventTransport)(struct AP_EventEncoder *encoder, const AP_char8 *name, struct AP_EventTransport *transport)
addEventTransport
Definition: EventCodec.h:310
AP_EventEncoder.
Definition: EventCodec.h:411
struct AP_EventDecoder_Functions * functions
Function table of decoder operations.
Definition: EventCodec.h:450
AP_EventCodecProperty.
Definition: EventCodec.h:115
AP_EventEncoder_Functions.
Definition: EventCodec.h:253
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:543
void(* getStatus)(struct AP_EventCodec *codec, AP_EventCodecStatus *status)
getStatus
Definition: EventCodec.h:238
AP_EventCodecProperties.
Definition: EventCodec.h:130
External (client-visible) interface to Transport Integration Layer (TIL) plugin libraries within the ...
AP_EventDecoder.
Definition: EventCodec.h:439
struct AP_EventEncoder_Functions * functions
Function table of encoder operations.
Definition: EventCodec.h:422
AP_NormalisedEvent * statusDictionary
Additional status information about this codec.
Definition: EventCodec.h:176
AP_char8 * value
property value
Definition: EventCodec.h:119
AP_uint64 totalEncoded
Total number of encoded events since the IAF was run.
Definition: EventCodec.h:163
IAF_TimestampConfig.
Definition: IAF_TimestampConfig.h:28
AP_NormalisedEvent.
Definition: NormalisedEvent.h:453
void * reserved
Pointer to private internal data.
Definition: EventCodec.h:444
Couldn't decode an incoming customer event.
Definition: EventCodec.h:99
void * reserved
Pointer to private internal data.
Definition: EventCodec.h:473
Hires Timestamps.
AP_EventDecoder_Functions.
Definition: EventCodec.h:338
void(* removeEventTransport)(struct AP_EventEncoder *encoder, const AP_char8 *name)
removeEventTransport
Definition: EventCodec.h:323
AP_EventCodecError(* sendNormalisedEvent)(struct AP_EventEncoder *encoder, AP_NormalisedEvent *event, AP_TimestampSet *timeStamp)
sendNormalisedEvent
Definition: EventCodec.h:270
Couldn't encode an incoming normalised event.
Definition: EventCodec.h:97
Hires Timestamps configuration support.
AP_EventCodecStatus.
Definition: EventCodec.h:150
AP_char8 * name
property name
Definition: EventCodec.h:117
Trouble sending decoded event to Semantic Mapper.
Definition: EventCodec.h:103
AP_SemanticMapper.
Definition: SemanticMapper.h:173
AP_EventTransport.
Definition: EventTransport.h:395
AP_EVENTCODEC_API void(AP_EVENTCODEC_CALL * AP_EventCodecDtorPtr)(AP_EventCodec *codec)
AP_EventCodecDtorPtr.
Definition: EventCodec.h:559
AP_TimestampSet.
Definition: AP_TimestampSet.h:305
AP_EventCodecProperty ** properties
array of codec property values
Definition: EventCodec.h:134
struct AP_EventCodec_Functions * functions
Function table of codec operations.
Definition: EventCodec.h:479
AP_EventCodecError(* flushUpstream)(struct AP_EventEncoder *encoder)
flushUpstream
Definition: EventCodec.h:284
AP_EventCodecError(* sendTransportEvent)(struct AP_EventDecoder *decoder, AP_TransportEvent event, AP_TimestampSet *timeStamp)
sendTransportEvent
Definition: EventCodec.h:358
Codec was passed an invalid property set.
Definition: EventCodec.h:105
AP_char8 * status
Free form text string containing a codec specific status message.
Definition: EventCodec.h:155
Some unspecified internal error occurred.
Definition: EventCodec.h:95