Apama  9.12.0.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
correlator_plugin.hpp
Go to the documentation of this file.
1 /*
2  * correlator_plugin.hpp
3  *
4  * Apama Plugin C++ API definitions. Used by plugin libraries and the plugin
5  * support code within the Engine itself.
6  *
7  * $Copyright(c) 2002, 2004-2006, 2008-2013 Progress Software Corporation (PSC). All rights reserved.$
8  * $Copyright (c) 2013-2016 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.$
9  * Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG
10  *
11  * $Id: correlator_plugin.hpp 286677 2016-07-18 14:54:01Z bsp $
12  */
13 
19 #ifndef CORRELATOR_PLUGIN_HPP
20 #define CORRELATOR_PLUGIN_HPP
21 
22 
23 #include <ApamaTypes.h>
24 #include <AP_Platform.h>
25 #include <AP_PluginCommon.h>
26 #include <exception>
27 #include <stdexcept>
28 #include <string>
29 #include <vector>
30 #include <iostream>
31 #include <memory>
32 
42  /* Version history:
43  * 1.0 First version released in Apama Engine 2.0.3
44  * Win32 support added in Apama Engine 2.0.4
45  * 2.0 Add serialisation support for Apama Engine 2.1 release
46  * Unfortunately this breaks back compatibility of chunks
47  * 3.0 Added getCorrelator, for internal use only
48  * 4.0 Make the result of the getCorrelator() context method into a real
49  * public class - AP_CorrelatorInterface. Unfortunately v3.0 plugins
50  * will be expecting a different type to be returned by this method,
51  * so a major version bump is required. However, this does bring the
52  * C++ and C plugin APIs back into sync - future changes can be made
53  * to both APIs and the version numbers incremented together.
54  * 5.0 Add getContextId and sendEventTo. Also added the optional
55  * GET_CAPABILITIES and THREAD_ENDED functions that the plugin may
56  * provide. Improved some function prototypes.
57  * 6.0 Improved the interface's const-correctness. Increased the
58  * performance of AP_TypeList, made AP_Chunk construction and
59  * destruction cheaper, especially in a multi-threaded
60  * environment. Added AP_Type::visitSequenceElements.
61  * 7.0 Remove serialisation support
62  * Prohibit mutation of string arguments to plug-in functions
63  * Improve validation of returned values
64  * 8.0 Integrate BlockingAware functions into public AP_Context and
65  * AP_CorrelatorInterface.
66  * 9.0 Add support for modifying sequence lengths and returning sequences
67  */
68 #define AP_PLUGIN_VERSION 0x00090000
69 
70 // suse doesn't have std::initializer_list because it's still on gcc 4.3. Snip out those functions on suse
71 #if (__GNUC__ > 4 || __GNUC_MINOR__ > 3 || !defined(__linux__))
72 #define _has_std_initializer_list
73 #endif
74 
75 
76 
82 class AP_PluginException : public std::runtime_error
83 {
84 public:
86  explicit AP_PluginException(const std::string& what) : std::runtime_error(what) { }
87 };
88 
89 
95 {
96 public:
98  explicit AP_TypeException(const std::string& what) : AP_PluginException(what) { }
99 };
100 
101 
108 {
109 public:
111  explicit AP_UnimplementedException(const std::string& what) : AP_PluginException(what) { }
112 };
113 
114 
120 {
121 public:
123  explicit AP_BoundsException(const std::string& what) : AP_PluginException(what) { }
124 };
125 
133 {
134 public:
142  explicit AP_UserPluginException(const std::string &type, const std::string& what)
143  : AP_PluginException(what), type(type)
144  {}
145 
147  const std::string& getType() const
148  {
149  return type;
150  }
151 
152  ~AP_UserPluginException() throw() {}
153 private:
154  std::string type;
155 };
156 
157 /* Forward declarations */
158 class AP_Chunk;
160 
178 class AP_PLUGIN_API AP_Context
179 {
180 public:
182  virtual ~AP_Context() {}
183 
185  virtual uint32 version() const = 0;
186 
201  virtual char8* char8alloc(size_t len) const = 0;
202 
214  virtual char8* char8dup(const char8* s) const = 0;
215 
224  virtual void char8free(char8* s) const = 0;
225 
229  virtual AP_CorrelatorInterface* getCorrelator() const = 0;
230 
235  virtual AP_uint64 getContextId() const = 0;
236 
244  virtual void pluginNowBlocking() const = 0;
245 
252  class NoContext;
253 };
254 
261 class AP_PLUGIN_API AP_Context::NoContext: public AP_Context
262 {
263 public:
264  virtual ~NoContext() {}
265  virtual uint32 version() const { return 0; }
266  virtual char8* char8alloc(size_t len) const { return 0; }
267  virtual char8* char8dup(const char8* s) const { return 0; }
268  virtual void char8free(char8* s) const { }
269  virtual AP_CorrelatorInterface* getCorrelator() const { return 0; }
270  virtual AP_uint64 getContextId() const { return 0; }
271  virtual void pluginNowBlocking() const { }
272 };
273 
279 {
280 public:
288  typedef std::shared_ptr<AP_EventHandlerInterface> ptr_t;
289 
294 
303  virtual void handleEvent(const AP_Context &ctx, const char *event, const char *channel) = 0;
304 };
305 
312 {
313 public:
315  virtual ~AP_CorrelatorInterface() = 0;
316 
329  virtual void pluginNowBlocking() const = 0;
330 
338  virtual void sendEvent(const char* event) = 0;
339 
353  virtual void sendEventTo(const char* event, AP_uint64 targetContext, AP_uint64 sourceContext) = 0;
354 
365  virtual void sendEventTo(const char* event, AP_uint64 targetContext, const AP_Context &source) = 0;
366 
377  virtual void sendEventTo(const char *event, const char *targetChannel, const AP_Context &source) = 0;
378 #ifdef _has_std_initializer_list
379 
394  void subscribe(const AP_EventHandlerInterface::ptr_t &handler, std::initializer_list<const char *> channels)
395  {
396  subscribe_impl(handler, channels.begin(), channels.end());
397  }
398 #endif
399 
426  template<typename ITER>
427  void subscribe(const AP_EventHandlerInterface::ptr_t &handler, const ITER &start, const ITER &end)
428  {
429  subscribe_impl(handler, start, end);
430  }
431 
447  template<typename T>
448  void subscribe(const AP_EventHandlerInterface::ptr_t &handler, const T &channel)
449  {
450  subscribe_impl(handler, &channel, (&channel)+1);
451  }
452 #ifdef _has_std_initializer_list
453 
466  void unsubscribe(const AP_EventHandlerInterface::ptr_t &handler, std::initializer_list<const char *> channels)
467  {
468  unsubscribe_impl(handler, channels.begin(), channels.end());
469  }
470 #endif
471 
496  template<typename ITER>
497  void unsubscribe(const AP_EventHandlerInterface::ptr_t &handler, const ITER &start, const ITER &end)
498  {
499  unsubscribe_impl(handler, start, end);
500  }
501 
513  template<typename T>
514  void unsubscribe(const AP_EventHandlerInterface::ptr_t &handler, const T &channel)
515  {
516  unsubscribe_impl(handler, &channel, (&channel)+1);
517  }
518 
526  virtual void unsubscribe(const AP_EventHandlerInterface::ptr_t &handler) = 0;
527 
528 protected:
530  virtual void subscribe_impl(const AP_EventHandlerInterface::ptr_t &handler, char const *const *start, char const *const *end) = 0;
532  virtual void unsubscribe_impl(const AP_EventHandlerInterface::ptr_t &handler, char const *const *start, char const *const *end) = 0;
537  template<typename ITER>
538  void subscribe_impl(const AP_EventHandlerInterface::ptr_t &handler, const ITER &start, const ITER &end)
539  {
540  for (ITER it = start; it != end; ++it) {
541  subscribe_impl(handler, (char const *const *) &(*it), (char const *const *) &(*it) + 1);
542  }
543  }
548  template<typename ITER>
549  void unsubscribe_impl(const AP_EventHandlerInterface::ptr_t &handler, const ITER &start, const ITER &end)
550  {
551  for (ITER it = start; it != end; ++it) {
552  unsubscribe_impl(handler, (char const *const *) &(*it), (char const *const *) &(*it) + 1);
553  }
554  }
555 };
556 
566 class AP_PLUGIN_API AP_Chunk
567 {
568 public:
583  virtual ~AP_Chunk() {}
584 
595  virtual AP_Chunk* copy(const AP_Context& ctx) const = 0;
596 
601  explicit AP_Chunk(const AP_Context &) {}
602 
607  AP_Chunk() {}
608 };
609 
610 
611 
623 class AP_Type
624 {
625 public:
627  virtual ~AP_Type() = 0;
628 
630  virtual AP_TypeDiscriminator discriminator() const = 0;
631 
633  virtual void copyFrom(const AP_Type &other) = 0;
634 
636  virtual AP_Chunk* chunkValue() const = 0;
637 
649  virtual AP_Chunk *chunkValue(AP_Chunk* val) const = 0;
650 
652  virtual int64 integerValue() const = 0;
653 
655  virtual void integerValue(int64 val) = 0;
656 
658  virtual float64 floatValue() const = 0;
659 
661  virtual void floatValue(float64 val) = 0;
662 
664  virtual AP_decimal decimalValue() const = 0;
665 
667  virtual void decimalValue(AP_decimal val) = 0;
668 
670  virtual bool booleanValue() const = 0;
671 
673  virtual void booleanValue(bool val) = 0;
674 
676  virtual const char8* stringValue() const = 0;
677 
682  virtual void stringValue(const char8* val) = 0;
683 
685  virtual size_t sequenceLength() const = 0;
686 
694  virtual void setSequenceLength(size_t length) const = 0;
695 
704  virtual void createSequence(AP_TypeDiscriminator inner) = 0;
705 
707  virtual AP_TypeDiscriminator sequenceType() const = 0;
708 
714  virtual AP_Type &sequenceElement(size_t index) const = 0;
715 
724  template <typename FN>
725  void visitSequenceElements(const FN &fn, size_t start = 0, size_t length = size_t(-1)) const {
726  visitSequenceElementsImpl(Wrap<FN>(fn), start, length);
727  }
728 
734  virtual AP_Type* const * sequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
735 
745  virtual void releaseSequenceElements() const = 0;
746 
757  virtual AP_Chunk* const * chunkSequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
758 
767  virtual void releaseChunkSequenceElements() const = 0;
768 
774  virtual int64* integerSequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
775 
785  virtual void releaseIntegerSequenceElements() const = 0;
786 
792  virtual float64* floatSequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
793 
803  virtual void releaseFloatSequenceElements() const = 0;
804 
810  virtual AP_decimal* decimalSequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
811 
821  virtual void releaseDecimalSequenceElements() const = 0;
822 
828  virtual bool* booleanSequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
829 
839  virtual void releaseBooleanSequenceElements() const = 0;
840 
848  virtual const char8** stringSequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
849 
867  virtual void releaseStringSequenceElements() const = 0;
868 
869 
871  operator AP_Chunk*() const {
872  return chunkValue();
873  }
874 
877  chunkValue(val);
878  return *this;
879  }
880 
882  operator int64() const {
883  return integerValue();
884  }
885 
887  AP_Type &operator= (int64 val) {
888  integerValue(val);
889  return *this;
890  }
891 
893  operator float64() const {
894  return floatValue();
895  }
896 
898  AP_Type &operator= (float64 val) {
899  floatValue(val);
900  return *this;
901  }
902 
904  operator AP_decimal() const {
905  return decimalValue();
906  }
907 
909  AP_Type &operator= (AP_decimal val) {
910  decimalValue(val);
911  return *this;
912  }
913 
915  operator bool() const {
916  return booleanValue();
917  }
918 
920  AP_Type &operator= (bool val) {
921  booleanValue(val);
922  return *this;
923  }
924 
926  operator const char8*() const {
927  return stringValue();
928  }
929 
931  AP_Type &operator= (const char8* val) {
932  stringValue(val);
933  return *this;
934  }
935 
937  AP_Type& operator[] (size_t index) const {
938  return sequenceElement(index);
939  }
940 
942  AP_Type &operator=(const AP_Type &other)
943  {
944  copyFrom(other);
945  return *this;
946  }
947 
948 protected:
950  class ElementFn {
951  public:
952  virtual ~ElementFn() { }
953  virtual void operator()(AP_Type &) const =0;
954  };
955 
957  virtual void visitSequenceElementsImpl(const ElementFn &, size_t start, size_t length) const =0;
958 
959 private:
961  template <typename FN>
962  class Wrap : public ElementFn {
963  public:
964  explicit Wrap(const FN &fn) : fn(fn) {}
965  void operator()(AP_Type &arg) const { fn(arg); }
966  private:
967  const FN &fn;
968  };
969 };
970 
971 
972 
978 {
979 public:
983  template <typename T> AP_TypeList(const T *array, size_t n)
984  : ptr(reinterpret_cast<const char *>(static_cast<const AP_Type *>(array))),
985  n(n),
986  stride(sizeof(T))
987  {}
988 
990  size_t size() const { return n; }
991 
993  bool empty() const { return n==0; }
994 
996  const AP_Type &operator[] (size_t i) const {
997  return *reinterpret_cast<const AP_Type *>(ptr + i*stride);
998  }
999 
1000 private:
1002  const char *ptr;
1004  size_t n;
1006  size_t stride;
1007 };
1008 
1009 
1010 
1021 typedef void (AP_PLUGIN_CALL* AP_FunctionPtr)(const AP_Context& ctx, const AP_TypeList& args, AP_Type& rval, AP_TypeDiscriminator rtype);
1022 
1023 
1024 
1033 {
1035  const char8* name;
1036 
1039 
1041  size_t nParams;
1042 
1044  const char8** paramTypes;
1045 
1047  const char8* returnType;
1048 };
1049 
1050 
1051 
1076 typedef AP_PLUGIN_DLL_SYM AP_ErrorCode (AP_PLUGIN_CALL* AP_InitFunctionPtr)(const AP_Context& ctx, uint32& version, uint32& nFunctions, AP_Function*& functions);
1077 
1078 
1092 typedef AP_PLUGIN_DLL_SYM AP_ErrorCode (AP_PLUGIN_CALL* AP_ShutdownFunctionPtr)(const AP_Context& ctx);
1093 
1094 
1113 typedef AP_PLUGIN_DLL_SYM AP_ErrorCode (AP_PLUGIN_CALL* AP_LibraryVersionFunctionPtr)(const AP_Context& ctx, uint32& version);
1114 
1131 typedef AP_PLUGIN_DLL_SYM AP_Capabilities (AP_PLUGIN_CALL* AP_GetCapabilitiesFunctionPtr)(const AP_Context& ctx);
1132 
1133 
1149 typedef AP_PLUGIN_DLL_SYM AP_ErrorCode (AP_PLUGIN_CALL* AP_ThreadEndedFunctionPtr) (const AP_Context& ctx);
1150 
1151 #endif // CORRELATOR_PLUGIN_HPP
virtual void pluginNowBlocking() const =0
Called by the plugin when it performs a potentially blocking operation.
virtual const char8 ** stringSequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
Generate an array of string pointers encapsulating elements [start..start+length-1] of the sequence o...
Execution context for a library function call.
Definition: correlator_plugin.hpp:178
AP_UnimplementedException(const std::string &what)
Construct an AP_UnimplementedException from a message.
Definition: correlator_plugin.hpp:111
AP_PLUGIN_DLL_SYM AP_ErrorCode(AP_PLUGIN_CALL *AP_ThreadEndedFunctionPtr)(const AP_Context &ctx)
Type of a plugin library thread ended function.
Definition: correlator_plugin.hpp:1149
size_t nParams
Argument count.
Definition: correlator_plugin.hpp:1041
virtual size_t sequenceLength() const =0
Get the number of elements in a sequence object.
Type-safe encapsulation of a MonitorScript object, for passing arguments and return values into and o...
Definition: correlator_plugin.hpp:623
const char8 * returnType
Return type.
Definition: correlator_plugin.hpp:1047
void subscribe(const AP_EventHandlerInterface::ptr_t &handler, std::initializer_list< const char * > channels)
Subscribe an event handler to a list of channels.
Definition: correlator_plugin.hpp:394
virtual void releaseDecimalSequenceElements() const =0
Free the resources allocated by all preceding calls to decimalSequenceElements() and ensures that any...
virtual bool * booleanSequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
Generate an array of booleans encapsulating elements [start..start+length-1] of the sequence object...
std::shared_ptr< AP_EventHandlerInterface > ptr_t
A smart-pointer type for managing lifetime of event handlers.
Definition: correlator_plugin.hpp:288
virtual void pluginNowBlocking() const =0
Called by the plugin when it performs a potentially blocking operation.
void unsubscribe(const AP_EventHandlerInterface::ptr_t &handler, const T &channel)
Unsubscribe an event handler from a channel.
Definition: correlator_plugin.hpp:514
virtual AP_Chunk *const * chunkSequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
Generate an array of pointers to chunks encapsulating elements [start..start+length-1] of the sequenc...
AP_FunctionPtr fptr
Pointer to function implementation.
Definition: correlator_plugin.hpp:1038
AP_Capabilities
Plugin capabilities.
Definition: AP_PluginCommon.h:86
AP_PLUGIN_DLL_SYM AP_ErrorCode(AP_PLUGIN_CALL * AP_InitFunctionPtr)(const AP_Context &ctx, uint32 &version, uint32 &nFunctions, AP_Function *&functions)
Type of a plugin library initialisation function.
Definition: correlator_plugin.hpp:1076
virtual ~AP_Context()
Destructor.
Definition: correlator_plugin.hpp:182
virtual AP_uint64 getContextId() const =0
Return the identifier of the EPL (parallelism) context associated with this plugin execution context...
virtual AP_Type & sequenceElement(size_t index) const =0
Get a reference to a single sequence element.
AP_Type & operator=(AP_Chunk *val)
Operator to assign chunk value to object.
Definition: correlator_plugin.hpp:876
virtual bool booleanValue() const =0
Get the boolean value of the object.
virtual void sendEvent(const char *event)=0
Send an event to the correlator.
Thrown by plugin authors to signal an error to any EPL calling this plugin.
Definition: correlator_plugin.hpp:132
virtual void releaseFloatSequenceElements() const =0
Free the resources allocated by all preceding calls to floatSequenceElements() and ensures that any c...
virtual AP_TypeDiscriminator sequenceType() const =0
Get the element type of a sequence object.
virtual void releaseBooleanSequenceElements() const =0
Free the resources allocated by all preceding calls to booleanSequenceElements() and ensures that any...
AP_Chunk()
Default constructor declared because there's a non-default one, which is deprecated.
Definition: correlator_plugin.hpp:607
virtual void setSequenceLength(size_t length) const =0
Set the length of a sequence object.
STL namespace.
const AP_Type & operator[](size_t i) const
Return a reference to an element of the list.
Definition: correlator_plugin.hpp:996
virtual void releaseIntegerSequenceElements() const =0
Free the resources allocated by all preceding calls to integerSequenceElements() and ensures that any...
virtual void copyFrom(const AP_Type &other)=0
Copy another AP_Type into this, regardless of type.
void(AP_PLUGIN_CALL * AP_FunctionPtr)(const AP_Context &ctx, const AP_TypeList &args, AP_Type &rval, AP_TypeDiscriminator rtype)
Type of a plugin function.
Definition: correlator_plugin.hpp:1021
AP_TypeDiscriminator
A typed discriminator for the contents of an AP_Type object.
Definition: AP_PluginCommon.h:47
virtual ~AP_EventHandlerInterface()
Ensure we have a virtual destructor, so that derived class destructors can be correctly called...
Definition: correlator_plugin.hpp:293
Shared definitions for the C and C++ plugin APIs.
virtual ~AP_CorrelatorInterface()=0
Destructor.
virtual void releaseStringSequenceElements() const =0
Free the resources allocated by all preceding calls to stringSequenceElements() and copies any change...
virtual int64 * integerSequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
Generate an array of integers encapsulating elements [start..start+length-1] of the sequence object...
AP_Type & operator[](size_t index) const
Operator to get sequence element of object.
Definition: correlator_plugin.hpp:937
virtual AP_decimal * decimalSequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
Generate an array of decimals encapsulating elements [start..start+length-1] of the sequence object...
AP_BoundsException(const std::string &what)
Construct an AP_BoundsException from a message.
Definition: correlator_plugin.hpp:123
An interface class that should be implemented by event handlers which are registered via AP_Correlato...
Definition: correlator_plugin.hpp:278
AP_PLUGIN_DLL_SYM AP_ErrorCode(AP_PLUGIN_CALL * AP_ShutdownFunctionPtr)(const AP_Context &ctx)
Type of a plugin library shutdown function.
Definition: correlator_plugin.hpp:1092
Type error.
Definition: correlator_plugin.hpp:94
virtual char8 * char8dup(const char8 *s) const =0
Duplicate a string value created using char8alloc().
AP_Type & operator=(const AP_Type &other)
Copy assignment operator from another AP_Type.
Definition: correlator_plugin.hpp:942
AP_TypeException(const std::string &what)
Construct an AP_TypeException from a message.
Definition: correlator_plugin.hpp:98
Thrown by an attempt to use a function that is defined but not implemented in this version of the API...
Definition: correlator_plugin.hpp:107
Asynchronous interface to the correlator.
Definition: correlator_plugin.hpp:311
void visitSequenceElements(const FN &fn, size_t start=0, size_t length=size_t(-1)) const
Visit the specified elements of a sequence using the specified functor.
Definition: correlator_plugin.hpp:725
virtual char8 * char8alloc(size_t len) const =0
Allocate storage for an 8-bit string value.
virtual void sendEventTo(const char *event, AP_uint64 targetContext, AP_uint64 sourceContext)=0
Send an event to a specific context in the correlator.
virtual AP_CorrelatorInterface * getCorrelator() const =0
Return the correlator implementation.
virtual void releaseSequenceElements() const =0
Free the resources allocated by all preceding calls to sequenceElements() and ensures that any change...
Container class for an ordered list of AP_Type objects, typically used to hold the argument list for ...
Definition: correlator_plugin.hpp:977
void subscribe(const AP_EventHandlerInterface::ptr_t &handler, const T &channel)
Subscribe an event handler to a list of channels.
Definition: correlator_plugin.hpp:448
void subscribe(const AP_EventHandlerInterface::ptr_t &handler, const ITER &start, const ITER &end)
Subscribe an event handler to a list of channels.
Definition: correlator_plugin.hpp:427
virtual AP_Type *const * sequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
Generate an array of pointers to AP_Type objects, encapsulating elements [start..start+length-1] of t...
bool empty() const
Return true iff size() == 0.
Definition: correlator_plugin.hpp:993
virtual void releaseChunkSequenceElements() const =0
Free the resources allocated by all preceding calls to chunkSequenceElements().
AP_UserPluginException(const std::string &type, const std::string &what)
Construct an AP_UserPluginException from a type and a message.
Definition: correlator_plugin.hpp:142
virtual float64 floatValue() const =0
Get the float value of the object.
Base class for all 'chunk' classes.
Definition: correlator_plugin.hpp:566
virtual AP_Chunk * chunkValue() const =0
Get the chunk value of the object.
Boundary checking error.
Definition: correlator_plugin.hpp:119
const std::string & getType() const
Return the type of this user exception.
Definition: correlator_plugin.hpp:147
const char8 ** paramTypes
Argument types.
Definition: correlator_plugin.hpp:1044
virtual int64 integerValue() const =0
Get the integer value of the object.
AP_PLUGIN_DLL_SYM AP_ErrorCode(AP_PLUGIN_CALL * AP_LibraryVersionFunctionPtr)(const AP_Context &ctx, uint32 &version)
Type of a plugin library version function.
Definition: correlator_plugin.hpp:1113
void unsubscribe(const AP_EventHandlerInterface::ptr_t &handler, std::initializer_list< const char * > channels)
Unsubscribe an event handler from a list of channels.
Definition: correlator_plugin.hpp:466
Plugin function descriptor.
Definition: correlator_plugin.hpp:1032
virtual AP_TypeDiscriminator discriminator() const =0
Get the type of the encapsulated object.
AP_PLUGIN_DLL_SYM AP_Capabilities(AP_PLUGIN_CALL * AP_GetCapabilitiesFunctionPtr)(const AP_Context &ctx)
Type of a plugin capability function.
Definition: correlator_plugin.hpp:1131
Base class of all exceptions thrown across the correlator/plugin boundary.
Definition: correlator_plugin.hpp:82
virtual void createSequence(AP_TypeDiscriminator inner)=0
Take an uninitialised sequence object and create an empty sequence with the indicated member type...
virtual ~AP_Type()=0
Destructor.
size_t size() const
Return the number of objects in the list.
Definition: correlator_plugin.hpp:990
AP_ENGINE_CLIENT_API void char8free(char *string)
Free any char* string returned from the client API.
AP_PluginException(const std::string &what)
Construct an AP_PluginException from a message.
Definition: correlator_plugin.hpp:86
const char8 * name
Function name.
Definition: correlator_plugin.hpp:1035
virtual float64 * floatSequenceElements(size_t start=0, size_t length=size_t(-1)) const =0
Generate an array of floats encapsulating elements [start..start+length-1] of the sequence object...
virtual AP_decimal decimalValue() const =0
Get the decimal value of the object.
AP_Chunk(const AP_Context &)
Obsolete constructor retained for backward compatibility.
Definition: correlator_plugin.hpp:601
virtual void char8free(char8 *s) const =0
Free the memory occupied by a string created using char8alloc() or char8dup().
AP_TypeList(const T *array, size_t n)
Construct a list from an array of classes derived from AP_Type.
Definition: correlator_plugin.hpp:983
virtual uint32 version() const =0
Return active plugin API version.
virtual ~AP_Chunk()
Virtual destructor.
Definition: correlator_plugin.hpp:583
void unsubscribe(const AP_EventHandlerInterface::ptr_t &handler, const ITER &start, const ITER &end)
Unsubscribe an event handler from a list of channels.
Definition: correlator_plugin.hpp:497
virtual const char8 * stringValue() const =0
Get the string value of the object.
virtual void handleEvent(const AP_Context &ctx, const char *event, const char *channel)=0
Called for each event sent to a channel to which this event handler is subscribed.