Apama  9.10.0.4.289795
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
AP_Context Class Referenceabstract

Execution context for a library function call. More...

#include <correlator_plugin.hpp>

Inherits NoContext public AP_Context.

Public Member Functions

virtual ~AP_Context ()
 Destructor. More...
 
virtual uint32 version () const =0
 Return active plugin API version. More...
 
virtual char8 * char8alloc (size_t len) const =0
 Allocate storage for an 8-bit string value. More...
 
virtual char8 * char8dup (const char8 *s) const =0
 Duplicate a string value created using char8alloc(). More...
 
virtual void char8free (char8 *s) const =0
 Free the memory occupied by a string created using char8alloc() or char8dup(). More...
 
virtual AP_CorrelatorInterfacegetCorrelator () const =0
 Return the correlator implementation. More...
 
virtual AP_uint64 getContextId () const =0
 Return the identifier of the EPL (parallelism) context associated with this plugin execution context. More...
 
virtual void pluginNowBlocking () const =0
 Called by the plugin when it performs a potentially blocking operation. More...
 

Detailed Description

Execution context for a library function call.

For passing to a function that needs to take an AP_Context& from a plugin thread that doesn't have an AP_Context.

Note that the plugin 'execution context' is not the same as the concept of 'contexts' in EPL, which are used to provide parallelism, despite the name being the same. However each AP_Context plugin execution context provides a getContextId() method for getting the EPL context from which the plugin is being invoked.

AP_Context holds per-call Engine-internal data and provides various utility functions to plugins.

Note that the implementation of the AP_Context member functions is internal to the Engine. One consequence of this is that plugins cannot create a useful instance of this class themselves; the only valid AP_Context objects are those passed in to a plugin function by the Engine.

Provides dummy do-nothing methods for all the methods on AP_Context.

Constructor & Destructor Documentation

virtual AP_Context::~AP_Context ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual char8* AP_Context::char8alloc ( size_t  len) const
pure virtual

Allocate storage for an 8-bit string value.

The memory will be allocated by the Engine and must only be freed using the char8free() function. These functions should be used for any string data that may need to be copied or otherwise manipulated by the Engine; in particular, strings within chunk objects that the Engine may be required to (de)serialise.

Parameters
lenThe length of the string buffer. Must be sufficient to cover any terminators or other special characters to be included in the string.
Returns
Pointer to a memory block of at least len bytes.
virtual char8* AP_Context::char8dup ( const char8 *  s) const
pure virtual

Duplicate a string value created using char8alloc().

This function allocates a memory block of sufficient size and copies the contents of the source string into it. The returned string must only be freed using char8free().

Parameters
sThe source string to be copied. Must have been created with char8alloc().
Returns
Pointer to a copy of the source string.
virtual void AP_Context::char8free ( char8 *  s) const
pure virtual

Free the memory occupied by a string created using char8alloc() or char8dup().

The source string pointer is invalid after this function returns. This function must not be used to free any object that was not allocated by char8alloc() or char8dup().

Parameters
sThe source string to be freed.
virtual AP_uint64 AP_Context::getContextId ( ) const
pure virtual

Return the identifier of the EPL (parallelism) context associated with this plugin execution context.

virtual AP_CorrelatorInterface* AP_Context::getCorrelator ( ) const
pure virtual

Return the correlator implementation.

virtual void AP_Context::pluginNowBlocking ( ) const
pure virtual

Called by the plugin when it performs a potentially blocking operation.

This form is slightly more efficient than the call on AP_CorrelatorInterface.

virtual uint32 AP_Context::version ( ) const
pure virtual

Return active plugin API version.


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