Apama  10.15.3.4
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 Progress Software Corporation (PSC). All rights reserved.$
19  * $Copyright (c) 2013-2018, 2022 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.$
20  * Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG
21  *
22  */
23 
24 #ifndef AP_NORMALISED_EVENT_H
25 #define AP_NORMALISED_EVENT_H
26 
27 
28 #include <AP_Types.h>
29 #include <IAF_Platform.h>
30 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif /* __cplusplus */
51 
52 
53 /*
54  * Forward declare some classes
55  */
56 struct AP_NormalisedEvent;
58 
59 
63 typedef const AP_char8* AP_NormalisedEventKey;
64 
65 
69 typedef const AP_char8* AP_NormalisedEventValue;
70 
71 
87 
99  AP_bool (*valid)(struct AP_NormalisedEventIterator* it);
100 
112 
126 
142  AP_bool (*next)(struct AP_NormalisedEventIterator* it);
143 
158  AP_bool (*back)(struct AP_NormalisedEventIterator* it);
159 };
160 
161 
180 
184  void* reserved;
185 
191 
192 };
194 
195 
205 AP_IAFCORE_API void AP_IAFCORE_CALL AP_NormalisedEventIterator_dtor(AP_NormalisedEventIterator* it);
206 
207 
224 
234  AP_uint32 (*size)(struct AP_NormalisedEvent* event);
235 
244  AP_bool (*empty)(struct AP_NormalisedEvent* event);
245 
261 
279 
288  void (*remove)(struct AP_NormalisedEvent* event, AP_NormalisedEventKey key);
289 
303 
312  void (*removeAll)(struct AP_NormalisedEvent* event);
313 
324  AP_bool (*exists)(struct AP_NormalisedEvent* event, AP_NormalisedEventKey key);
325 
338 
353 
370 
387 
401 
415 
426  AP_char8* (*toString)(struct AP_NormalisedEvent* event);
427 
428 
438  void (*char8free)(AP_char8* string);
439 
440 };
441 
442 
455 
459  void* reserved;
460 
466 
467 };
469 
470 
471 /*
472  * AP_NormalisedEvent_globalInit
473  *
474  * Initialisation function used internally by the IAF. User code should *not*
475  * call this function under any circumstances.
476  */
477 AP_IAFCORE_API void AP_IAFCORE_CALL AP_NormalisedEvent_globalInit();
478 
479 
488 AP_IAFCORE_API AP_NormalisedEvent* AP_IAFCORE_CALL AP_NormalisedEvent_ctor();
489 
490 
501 AP_IAFCORE_API AP_NormalisedEvent* AP_IAFCORE_CALL AP_NormalisedEvent_copy(AP_NormalisedEvent* old);
502 
503 
512 AP_IAFCORE_API void AP_IAFCORE_CALL AP_NormalisedEvent_dtor(AP_NormalisedEvent* event);
513 
514 
515 #ifdef __cplusplus
516 } /* extern "C" */
517 #endif /* __cplusplus */
518 
519 
520 #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:125
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:288
AP_NormalisedEventKey(* key)(struct AP_NormalisedEventIterator *it)
key
Definition: NormalisedEvent.h:111
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:234
struct AP_NormalisedEventIterator_Functions * functions
Function table of iterator operations.
Definition: NormalisedEvent.h:190
AP_NormalisedEventIterator_Functions.
Definition: NormalisedEvent.h:86
AP_NormalisedEventValue(* findValueAndRemove)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
findValueAndRemove
Definition: NormalisedEvent.h:369
void(* removeAll)(struct AP_NormalisedEvent *event)
removeAll
Definition: NormalisedEvent.h:312
AP_bool(* back)(struct AP_NormalisedEventIterator *it)
back Move the iterator to the previous element of the underlying normalised event instance.
Definition: NormalisedEvent.h:158
void * reserved
Pointer to private internal data.
Definition: NormalisedEvent.h:184
void(* char8free)(AP_char8 *string)
char8free
Definition: NormalisedEvent.h:438
AP_bool(* exists)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
exists
Definition: NormalisedEvent.h:324
struct AP_NormalisedEvent_Functions * functions
Function table of internal operations on the event object.
Definition: NormalisedEvent.h:465
void * reserved
Pointer to private internal data.
Definition: NormalisedEvent.h:459
AP_NormalisedEventIterator.
Definition: NormalisedEvent.h:179
AP_NormalisedEvent.
Definition: NormalisedEvent.h:454
void(* addQuick)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_NormalisedEventValue value)
addQuick
Definition: NormalisedEvent.h:278
AP_NormalisedEventValue(* findValueAndRemove2)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_bool *existed)
findValueAndRemove2
Definition: NormalisedEvent.h:386
const AP_char8 * AP_NormalisedEventValue
Event field values are NUL-terminated C character strings.
Definition: NormalisedEvent.h:69
AP_bool(* empty)(struct AP_NormalisedEvent *event)
empty
Definition: NormalisedEvent.h:244
const AP_char8 * AP_NormalisedEventKey
Event field names (keys) are NUL-terminated C character strings.
Definition: NormalisedEvent.h:57
AP_bool(* next)(struct AP_NormalisedEventIterator *it)
next
Definition: NormalisedEvent.h:142
AP_bool(* valid)(struct AP_NormalisedEventIterator *it)
valid
Definition: NormalisedEvent.h:99
AP_NormalisedEvent_Functions.
Definition: NormalisedEvent.h:223
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:352
void(* replace)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_NormalisedEventValue newValue)
replace
Definition: NormalisedEvent.h:302