21 #ifndef CORRELATOR_PLUGIN_HPP
22 #define CORRELATOR_PLUGIN_HPP
24 #ifndef _AP_NO_DEPRECATED_PLUGINAPI_WARNING
26 #warning This API for writing EPL plugins is deprecated. Please use the API located in epl_plugin.hpp instead
28 #pragma message("correlator_plugin.hpp(0) Warning: This API for writing EPL plugins is deprecated. Please use the API located in epl_plugin.hpp instead")
32 #include <ApamaTypes.h>
33 #include <AP_Platform.h>
77 #define AP_PLUGIN_VERSION 0x00090000
80 #if (__GNUC__ > 4 || __GNUC_MINOR__ > 3 || !defined(__linux__))
81 #define _has_std_initializer_list
201 virtual uint32 version()
const = 0;
217 virtual char8* char8alloc(
size_t len)
const = 0;
230 virtual char8* char8dup(
const char8* s)
const = 0;
240 virtual void char8free(char8* s)
const = 0;
251 virtual AP_uint64 getContextId()
const = 0;
260 virtual void pluginNowBlocking()
const = 0;
280 virtual ~NoContext() {}
281 virtual uint32
version()
const {
return 0; }
282 virtual char8*
char8alloc(
size_t len)
const {
return 0; }
283 virtual char8*
char8dup(
const char8* s)
const {
return 0; }
284 virtual void char8free(char8* s)
const { }
304 typedef std::shared_ptr<AP_EventHandlerInterface>
ptr_t;
355 virtual void sendEvent(
const char* event) = 0;
371 virtual void sendEventTo(
const char* event, AP_uint64 targetContext, AP_uint64 sourceContext) = 0;
395 virtual void sendEventTo(
const char *event,
const char *targetChannel,
const AP_Context &source) = 0;
396 #ifdef _has_std_initializer_list
444 template<
typename ITER>
470 #ifdef _has_std_initializer_list
514 template<
typename ITER>
558 template<
typename ITER>
561 for (ITER it = start; it != end; ++it) {
562 subscribe_impl(handler, (
char const *
const *) &(*it), (
char const *
const *) &(*it) + 1);
570 template<
typename ITER>
573 for (ITER it = start; it != end; ++it) {
574 unsubscribe_impl(handler, (
char const *
const *) &(*it), (
char const *
const *) &(*it) + 1);
764 template <
typename FN>
925 operator int64()
const {
938 operator float64()
const {
951 operator AP_decimal()
const {
964 operator bool()
const {
977 operator const char8*()
const {
1008 virtual void operator()(
AP_Type &)
const =0;
1018 template <
typename FN>
1021 explicit Wrap(
const FN &fn) : fn(fn) {}
1022 void operator()(
AP_Type &arg)
const { fn(arg); }
1041 : ptr(reinterpret_cast<const char *>(static_cast<const
AP_Type *>(array))),
1057 return *
reinterpret_cast<const AP_Type *
>(ptr + i*stride);
1219 #endif // CORRELATOR_PLUGIN_HPP
virtual void pluginNowBlocking() const =0
virtual const char8 ** stringSequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
Definition: correlator_plugin.hpp:192
AP_UnimplementedException(const std::string &what)
Definition: correlator_plugin.hpp:123
AP_PLUGIN_DLL_SYM AP_ErrorCode(AP_PLUGIN_CALL *AP_ThreadEndedFunctionPtr)(const AP_Context &ctx)
Definition: correlator_plugin.hpp:1217
size_t nParams
Definition: correlator_plugin.hpp:1107
virtual size_t sequenceLength() const =0
Definition: correlator_plugin.hpp:646
const char8 * returnType
Definition: correlator_plugin.hpp:1115
void subscribe(const AP_EventHandlerInterface::ptr_t &handler, std::initializer_list< const char * > channels)
Definition: correlator_plugin.hpp:412
virtual void releaseDecimalSequenceElements() const =0
virtual bool * booleanSequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
virtual void subscribe_impl(const AP_EventHandlerInterface::ptr_t &handler, char const *const *start, char const *const *end)=0
std::shared_ptr< AP_EventHandlerInterface > ptr_t
Definition: correlator_plugin.hpp:304
virtual void pluginNowBlocking() const =0
void unsubscribe(const AP_EventHandlerInterface::ptr_t &handler, const T &channel)
Definition: correlator_plugin.hpp:532
virtual AP_Chunk *const * chunkSequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
AP_FunctionPtr fptr
Definition: correlator_plugin.hpp:1103
AP_Capabilities
Definition: AP_PluginCommon.h:108
AP_PLUGIN_DLL_SYM AP_ErrorCode(AP_PLUGIN_CALL * AP_InitFunctionPtr)(const AP_Context &ctx, uint32 &version, uint32 &nFunctions, AP_Function *&functions)
Definition: correlator_plugin.hpp:1144
virtual ~AP_Context()
Definition: correlator_plugin.hpp:197
virtual AP_uint64 getContextId() const =0
virtual AP_Type & sequenceElement(size_t index) const =0
AP_Type & operator=(AP_Chunk *val)
Definition: correlator_plugin.hpp:918
void subscribe_impl(const AP_EventHandlerInterface::ptr_t &handler, const ITER &start, const ITER &end)
Definition: correlator_plugin.hpp:559
virtual bool booleanValue() const =0
virtual void sendEvent(const char *event)=0
Definition: correlator_plugin.hpp:145
virtual void releaseFloatSequenceElements() const =0
Definition: correlator_plugin.hpp:1005
virtual AP_TypeDiscriminator sequenceType() const =0
virtual void releaseBooleanSequenceElements() const =0
AP_Chunk()
Definition: correlator_plugin.hpp:630
virtual void setSequenceLength(size_t length) const =0
const AP_Type & operator[](size_t i) const
Definition: correlator_plugin.hpp:1056
virtual void releaseIntegerSequenceElements() const =0
virtual void copyFrom(const AP_Type &other)=0
void(AP_PLUGIN_CALL * AP_FunctionPtr)(const AP_Context &ctx, const AP_TypeList &args, AP_Type &rval, AP_TypeDiscriminator rtype)
Definition: correlator_plugin.hpp:1084
AP_TypeDiscriminator
Definition: AP_PluginCommon.h:56
virtual ~AP_EventHandlerInterface()
Definition: correlator_plugin.hpp:309
virtual ~AP_CorrelatorInterface()=0
virtual void releaseStringSequenceElements() const =0
virtual int64 * integerSequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
AP_Type & operator[](size_t index) const
Definition: correlator_plugin.hpp:990
virtual AP_decimal * decimalSequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
AP_BoundsException(const std::string &what)
Definition: correlator_plugin.hpp:136
Definition: correlator_plugin.hpp:294
AP_PLUGIN_DLL_SYM AP_ErrorCode(AP_PLUGIN_CALL * AP_ShutdownFunctionPtr)(const AP_Context &ctx)
Definition: correlator_plugin.hpp:1160
Definition: correlator_plugin.hpp:104
virtual char8 * char8dup(const char8 *s) const =0
AP_Type & operator=(const AP_Type &other)
Definition: correlator_plugin.hpp:996
AP_TypeException(const std::string &what)
Definition: correlator_plugin.hpp:109
Definition: correlator_plugin.hpp:118
Definition: correlator_plugin.hpp:327
void visitSequenceElements(const FN &fn, size_t start=0, size_t length=size_t(-1)) const
Definition: correlator_plugin.hpp:765
virtual char8 * char8alloc(size_t len) const =0
virtual void sendEventTo(const char *event, AP_uint64 targetContext, AP_uint64 sourceContext)=0
virtual AP_CorrelatorInterface * getCorrelator() const =0
virtual void releaseSequenceElements() const =0
virtual void unsubscribe_impl(const AP_EventHandlerInterface::ptr_t &handler, char const *const *start, char const *const *end)=0
Definition: correlator_plugin.hpp:1034
void unsubscribe_impl(const AP_EventHandlerInterface::ptr_t &handler, const ITER &start, const ITER &end)
Definition: correlator_plugin.hpp:571
void subscribe(const AP_EventHandlerInterface::ptr_t &handler, const T &channel)
Definition: correlator_plugin.hpp:466
void subscribe(const AP_EventHandlerInterface::ptr_t &handler, const ITER &start, const ITER &end)
Definition: correlator_plugin.hpp:445
virtual AP_Type *const * sequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
bool empty() const
Definition: correlator_plugin.hpp:1052
virtual void releaseChunkSequenceElements() const =0
AP_UserPluginException(const std::string &type, const std::string &what)
Definition: correlator_plugin.hpp:155
virtual float64 floatValue() const =0
Definition: correlator_plugin.hpp:588
virtual AP_Chunk * chunkValue() const =0
Definition: correlator_plugin.hpp:131
const std::string & getType() const
Definition: correlator_plugin.hpp:161
const char8 ** paramTypes
Definition: correlator_plugin.hpp:1111
virtual int64 integerValue() const =0
AP_PLUGIN_DLL_SYM AP_ErrorCode(AP_PLUGIN_CALL * AP_LibraryVersionFunctionPtr)(const AP_Context &ctx, uint32 &version)
Definition: correlator_plugin.hpp:1181
void unsubscribe(const AP_EventHandlerInterface::ptr_t &handler, std::initializer_list< const char * > channels)
Definition: correlator_plugin.hpp:484
Definition: correlator_plugin.hpp:1095
virtual AP_TypeDiscriminator discriminator() const =0
AP_PLUGIN_DLL_SYM AP_Capabilities(AP_PLUGIN_CALL * AP_GetCapabilitiesFunctionPtr)(const AP_Context &ctx)
Definition: correlator_plugin.hpp:1199
Definition: correlator_plugin.hpp:91
virtual void createSequence(AP_TypeDiscriminator inner)=0
virtual void visitSequenceElementsImpl(const ElementFn &, size_t start, size_t length) const =0
size_t size() const
Definition: correlator_plugin.hpp:1048
AP_ENGINE_CLIENT_API void char8free(char *string)
Free any char* string returned from the client API.
AP_PluginException(const std::string &what)
Definition: correlator_plugin.hpp:96
const char8 * name
Definition: correlator_plugin.hpp:1099
virtual float64 * floatSequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
virtual AP_decimal decimalValue() const =0
AP_Chunk(const AP_Context &)
Definition: correlator_plugin.hpp:624
virtual void char8free(char8 *s) const =0
AP_TypeList(const T *array, size_t n)
Definition: correlator_plugin.hpp:1040
virtual uint32 version() const =0
virtual ~AP_Chunk()
Definition: correlator_plugin.hpp:605
void unsubscribe(const AP_EventHandlerInterface::ptr_t &handler, const ITER &start, const ITER &end)
Definition: correlator_plugin.hpp:515
virtual const char8 * stringValue() const =0
virtual void handleEvent(const AP_Context &ctx, const char *event, const char *channel)=0