Apama  10.5.4.1
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 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  * $Revision: 340684 $
23  */
24 
25 #ifndef AP_NORMALISED_EVENT_H
26 #define AP_NORMALISED_EVENT_H
27 
28 
29 #include <AP_Types.h>
30 #include <IAF_Platform.h>
31 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif /* __cplusplus */
52 
53 
54 /*
55  * Forward declare some classes
56  */
57 struct AP_NormalisedEvent;
59 
60 
64 typedef const AP_char8* AP_NormalisedEventKey;
65 
66 
70 typedef const AP_char8* AP_NormalisedEventValue;
71 
72 
88 
100  AP_bool (*valid)(struct AP_NormalisedEventIterator* it);
101 
113 
127 
143  AP_bool (*next)(struct AP_NormalisedEventIterator* it);
144 
159  AP_bool (*back)(struct AP_NormalisedEventIterator* it);
160 };
161 
162 
181 
185  void* reserved;
186 
192 
193 };
195 
196 
206 AP_IAFCORE_API void AP_IAFCORE_CALL AP_NormalisedEventIterator_dtor(AP_NormalisedEventIterator* it);
207 
208 
225 
235  AP_uint32 (*size)(struct AP_NormalisedEvent* event);
236 
245  AP_bool (*empty)(struct AP_NormalisedEvent* event);
246 
262 
280 
289  void (*remove)(struct AP_NormalisedEvent* event, AP_NormalisedEventKey key);
290 
304 
313  void (*removeAll)(struct AP_NormalisedEvent* event);
314 
325  AP_bool (*exists)(struct AP_NormalisedEvent* event, AP_NormalisedEventKey key);
326 
339 
354 
371 
388 
402 
416 
427  AP_char8* (*toString)(struct AP_NormalisedEvent* event);
428 
429 
439  void (*char8free)(AP_char8* string);
440 
441 };
442 
443 
456 
460  void* reserved;
461 
467 
468 };
470 
471 
472 /*
473  * AP_NormalisedEvent_globalInit
474  *
475  * Initialisation function used internally by the IAF. User code should *not*
476  * call this function under any circumstances.
477  */
478 AP_IAFCORE_API void AP_IAFCORE_CALL AP_NormalisedEvent_globalInit();
479 
480 
489 AP_IAFCORE_API AP_NormalisedEvent* AP_IAFCORE_CALL AP_NormalisedEvent_ctor();
490 
491 
502 AP_IAFCORE_API AP_NormalisedEvent* AP_IAFCORE_CALL AP_NormalisedEvent_copy(AP_NormalisedEvent* old);
503 
504 
513 AP_IAFCORE_API void AP_IAFCORE_CALL AP_NormalisedEvent_dtor(AP_NormalisedEvent* event);
514 
515 
516 #ifdef __cplusplus
517 } /* extern "C" */
518 #endif /* __cplusplus */
519 
520 
521 #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:126
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:289
AP_NormalisedEventKey(* key)(struct AP_NormalisedEventIterator *it)
key
Definition: NormalisedEvent.h:112
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:235
struct AP_NormalisedEventIterator_Functions * functions
Function table of iterator operations.
Definition: NormalisedEvent.h:191
AP_NormalisedEventIterator_Functions.
Definition: NormalisedEvent.h:87
AP_NormalisedEventValue(* findValueAndRemove)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
findValueAndRemove
Definition: NormalisedEvent.h:370
void(* removeAll)(struct AP_NormalisedEvent *event)
removeAll
Definition: NormalisedEvent.h:313
AP_bool(* back)(struct AP_NormalisedEventIterator *it)
back Move the iterator to the previous element of the underlying normalised event instance.
Definition: NormalisedEvent.h:159
void * reserved
Pointer to private internal data.
Definition: NormalisedEvent.h:185
void(* char8free)(AP_char8 *string)
char8free
Definition: NormalisedEvent.h:439
AP_bool(* exists)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
exists
Definition: NormalisedEvent.h:325
struct AP_NormalisedEvent_Functions * functions
Function table of internal operations on the event object.
Definition: NormalisedEvent.h:466
void * reserved
Pointer to private internal data.
Definition: NormalisedEvent.h:460
AP_NormalisedEventIterator.
Definition: NormalisedEvent.h:180
AP_NormalisedEvent.
Definition: NormalisedEvent.h:455
void(* addQuick)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_NormalisedEventValue value)
addQuick
Definition: NormalisedEvent.h:279
AP_NormalisedEventValue(* findValueAndRemove2)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_bool *existed)
findValueAndRemove2
Definition: NormalisedEvent.h:387
const AP_char8 * AP_NormalisedEventValue
Event field values are NUL-terminated C character strings.
Definition: NormalisedEvent.h:70
AP_bool(* empty)(struct AP_NormalisedEvent *event)
empty
Definition: NormalisedEvent.h:245
const AP_char8 * AP_NormalisedEventKey
Event field names (keys) are NUL-terminated C character strings.
Definition: NormalisedEvent.h:58
AP_bool(* next)(struct AP_NormalisedEventIterator *it)
next
Definition: NormalisedEvent.h:143
AP_bool(* valid)(struct AP_NormalisedEventIterator *it)
valid
Definition: NormalisedEvent.h:100
AP_NormalisedEvent_Functions.
Definition: NormalisedEvent.h:224
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:353
void(* replace)(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_NormalisedEventValue newValue)
replace
Definition: NormalisedEvent.h:303