Apama  9.10.0.4.289795
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 274995 2016-02-08 17:08:39Z shd $
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 bool booleanValue() const = 0;
665 
667  virtual void booleanValue(bool val) = 0;
668 
670  virtual const char8* stringValue() const = 0;
671 
676  virtual void stringValue(const char8* val) = 0;
677 
679  virtual size_t sequenceLength() const = 0;
680 
688  virtual void setSequenceLength(size_t length) const = 0;
689 
698  virtual void createSequence(AP_TypeDiscriminator inner) = 0;
699 
701  virtual AP_TypeDiscriminator sequenceType() const = 0;
702 
708  virtual AP_Type &sequenceElement(size_t index) const = 0;
709 
718  template <typename FN>
719  void visitSequenceElements(const FN &fn, size_t start = 0, size_t length = size_t(-1)) const {
720  visitSequenceElementsImpl(Wrap<FN>(fn), start, length);
721  }
722 
728  virtual AP_Type* const * sequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
729 
739  virtual void releaseSequenceElements() const = 0;
740 
751  virtual AP_Chunk* const * chunkSequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
752 
761  virtual void releaseChunkSequenceElements() const = 0;
762 
768  virtual int64* integerSequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
769 
779  virtual void releaseIntegerSequenceElements() const = 0;
780 
786  virtual float64* floatSequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
787 
797  virtual void releaseFloatSequenceElements() const = 0;
798 
804  virtual bool* booleanSequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
805 
815  virtual void releaseBooleanSequenceElements() const = 0;
816 
824  virtual const char8** stringSequenceElements(size_t start = 0, size_t length = size_t(-1)) const = 0;
825 
843  virtual void releaseStringSequenceElements() const = 0;
844 
845 
847  operator AP_Chunk*() const {
848  return chunkValue();
849  }
850 
853  chunkValue(val);
854  return *this;
855  }
856 
858  operator int64() const {
859  return integerValue();
860  }
861 
863  AP_Type &operator= (int64 val) {
864  integerValue(val);
865  return *this;
866  }
867 
869  operator float64() const {
870  return floatValue();
871  }
872 
874  AP_Type &operator= (float64 val) {
875  floatValue(val);
876  return *this;
877  }
878 
880  operator bool() const {
881  return booleanValue();
882  }
883 
885  AP_Type &operator= (bool val) {
886  booleanValue(val);
887  return *this;
888  }
889 
891  operator const char8*() const {
892  return stringValue();
893  }
894 
896  AP_Type &operator= (const char8* val) {
897  stringValue(val);
898  return *this;
899  }
900 
902  AP_Type& operator[] (size_t index) const {
903  return sequenceElement(index);
904  }
905 
907  AP_Type &operator=(const AP_Type &other)
908  {
909  copyFrom(other);
910  return *this;
911  }
912 
913 protected:
915  class ElementFn {
916  public:
917  virtual ~ElementFn() { }
918  virtual void operator()(AP_Type &) const =0;
919  };
920 
922  virtual void visitSequenceElementsImpl(const ElementFn &, size_t start, size_t length) const =0;
923 
924 private:
926  template <typename FN>
927  class Wrap : public ElementFn {
928  public:
929  explicit Wrap(const FN &fn) : fn(fn) {}
930  void operator()(AP_Type &arg) const { fn(arg); }
931  private:
932  const FN &fn;
933  };
934 };
935 
936 
937 
943 {
944 public:
948  template <typename T> AP_TypeList(const T *array, size_t n)
949  : ptr(reinterpret_cast<const char *>(static_cast<const AP_Type *>(array))),
950  n(n),
951  stride(sizeof(T))
952  {}
953 
955  size_t size() const { return n; }
956 
958  bool empty() const { return n==0; }
959 
961  const AP_Type &operator[] (size_t i) const {
962  return *reinterpret_cast<const AP_Type *>(ptr + i*stride);
963  }
964 
965 private:
966  const char *ptr;
967  size_t n;
968  size_t stride;
969 };
970 
971 
972 
983 typedef void (AP_PLUGIN_CALL* AP_FunctionPtr)(const AP_Context& ctx, const AP_TypeList& args, AP_Type& rval, AP_TypeDiscriminator rtype);
984 
985 
986 
995 {
997  const char8* name;
998 
1001 
1003  size_t nParams;
1004 
1006  const char8** paramTypes;
1007 
1009  const char8* returnType;
1010 };
1011 
1012 
1013 
1038 typedef AP_PLUGIN_DLL_SYM AP_ErrorCode (AP_PLUGIN_CALL* AP_InitFunctionPtr)(const AP_Context& ctx, uint32& version, uint32& nFunctions, AP_Function*& functions);
1039 
1040 
1054 typedef AP_PLUGIN_DLL_SYM AP_ErrorCode (AP_PLUGIN_CALL* AP_ShutdownFunctionPtr)(const AP_Context& ctx);
1055 
1056 
1075 typedef AP_PLUGIN_DLL_SYM AP_ErrorCode (AP_PLUGIN_CALL* AP_LibraryVersionFunctionPtr)(const AP_Context& ctx, uint32& version);
1076 
1093 typedef AP_PLUGIN_DLL_SYM AP_Capabilities (AP_PLUGIN_CALL* AP_GetCapabilitiesFunctionPtr)(const AP_Context& ctx);
1094 
1095 
1111 typedef AP_PLUGIN_DLL_SYM AP_ErrorCode (AP_PLUGIN_CALL* AP_ThreadEndedFunctionPtr) (const AP_Context& ctx);
1112 
1113 #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:1111
size_t nParams
Argument count.
Definition: correlator_plugin.hpp:1003
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:1009
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 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:1000
AP_Capabilities
Plugin capabilities.
Definition: AP_PluginCommon.h:74
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:1038
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:852
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:961
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:983
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:902
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:1054
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:907
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:719
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:942
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:958
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:1006
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:1075
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:994
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:1093
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:955
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:997
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...
AP_Chunk(const AP_Context &)
Obsolete constructor retained for backward compatability.
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:948
virtual uint32 version() const =0
Return active plugin API version.
virtual ~AP_Chunk()
Pure 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.