Apama
10.15.0.2
|
AP_NormalisedEvent_Functions. More...
#include <NormalisedEvent.h>
Table of client visible functions exported by a normalised event instance. These are the only operations that may be performed by users of the event object.
Note that all of these functions take an initial AP_NormalisedEvent* argument; this is analogous to the (hidden) 'this' pointer passed to a C++ object when a member function is invoked on it.
For all functions that return a NormalisedEventValue pointer, the string pointed to by that pointer is valid until the NormalisedEvent is destroyed or an operation that changes the NormalisedEvent is called.
AP_NormalisedEventIterator*(* AP_NormalisedEvent_Functions::add) (struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_NormalisedEventValue value) |
add
Add a new name-value pair to the event. The given name and value will be copied into the event. If an element with the same name already exists, it will NOT be overwritten.
event | The normalised event instance |
key | The name of the new element |
value | the value of the new element |
void(* AP_NormalisedEvent_Functions::addQuick) (struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_NormalisedEventValue value) |
addQuick
Add a new name-value pair to the event. The given name and value will be copied into the event. If an element with the same name already exists, it will NOT be overwritten.
This function is faster and more memory-efficient than add(), since it does not bother creating an iterator. However, you have no way of knowing whether the element was actually added or not, other than searching for the name and checking the stored value.
event | The normalised event instance |
key | The name of the new element |
value | The value of the new element |
void(* AP_NormalisedEvent_Functions::char8free) (AP_char8 *string) |
char8free
Free a dynamically-allocated AP_char8* string, such as that returned by the toString() function. It should NOT be used to free arbitrary objects allocated by user code.
string | The object to be freed |
AP_bool(* AP_NormalisedEvent_Functions::empty) (struct AP_NormalisedEvent *event) |
empty
Check whether the event is empty or not
event | The normalised event instance |
AP_bool(* AP_NormalisedEvent_Functions::exists) (struct AP_NormalisedEvent *event, AP_NormalisedEventKey key) |
exists
Check whether a given element exists in the normalised event.
event | The normalised event instance |
key | The element name to search for |
AP_NormalisedEventIterator*(* AP_NormalisedEvent_Functions::find) (struct AP_NormalisedEvent *event, AP_NormalisedEventKey key) |
find
Search for a named element in the normalised event.
event | The normalised event instance |
key | The element name to search for |
AP_NormalisedEventValue(* AP_NormalisedEvent_Functions::findValue) (struct AP_NormalisedEvent *event, AP_NormalisedEventKey key) |
findValue
Search for a named element in the normalised event and return its value.
event | The normalised event instance |
key | The element name to search for |
AP_NormalisedEventValue(* AP_NormalisedEvent_Functions::findValueAndRemove) (struct AP_NormalisedEvent *event, AP_NormalisedEventKey key) |
findValueAndRemove
Search for a named element in the normalised event and return its value. If found, the element will also be removed from the event.
event | The normalised event instance |
key | The element name to search for |
AP_NormalisedEventValue(* AP_NormalisedEvent_Functions::findValueAndRemove2) (struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_bool *existed) |
findValueAndRemove2
Search for a named element in the normalised event and return its value. If found, the element will also be removed from the event.
event | The normalised event instance |
key | The element name to search for |
existed | Out parameter that will be set to AP_TRUE if the named element was found and deleted. |
AP_NormalisedEventIterator*(* AP_NormalisedEvent_Functions::first) (struct AP_NormalisedEvent *event) |
first
Return an iterator pointing to the first element of the normalised event. Successive calls to the next() function of the returned iterator will allow you to visit all the elements of the event.
event | The normalised event instance |
AP_NormalisedEventIterator*(* AP_NormalisedEvent_Functions::last) (struct AP_NormalisedEvent *event) |
last
Return an iterator pointing to the last element of the normalised event. Successive calls to the back() function of the returned iterator will allow you to visit all the elements of the event.
event | The normalised event instance |
void(* AP_NormalisedEvent_Functions::remove) (struct AP_NormalisedEvent *event, AP_NormalisedEventKey key) |
remove
Remove the named element from the normalised event.
event | The normalised event instance |
key | The name of the element to be removed |
void(* AP_NormalisedEvent_Functions::removeAll) (struct AP_NormalisedEvent *event) |
removeAll
Remove all elements from the normalised event. The empty() function will return AP_TRUE after this function has been called.
event | The normalised event instance |
void(* AP_NormalisedEvent_Functions::replace) (struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_NormalisedEventValue newValue) |
replace
Change the value of a named element in the normalised event. If an element with the given name already exists, its value will be replaced with a copy of the given value. Otherwise, a new element is created just as though addQuick() had been called.
event | The normalisedEvent instance |
key | The name of the element to be updated |
value | The new value for the named element |
AP_uint32(* AP_NormalisedEvent_Functions::size) (struct AP_NormalisedEvent *event) |
size
Get the number of elements (name-value pairs) currently stored by the event.
event | The normalised event instance |
AP_char8*(* AP_NormalisedEvent_Functions::toString) (struct AP_NormalisedEvent *event) |
toString
Return a printable string representation of the normalised event. The returned string is owned by the caller and should be freed when it is no longer required using the char8free function.
event | The normalised event instance |