29 #ifndef CORRELATOR_PLUGIN_H
30 #define CORRELATOR_PLUGIN_H
34 #include <AP_Platform.h>
74 #define AP_CORRELATOR_PLUGIN_VERSION 0x00090000
86 AP_PLUGIN_SERIALISATION_EXCEPTION
104 struct AP_PluginCorrelatorInterface_Stubs;
105 struct AP_PluginContext_Stubs;
106 struct AP_PluginType_Stubs;
107 struct AP_PluginChunk_Stubs;
108 struct AP_PluginTypeList_Stubs;
110 typedef struct AP_PluginCorrelatorInterface_Stubs AP_PluginCorrelatorInterface;
111 typedef struct AP_PluginContext_Stubs AP_PluginContext;
112 typedef struct AP_PluginType_Stubs AP_PluginType;
113 typedef struct AP_PluginChunk_Stubs AP_PluginChunk;
114 typedef struct AP_PluginTypeList_Stubs AP_PluginTypeList;
135 void (AP_PLUGIN_CALL* sendEvent)(AP_PluginCorrelatorInterface* _interface,
const char* event);
146 void (AP_PLUGIN_CALL* sendEventTo)(AP_PluginCorrelatorInterface* _interface,
const char* event, AP_uint64 targetCtx, AP_uint64 sourceCtx);
159 struct AP_PluginCorrelatorInterface_Stubs {
163 void sendEvent(
char* event) {
167 void sendEvent(
char* event, AP_uint64 targetCtx, AP_uint64 sourceCtx) {
168 api.
functions->sendEventTo(
this, event, targetCtx, sourceCtx);
179 AP_uint32 (AP_PLUGIN_CALL* version)(
const AP_PluginContext* ctx);
192 void (AP_PLUGIN_CALL* deleteChunk)(
const AP_PluginContext* ctx, AP_PluginChunk* chunk);
194 AP_bool (AP_PLUGIN_CALL* checkException)(
const AP_PluginContext* ctx);
200 void (AP_PLUGIN_CALL* clearException)(
const AP_PluginContext* ctx);
204 AP_PluginCorrelatorInterface* (AP_PLUGIN_CALL*
getCorrelator)(
const AP_PluginContext* ctx);
209 void (AP_PLUGIN_CALL*
char8free)(AP_char8* ptr);
214 AP_uint64 (AP_PLUGIN_CALL* getContextId)(
const AP_PluginContext* ctx);
222 const void* reserved;
227 struct AP_PluginContext_Stubs {
231 AP_uint32 version()
const {
239 void deleteChunk(AP_PluginChunk* chunk)
const {
243 AP_bool checkException()
const {
244 return api.
functions->checkException(
this);
248 return api.
functions->getExceptionType(
this);
251 const AP_char8* getExceptionMessage()
const {
255 void clearException()
const {
259 const AP_PluginCorrelatorInterface* getCorrelator()
const{
267 AP_uint64 getContextId()
const{
268 return api.
functions->getContextId(
this);
278 void* (AP_PLUGIN_CALL*
getUserData)(
const AP_PluginChunk* chunk);
284 void (AP_PLUGIN_CALL* setUserData)(AP_PluginChunk* chunk,
void* userData);
294 void (AP_PLUGIN_CALL* freeUserData)(AP_PluginChunk* chunk);
296 void* (AP_PLUGIN_CALL*
copyUserData)(
const AP_PluginChunk* chunk);
311 struct AP_PluginChunk_Stubs {
315 void* getUserData()
const {
319 void setUserData(
void* userData) {
320 api.
functions->setUserData(
this, userData);
323 void freeUserData() {
327 void* copyUserData() {
342 AP_PluginChunk* (AP_PLUGIN_CALL*
getChunkValue)(
const AP_PluginType* obj);
351 void (AP_PLUGIN_CALL* setChunkValue)(
const AP_PluginType* obj, AP_PluginChunk* val);
354 AP_int64 (AP_PLUGIN_CALL* getIntegerValue)(
const AP_PluginType* obj);
356 void (AP_PLUGIN_CALL* setIntegerValue)(AP_PluginType* obj,
AP_int64 val);
359 AP_float64 (AP_PLUGIN_CALL* getFloatValue)(
const AP_PluginType* obj);
361 void (AP_PLUGIN_CALL* setFloatValue)(AP_PluginType* obj,
AP_float64 val);
364 AP_decimal (AP_PLUGIN_CALL* getDecimalValue)(
const AP_PluginType* obj);
366 void (AP_PLUGIN_CALL* setDecimalValue)(AP_PluginType* obj,
AP_decimal val);
369 AP_bool (AP_PLUGIN_CALL* getBooleanValue)(
const AP_PluginType* obj);
371 void (AP_PLUGIN_CALL* setBooleanValue)(AP_PluginType* obj,
AP_bool val);
374 const AP_char8* (AP_PLUGIN_CALL*
getStringValue)(
const AP_PluginType* obj);
379 void (AP_PLUGIN_CALL* setStringValue)(AP_PluginType* obj,
const AP_char8* val);
382 AP_uint32 (AP_PLUGIN_CALL* getSequenceLength)(
const AP_PluginType* obj);
390 void (AP_PLUGIN_CALL* setSequenceLength)(
const AP_PluginType* obj,
AP_uint32 len);
411 void (AP_PLUGIN_CALL *copyFrom)(
const AP_PluginType *obj,
const AP_PluginType *other);
428 void (AP_PLUGIN_CALL* releaseSequenceElements)(
const AP_PluginType* obj);
449 void (AP_PLUGIN_CALL* releaseChunkSequenceElements)(
const AP_PluginType* obj);
466 void (AP_PLUGIN_CALL* releaseIntegerSequenceElements)(
const AP_PluginType* obj);
483 void (AP_PLUGIN_CALL* releaseFloatSequenceElements)(
const AP_PluginType* obj);
500 void (AP_PLUGIN_CALL* releaseDecimalSequenceElements)(
const AP_PluginType* obj);
517 void (AP_PLUGIN_CALL* releaseBooleanSequenceElements)(
const AP_PluginType* obj);
544 void (AP_PLUGIN_CALL* releaseStringSequenceElements)(
const AP_PluginType* obj);
557 struct AP_PluginType_Stubs {
562 return api.
functions->getDiscriminator(
this);
565 AP_PluginChunk* getChunkValue()
const {
569 void setChunkValue(AP_PluginChunk* val)
const {
573 AP_int64 getIntegerValue()
const {
574 return api.
functions->getIntegerValue(
this);
577 void setIntegerValue(AP_int64 val) {
578 api.
functions->setIntegerValue(
this, val);
581 AP_float64 getFloatValue()
const {
582 return api.
functions->getFloatValue(
this);
585 void setFloatValue(AP_float64 val) {
589 AP_decimal getDecimalValue()
const {
590 return api.
functions->getDecimalValue(
this);
593 void setDecimalValue(AP_decimal val) {
594 api.
functions->setDecimalValue(
this, val);
597 AP_bool getBooleanValue()
const {
598 return api.
functions->getBooleanValue(
this);
601 void setBooleanValue(AP_bool val) {
602 api.
functions->setBooleanValue(
this, val);
605 const AP_char8* getStringValue()
const {
609 void setStringValue(
const AP_char8* val) {
610 api.
functions->setStringValue(
this, val);
613 AP_uint32 getSequenceLength()
const {
614 return api.
functions->getSequenceLength(
this);
618 return api.
functions->getSequenceType(
this);
621 AP_PluginType* getSequenceElement(AP_uint32 index)
const {
625 void copyFrom(
const AP_PluginType *other) {
626 return api.
functions->copyFrom(
this, other);
629 AP_PluginType*
const *getSequenceElements(AP_uint32 start = 0, AP_uint32 length = ~0U)
const {
633 void releaseSequenceElements()
const {
634 api.
functions->releaseSequenceElements(
this);
637 AP_PluginChunk*
const * getChunkSequenceElements(AP_uint32 start = 0, AP_uint32 length = ~0U)
const {
641 void releaseChunkSequenceElements()
const {
642 api.
functions->releaseChunkSequenceElements(
this);
645 AP_int64* getIntegerSequenceElements(AP_uint32 start = 0, AP_uint32 length = ~0U)
const {
649 void releaseIntegerSequenceElements()
const {
650 api.
functions->releaseIntegerSequenceElements(
this);
653 AP_float64* getFloatSequenceElements(AP_uint32 start = 0, AP_uint32 length = ~0U)
const {
657 void releaseFloatSequenceElements()
const {
658 api.
functions->releaseFloatSequenceElements(
this);
661 AP_decimal* getDecimalSequenceElements(AP_uint32 start = 0, AP_uint32 length = ~0U)
const {
665 void releaseDecimalSequenceElements()
const {
666 api.
functions->releaseDecimalSequenceElements(
this);
669 AP_bool* getBooleanSequenceElements(AP_uint32 start = 0, AP_uint32 length = ~0U)
const {
673 void releaseBooleanSequenceElements()
const {
674 api.
functions->releaseBooleanSequenceElements(
this);
677 const AP_char8** getStringSequenceElements(AP_uint32 start = 0, AP_uint32 length = ~0U)
const {
681 void releaseStringSequenceElements()
const {
682 api.
functions->releaseStringSequenceElements(
this);
695 AP_uint32 (AP_PLUGIN_CALL* getSize)(
const AP_PluginTypeList* list);
697 AP_bool (AP_PLUGIN_CALL* isEmpty)(
const AP_PluginTypeList* list);
699 const AP_PluginType* (AP_PLUGIN_CALL*
getElement)(
const AP_PluginTypeList* list,
AP_uint32 index);
712 struct AP_PluginTypeList_Stubs {
716 AP_uint32 getSize()
const {
720 AP_bool isEmpty()
const {
724 const AP_PluginType* getElement(AP_uint32 index)
const {
856 typedef AP_PLUGIN_DLL_SYM
AP_ErrorCode (AP_PLUGIN_CALL* AP_PluginThreadEndedFunctionPtr) (
const AP_PluginContext* ctx);
AP_TypeList.
Definition: correlator_plugin.h:705
const AP_char8 *AP_PLUGIN_CALL * getExceptionMessage(const AP_PluginContext *ctx)
Returns the message of the most recent exception.
void *AP_PLUGIN_CALL * copyUserData(const AP_PluginChunk *chunk)
return a copy of the user data
AP_PluginCorrelatorInterface *AP_PLUGIN_CALL * getCorrelator(const AP_PluginContext *ctx)
Return the correlator implementation.
CorrelatorInterface.
Definition: correlator_plugin.h:152
AP_uint32(AP_PLUGIN_CALL *getSequenceLength)(const AP_PluginType *obj)
Get the number of elements in a sequence object.
AP_bool(AP_PLUGIN_CALL *checkException)(const AP_PluginContext *ctx)
Returns true if an exception has occurred since the last time that clearException was called...
AP_Capabilities
Plugin capabilities.
Definition: AP_PluginCommon.h:86
void(AP_PLUGIN_CALL * AP_PluginFunctionPtr)(const AP_PluginContext *ctx, const AP_PluginTypeList *args, AP_PluginType *rval, AP_TypeDiscriminator rtype)
Type of a plugin function.
Definition: correlator_plugin.h:739
CorrelatorInterface function API.
Definition: correlator_plugin.h:126
AP_TypeList function API.
Definition: correlator_plugin.h:692
const struct AP_PluginTypeList_Functions * functions
Pointer to function API.
Definition: correlator_plugin.h:709
AP_int64 *AP_PLUGIN_CALL * getIntegerSequenceElements(const AP_PluginType *obj, AP_uint32 start, AP_uint32 length)
Generate an array of integers encapsulating elements [start..start+length-1] of the sequence object...
AP_PluginType *const *AP_PLUGIN_CALL * getSequenceElements(const AP_PluginType *obj, AP_uint32 start, AP_uint32 length)
Generate an array of pointers to AP_Type objects, encapsulating elements [start..start+length-1] of t...
AP_PluginType *AP_PLUGIN_CALL * getSequenceElement(const AP_PluginType *obj, AP_uint32 index)
Get a pointer to a single sequence element.
Incorrect type.
Definition: correlator_plugin.h:81
Generic exception.
Definition: correlator_plugin.h:79
AP_decimal *AP_PLUGIN_CALL * getDecimalSequenceElements(const AP_PluginType *obj, AP_uint32 start, AP_uint32 length)
Generate an array of decimals encapsulating elements [start..start+length-1] of the sequence object...
AP_uint32(AP_PLUGIN_CALL *getSize)(const AP_PluginTypeList *list)
Return the number of objects in the list.
const AP_char8 * returnType
Return type.
Definition: correlator_plugin.h:763
const AP_char8 *AP_PLUGIN_CALL * getStringValue(const AP_PluginType *obj)
Get the string value of the object.
AP_uint64(AP_PLUGIN_CALL *getContextId)(const AP_PluginContext *ctx)
Return the identifier of the EPL (parallelism) context associated with this plugin execution context...
const struct AP_PluginType_Functions * functions
Pointer to function API.
Definition: correlator_plugin.h:554
PluginChunk function API.
Definition: correlator_plugin.h:275
AP_TypeDiscriminator
A typed discriminator for the contents of an AP_Type object.
Definition: AP_PluginCommon.h:47
PluginContext.
Definition: correlator_plugin.h:220
AP_PLUGIN_DLL_SYM AP_ErrorCode(AP_PLUGIN_CALL * AP_PluginShutdownFunctionPtr)(const AP_PluginContext *ctx)
Pointer to a plugin library shutdown function.
Definition: correlator_plugin.h:801
AP_PluginFunctionPtr fptr
Pointer to function implementation.
Definition: correlator_plugin.h:754
Shared definitions for the C and C++ plugin APIs.
AP_uint32 nParams
Argument count.
Definition: correlator_plugin.h:757
AP_float64(AP_PLUGIN_CALL *getFloatValue)(const AP_PluginType *obj)
Get the float value of the object.
AP_Type function API.
Definition: correlator_plugin.h:336
const struct AP_PluginChunk_Functions * functions
Pointer to function API.
Definition: correlator_plugin.h:306
PluginChunk.
Definition: correlator_plugin.h:302
const struct AP_PluginChunk_Callbacks * callbacks
Pointer to the user callbacks for this chunk.
Definition: correlator_plugin.h:308
void(AP_PLUGIN_CALL *sendEvent)(AP_PluginCorrelatorInterface *_interface
Send an event to the correlator.
PluginChunk callback API.
Definition: correlator_plugin.h:291
const AP_char8 **AP_PLUGIN_CALL * getStringSequenceElements(const AP_PluginType *obj, AP_uint32 start, AP_uint32 length)
Generate an array of string pointers encapsulating elements [start..start+length-1] of the sequence o...
const AP_char8 ** paramTypes
Argument types - nParams elements, unterminated.
Definition: correlator_plugin.h:760
AP_float64 *AP_PLUGIN_CALL * getFloatSequenceElements(const AP_PluginType *obj, AP_uint32 start, AP_uint32 length)
Generate an array of floats encapsulating elements [start..start+length-1] of the sequence object...
const struct AP_PluginCorrelatorInterface_Functions * functions
Pointer to the function API.
Definition: correlator_plugin.h:156
const AP_PluginType *AP_PLUGIN_CALL * getElement(const AP_PluginTypeList *list, AP_uint32 index)
Return a pointer to an element of the list.
AP_TypeDiscriminator(AP_PLUGIN_CALL *getDiscriminator)(const AP_PluginType *obj)
Return the type contained in this object.
AP_CorrelatorPluginExceptionType
Typed differentiator for different exceptions in the plugin interface.
Definition: correlator_plugin.h:77
AP_decimal(AP_PLUGIN_CALL *getDecimalValue)(const AP_PluginType *obj)
Get the decimal value of the object.
AP_int64(AP_PLUGIN_CALL *getIntegerValue)(const AP_PluginType *obj)
Get the integer value of the object.
void *AP_PLUGIN_CALL * getUserData(const AP_PluginChunk *chunk)
Return the user data stored in this chunk.
AP_PluginChunk *AP_PLUGIN_CALL * createChunk(const AP_PluginContext *ctx, const struct AP_PluginChunk_Callbacks *callbacks, void *userData)
Create a chunk.
AP_CorrelatorPluginExceptionType(AP_PLUGIN_CALL *getExceptionType)(const AP_PluginContext *ctx)
Returns the type of the most recent exception.
const struct AP_PluginContext_Functions * functions
Pointer to the function API.
Definition: correlator_plugin.h:224
const AP_char8 * name
Function name.
Definition: correlator_plugin.h:751
Out of bands.
Definition: correlator_plugin.h:85
PluginContext function API.
Definition: correlator_plugin.h:176
AP_bool(AP_PLUGIN_CALL *getBooleanValue)(const AP_PluginType *obj)
Get the boolean value of the object.
AP_PLUGIN_DLL_SYM AP_ErrorCode(AP_PLUGIN_CALL * AP_PluginVersionFunctionPtr)(const AP_PluginContext *ctx, AP_uint32 *version)
Type of a plugin library version function.
Definition: correlator_plugin.h:821
AP_PluginChunk *const *AP_PLUGIN_CALL * getChunkSequenceElements(const AP_PluginType *obj, AP_uint32 start, AP_uint32 length)
Generate an array of pointers to chunks encapsulating elements [start..start+length-1] of the sequenc...
void(AP_PLUGIN_CALL *freeUserData)(AP_PluginChunk *chunk)
Free the specified user data.
AP_PLUGIN_DLL_SYM AP_ErrorCode(AP_PLUGIN_CALL *AP_PluginThreadEndedFunctionPtr)(const AP_PluginContext *ctx)
Type of a plugin library thread ended function.
Definition: correlator_plugin.h:856
AP_ENGINE_CLIENT_API void char8free(char *string)
Free any char* string returned from the client API.
AP_PLUGIN_DLL_SYM AP_ErrorCode(AP_PLUGIN_CALL * AP_PluginInitFunctionPtr)(const AP_PluginContext *ctx, AP_uint32 *version, AP_uint32 *nFunctions, AP_PluginFunction **functions)
Type of a plugin library initialisation function.
Definition: correlator_plugin.h:791
AP_bool *AP_PLUGIN_CALL * getBooleanSequenceElements(const AP_PluginType *obj, AP_uint32 start, AP_uint32 length)
Generate an array of booleans encapsulating elements [start..start+length-1] of the sequence object...
AP_PLUGIN_DLL_SYM AP_Capabilities(AP_PLUGIN_CALL * AP_PluginGetCapabilitiesFunctionPtr)(const AP_PluginContext *ctx)
Type of a plugin capability function.
Definition: correlator_plugin.h:839
Plugin function descriptor.
Definition: correlator_plugin.h:748
AP_uint32(AP_PLUGIN_CALL *version)(const AP_PluginContext *ctx)
Return active plugin API version.
AP_Type.
Definition: correlator_plugin.h:550
void(AP_PLUGIN_CALL *setChunkValue)(const AP_PluginType *obj
Set the chunk value of the object.
Unimplemented method.
Definition: correlator_plugin.h:83
AP_bool(AP_PLUGIN_CALL *isEmpty)(const AP_PluginTypeList *list)
Return true iff size() == 0.
AP_PluginChunk *AP_PLUGIN_CALL * getChunkValue(const AP_PluginType *obj)
Get the chunk value of the object.