Apama  10.15.6.0
NormalisedEvent.h
Go to the documentation of this file.
1 /*
2  * NormalisedEvent.h
3  *
4  * External (client-visible) interface to the normalised event type used to
5  * pass event into and out of the IAF Semantic Mapper component. Normalised
6  * events are essentially just dictionaries of name-value pairs, where both
7  * the names and values are character strings. Each name-value pair nominally
8  * represents the name and content of a single field from an event, but users
9  * of the class are free to invent custom naming schemes to represent more
10  * complex event structures. Names must be unique within a given event.
11  * Values may be empty or missing.
12  *
13  * Please note that normalised events are NOT thread-safe. If your code will
14  * be acessing the same normalised event object (or associated iterators) from
15  * multiple threads, you must implement your own thread synchronisation to
16  * prevent concurrent modification of the objects.
17  *
18  * $Copyright(c) 2002-2006, 2008, 2013-2018, 2022 Cumulocity GmbH, Duesseldorf, Germany and/or its affiliates and/or their licensors.$
19  * Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Cumulocity GmbH.
20  *
21  */
22 
23 #ifndef AP_NORMALISED_EVENT_H
24 #define AP_NORMALISED_EVENT_H
25 
26 
27 #include <AP_Types.h>
28 #include <IAF_Platform.h>
29 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif /* __cplusplus */
50 
51 
52 /*
53  * Forward declare some classes
54  */
55 struct AP_NormalisedEvent;
57 
58 
62 typedef const AP_char8* AP_NormalisedEventKey;
63 
64 
68 typedef const AP_char8* AP_NormalisedEventValue;
69 
70 
86 
98  AP_bool (*valid)(struct AP_NormalisedEventIterator* it);
99 
111 
125 
141  AP_bool (*next)(struct AP_NormalisedEventIterator* it);
142 
157  AP_bool (*back)(struct AP_NormalisedEventIterator* it);
158 };
159 
160 
179 
183  void* reserved;
184 
190 
191 };
193 
194 
204 AP_IAFCORE_API void AP_IAFCORE_CALL AP_NormalisedEventIterator_dtor(AP_NormalisedEventIterator* it);
205 
206 
223 
233  AP_uint32 (*size)(struct AP_NormalisedEvent* event);
234 
243  AP_bool (*empty)(struct AP_NormalisedEvent* event);
244 
260 
278 
287  void (*remove)(struct AP_NormalisedEvent* event, AP_NormalisedEventKey key);
288 
302 
311  void (*removeAll)(struct AP_NormalisedEvent* event);
312 
323  AP_bool (*exists)(struct AP_NormalisedEvent* event, AP_NormalisedEventKey key);
324 
337 
352 
369 
386 
400 
414 
425  AP_char8* (*toString)(struct AP_NormalisedEvent* event);
426 
427 
437  void (*char8free)(AP_char8* string);
438 
439 };
440 
441 
454 
458  void* reserved;
459 
465 
466 };
468 
469 
470 /*
471  * AP_NormalisedEvent_globalInit
472  *
473  * Initialisation function used internally by the IAF. User code should *not*
474  * call this function under any circumstances.
475  */
476 AP_IAFCORE_API void AP_IAFCORE_CALL AP_NormalisedEvent_globalInit();
477 
478 
487 AP_IAFCORE_API AP_NormalisedEvent* AP_IAFCORE_CALL AP_NormalisedEvent_ctor();
488 
489 
500 AP_IAFCORE_API AP_NormalisedEvent* AP_IAFCORE_CALL AP_NormalisedEvent_copy(AP_NormalisedEvent* old);
501 
502 
511 AP_IAFCORE_API void AP_IAFCORE_CALL AP_NormalisedEvent_dtor(AP_NormalisedEvent* event);
512 
513 
514 #ifdef __cplusplus
515 } /* extern "C" */
516 #endif /* __cplusplus */
517 
518 
519 #endif /* AP_NORMALISED_EVENT_H */
AP_IAFCORE_API void AP_IAFCORE_CALL AP_NormalisedEventIterator_dtor(AP_NormalisedEventIterator *it)
AP_NormalisedEventIterator_dtor.
AP_NormalisedEventValue(* value)(struct AP_NormalisedEventIterator *it)
value
Definition: NormalisedEvent.h:124
AP_IAFCORE_API AP_NormalisedEvent *AP_IAFCORE_CALL AP_NormalisedEvent_copy(AP_NormalisedEvent *old)
AP_NormalisedEvent_copy.
void(* remove)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
remove
Definition: NormalisedEvent.h:287
AP_NormalisedEventKey(* key)(struct AP_NormalisedEventIterator *it)
key
Definition: NormalisedEvent.h:110
AP_IAFCORE_API void AP_IAFCORE_CALL AP_NormalisedEvent_dtor(AP_NormalisedEvent *event)
AP_NormalisedEvent_dtor.
AP_uint32(* size)(struct AP_NormalisedEvent *event)
size
Definition: NormalisedEvent.h:233
struct AP_NormalisedEventIterator_Functions * functions
Function table of iterator operations.
Definition: NormalisedEvent.h:189
AP_NormalisedEventIterator_Functions.
Definition: NormalisedEvent.h:85
AP_NormalisedEventValue(* findValueAndRemove)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
findValueAndRemove
Definition: NormalisedEvent.h:368
void(* removeAll)(struct AP_NormalisedEvent *event)
removeAll
Definition: NormalisedEvent.h:311
AP_bool(* back)(struct AP_NormalisedEventIterator *it)
back Move the iterator to the previous element of the underlying normalised event instance.
Definition: NormalisedEvent.h:157
void * reserved
Pointer to private internal data.
Definition: NormalisedEvent.h:183
void(* char8free)(AP_char8 *string)
char8free
Definition: NormalisedEvent.h:437
AP_bool(* exists)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
exists
Definition: NormalisedEvent.h:323
struct AP_NormalisedEvent_Functions * functions
Function table of internal operations on the event object.
Definition: NormalisedEvent.h:464
void * reserved
Pointer to private internal data.
Definition: NormalisedEvent.h:458
AP_NormalisedEventIterator.
Definition: NormalisedEvent.h:178
AP_NormalisedEvent.
Definition: NormalisedEvent.h:453
void(* addQuick)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_NormalisedEventValue value)
addQuick
Definition: NormalisedEvent.h:277
AP_NormalisedEventValue(* findValueAndRemove2)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_bool *existed)
findValueAndRemove2
Definition: NormalisedEvent.h:385
const AP_char8 * AP_NormalisedEventValue
Event field values are NUL-terminated C character strings.
Definition: NormalisedEvent.h:68
AP_bool(* empty)(struct AP_NormalisedEvent *event)
empty
Definition: NormalisedEvent.h:243
const AP_char8 * AP_NormalisedEventKey
Event field names (keys) are NUL-terminated C character strings.
Definition: NormalisedEvent.h:56
AP_bool(* next)(struct AP_NormalisedEventIterator *it)
next
Definition: NormalisedEvent.h:141
AP_bool(* valid)(struct AP_NormalisedEventIterator *it)
valid
Definition: NormalisedEvent.h:98
AP_NormalisedEvent_Functions.
Definition: NormalisedEvent.h:222
AP_IAFCORE_API AP_NormalisedEvent *AP_IAFCORE_CALL AP_NormalisedEvent_ctor()
AP_NormalisedEvent_ctor.
AP_NormalisedEventValue(* findValue)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
findValue
Definition: NormalisedEvent.h:351
void(* replace)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_NormalisedEventValue newValue)
replace
Definition: NormalisedEvent.h:301