Apama  10.15.1.2
AP_NormalisedEvent_Functions Struct Reference

AP_NormalisedEvent_Functions. More...

#include <NormalisedEvent.h>

Public Attributes

AP_uint32(* size )(struct AP_NormalisedEvent *event)
 size More...
 
AP_bool(* empty )(struct AP_NormalisedEvent *event)
 empty More...
 
AP_NormalisedEventIterator *(* add )(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_NormalisedEventValue value)
 add More...
 
void(* addQuick )(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_NormalisedEventValue value)
 addQuick More...
 
void(* remove )(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
 remove More...
 
void(* replace )(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_NormalisedEventValue newValue)
 replace More...
 
void(* removeAll )(struct AP_NormalisedEvent *event)
 removeAll More...
 
AP_bool(* exists )(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
 exists More...
 
AP_NormalisedEventIterator *(* find )(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
 find More...
 
AP_NormalisedEventValue(* findValue )(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
 findValue More...
 
AP_NormalisedEventValue(* findValueAndRemove )(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)
 findValueAndRemove More...
 
AP_NormalisedEventValue(* findValueAndRemove2 )(struct AP_NormalisedEvent *event, AP_NormalisedEventKey key, AP_bool *existed)
 findValueAndRemove2 More...
 
AP_NormalisedEventIterator *(* first )(struct AP_NormalisedEvent *event)
 first More...
 
AP_NormalisedEventIterator *(* last )(struct AP_NormalisedEvent *event)
 last More...
 
AP_char8 *(* toString )(struct AP_NormalisedEvent *event)
 toString More...
 
void(* char8free )(AP_char8 *string)
 char8free More...
 

Detailed Description

AP_NormalisedEvent_Functions.

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.

Member Data Documentation

◆ add

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.

Parameters
eventThe normalised event instance
keyThe name of the new element
valuethe value of the new element
Returns
An iterator pointing to the new element, or NULL if the element was not added (typically because the name already existed). Must be explicitly deleted by the caller after use.

◆ addQuick

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.

Parameters
eventThe normalised event instance
keyThe name of the new element
valueThe value of the new element

◆ char8free

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.

Parameters
stringThe object to be freed

◆ empty

AP_bool(* AP_NormalisedEvent_Functions::empty) (struct AP_NormalisedEvent *event)

empty

Check whether the event is empty or not

Parameters
eventThe normalised event instance
Returns
AP_TRUE if the event has zero elements, AP_FALSE otherwise

◆ exists

AP_bool(* AP_NormalisedEvent_Functions::exists) (struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)

exists

Check whether a given element exists in the normalised event.

Parameters
eventThe normalised event instance
keyThe element name to search for
Returns
AP_TRUE if an element with the given name exists in the normalised event, AP_FALSE otherwise.

◆ find

AP_NormalisedEventIterator*(* AP_NormalisedEvent_Functions::find) (struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)

find

Search for a named element in the normalised event.

Parameters
eventThe normalised event instance
keyThe element name to search for
Returns
An iterator pointing to the element with the given name, or NULL if no matching element could be found. Must be explicitly deleted by the caller after use.

◆ findValue

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.

Parameters
eventThe normalised event instance
keyThe element name to search for
Returns
The value associated with the given name, or NULL if no matching element could be found. Note that this function cannot distinguish between an element with a missing value and an element that does not exist - NULL will be returned in either case.

◆ findValueAndRemove

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.

Parameters
eventThe normalised event instance
keyThe element name to search for
Returns
The value associated with the given name, or NULL if no matching element could be found. If the element was found, it will be deleted from the event. Note that this function cannot distinguish between an element with a missing value and an element that does not exist - NULL will be returned in either case. The returned object (if any) must be explicitly deleted by the caller after use.

◆ findValueAndRemove2

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.

Parameters
eventThe normalised event instance
keyThe element name to search for
existedOut parameter that will be set to AP_TRUE if the named element was found and deleted.
Returns
The value associated with the given name, or NULL if no matching element could be found. If the element was found, it will be deleted from the event. The returned object (if any) must be explicitly deleted by the caller after use.

◆ first

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.

Parameters
eventThe normalised event instance
Returns
An iterator pointing to the first element of the event, or NULL if the event has no elements. Must be explicitly deleted by the caller after use.

◆ last

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.

Parameters
eventThe normalised event instance
Returns
An iterator pointing to the last element of the event, or NULL if the event has no elements. Must be explicitly deleted by the caller after use.

◆ remove

void(* AP_NormalisedEvent_Functions::remove) (struct AP_NormalisedEvent *event, AP_NormalisedEventKey key)

remove

Remove the named element from the normalised event.

Parameters
eventThe normalised event instance
keyThe name of the element to be removed

◆ removeAll

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.

Parameters
eventThe normalised event instance

◆ replace

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.

Parameters
eventThe normalisedEvent instance
keyThe name of the element to be updated
valueThe new value for the named element

◆ size

AP_uint32(* AP_NormalisedEvent_Functions::size) (struct AP_NormalisedEvent *event)

size

Get the number of elements (name-value pairs) currently stored by the event.

Parameters
eventThe normalised event instance
Returns
The number of elements in the event

◆ toString

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.

Parameters
eventThe normalised event instance
Returns
Printable string representation of the event

The documentation for this struct was generated from the following file: