Apama
9.10.0.4.289795
|
Type-safe encapsulation of a MonitorScript object, for passing arguments and return values into and out of plugin functions. More...
#include <correlator_plugin.hpp>
Public Member Functions | |
virtual | ~AP_Type ()=0 |
Destructor. More... | |
virtual AP_TypeDiscriminator | discriminator () const =0 |
Get the type of the encapsulated object. More... | |
virtual void | copyFrom (const AP_Type &other)=0 |
Copy another AP_Type into this, regardless of type. More... | |
virtual AP_Chunk * | chunkValue () const =0 |
Get the chunk value of the object. More... | |
virtual AP_Chunk * | chunkValue (AP_Chunk *val) const =0 |
Set the chunk value of the object. More... | |
virtual int64 | integerValue () const =0 |
Get the integer value of the object. More... | |
virtual void | integerValue (int64 val)=0 |
Set the integer value of the object. More... | |
virtual float64 | floatValue () const =0 |
Get the float value of the object. More... | |
virtual void | floatValue (float64 val)=0 |
Set the float value of the object. More... | |
virtual bool | booleanValue () const =0 |
Get the boolean value of the object. More... | |
virtual void | booleanValue (bool val)=0 |
Set the boolean value of the object. More... | |
virtual const char8 * | stringValue () const =0 |
Get the string value of the object. More... | |
virtual void | stringValue (const char8 *val)=0 |
Set the string value of the object. More... | |
virtual size_t | sequenceLength () const =0 |
Get the number of elements in a sequence object. More... | |
virtual void | setSequenceLength (size_t length) const =0 |
Set the length of a sequence object. More... | |
virtual void | createSequence (AP_TypeDiscriminator inner)=0 |
Take an uninitialised sequence object and create an empty sequence with the indicated member type. More... | |
virtual AP_TypeDiscriminator | sequenceType () const =0 |
Get the element type of a sequence object. More... | |
virtual AP_Type & | sequenceElement (size_t index) const =0 |
Get a reference to a single sequence element. More... | |
template<typename FN > | |
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. More... | |
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 the sequence object. More... | |
virtual void | releaseSequenceElements () const =0 |
Free the resources allocated by all preceding calls to sequenceElements() and ensures that any changes made to the sequence elements are reflected in the underlying MonitorScript objects. More... | |
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 sequence object. More... | |
virtual void | releaseChunkSequenceElements () const =0 |
Free the resources allocated by all preceding calls to chunkSequenceElements(). More... | |
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. More... | |
virtual void | releaseIntegerSequenceElements () const =0 |
Free the resources allocated by all preceding calls to integerSequenceElements() and ensures that any changes made to the sequence elements are reflected in the underlying MonitorScript objects. More... | |
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. More... | |
virtual void | releaseFloatSequenceElements () const =0 |
Free the resources allocated by all preceding calls to floatSequenceElements() and ensures that any changes made to the sequence elements are reflected in the underlying MonitorScript objects. More... | |
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. More... | |
virtual void | releaseBooleanSequenceElements () const =0 |
Free the resources allocated by all preceding calls to booleanSequenceElements() and ensures that any changes made to the sequence elements are reflected in the underlying MonitorScript objects. More... | |
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 object. More... | |
virtual void | releaseStringSequenceElements () const =0 |
Free the resources allocated by all preceding calls to stringSequenceElements() and copies any changes made to the sequence elements to the underlying MonitorScript objects. More... | |
operator AP_Chunk * () const | |
Operator to get chunk value from object. More... | |
AP_Type & | operator= (AP_Chunk *val) |
Operator to assign chunk value to object. More... | |
operator int64 () const | |
Operator to get integer value from object. More... | |
AP_Type & | operator= (int64 val) |
Operator to assign integer value to object. More... | |
operator float64 () const | |
Operator to get float value from object. More... | |
AP_Type & | operator= (float64 val) |
Operator to assign float value to object. More... | |
operator bool () const | |
Operator to get boolean value from object. More... | |
AP_Type & | operator= (bool val) |
Operator to assign boolean value to object. More... | |
operator const char8 * () const | |
Operator to get string value from object. More... | |
AP_Type & | operator= (const char8 *val) |
Operator to assign string value to object. More... | |
AP_Type & | operator[] (size_t index) const |
Operator to get sequence element of object. More... | |
AP_Type & | operator= (const AP_Type &other) |
Copy assignment operator from another AP_Type. More... | |
Type-safe encapsulation of a MonitorScript object, for passing arguments and return values into and out of plugin functions.
Note that the implementation of the AP_Type 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_Type objects are those passed in to a plugin function by the Engine.
AP_Type is a "smart union" object – each instance holds a single value of one of the supported types and only allows access to data of that type.
|
pure virtual |
Destructor.
|
pure virtual |
Generate an array of booleans encapsulating elements [start..start+length-1] of the sequence object.
This may or may not require copying the original MonitorScript objects.
|
pure virtual |
Get the boolean value of the object.
|
pure virtual |
Set the boolean value of the object.
|
pure virtual |
Generate an array of pointers to chunks encapsulating elements [start..start+length-1] of the sequence object.
This may or may not require copying the original MonitorScript objects.
Note that the AP_Chunk pointers cannot be modified via this call. Use sequenceElement(), visitSequenceElements() or sequenceElements() instead, being sure to free any AP_Chunk instances that are replaced.
|
pure virtual |
Get the chunk value of the object.
|
pure virtual |
Copy another AP_Type into this, regardless of type.
|
pure virtual |
Take an uninitialised sequence object and create an empty sequence with the indicated member type.
Member type can only be primitives, string or chunk.
Typically used for return values from functions.
|
pure virtual |
Get the type of the encapsulated object.
|
pure virtual |
Generate an array of floats encapsulating elements [start..start+length-1] of the sequence object.
This may or may not require copying the original MonitorScript objects.
|
pure virtual |
Get the float value of the object.
|
pure virtual |
Set the float value of the object.
|
pure virtual |
Generate an array of integers encapsulating elements [start..start+length-1] of the sequence object.
This may or may not require copying the original MonitorScript objects.
|
pure virtual |
Get the integer value of the object.
|
pure virtual |
Set the integer value of the object.
|
inline |
Operator to get chunk value from object.
|
inline |
Operator to get boolean value from object.
|
inline |
Operator to get string value from object.
|
inline |
Operator to get float value from object.
|
inline |
Operator to get integer value from object.
|
inline |
Operator to assign integer value to object.
|
inline |
Operator to assign float value to object.
|
inline |
Operator to assign boolean value to object.
|
inline |
Operator to assign string value to object.
Copy assignment operator from another AP_Type.
|
inline |
Operator to get sequence element of object.
|
pure virtual |
Free the resources allocated by all preceding calls to booleanSequenceElements() and ensures that any changes made to the sequence elements are reflected in the underlying MonitorScript objects.
Arrays previously returned by booleanSequenceElements() immediately become invalid. This function is automatically called when a sequence AP_Type is destroyed, but can be invoked explicitly by a plugin to copy changes back during a long-running computation.
|
pure virtual |
Free the resources allocated by all preceding calls to chunkSequenceElements().
Arrays previously returned by chunkSequenceElements() immediately become invalid. This function is automatically called when a sequence AP_Type is destroyed, but can be invoked explicitly by a plugin during a long-running computation.
|
pure virtual |
Free the resources allocated by all preceding calls to floatSequenceElements() and ensures that any changes made to the sequence elements are reflected in the underlying MonitorScript objects.
Arrays previously returned by floatSequenceElements() immediately become invalid. This function is automatically called when a sequence AP_Type is destroyed, but can be invoked explicitly by a plugin to copy changes back during a long-running computation.
|
pure virtual |
Free the resources allocated by all preceding calls to integerSequenceElements() and ensures that any changes made to the sequence elements are reflected in the underlying MonitorScript objects.
Arrays previously returned by integerSequenceElements() immediately become invalid. This function is automatically called when a sequence AP_Type is destroyed, but can be invoked explicitly by a plugin to copy changes back during a long-running computation.
|
pure virtual |
Free the resources allocated by all preceding calls to sequenceElements() and ensures that any changes made to the sequence elements are reflected in the underlying MonitorScript objects.
Any arrays previously returned by sequenceElements() immediately become invalid. This function is automatically called when a sequence AP_Type is destroyed, but can be invoked explicitly by a plugin to copy changes back during a long-running computation.
|
pure virtual |
Free the resources allocated by all preceding calls to stringSequenceElements() and copies any changes made to the sequence elements to the underlying MonitorScript objects.
Arrays previously returned by stringSequenceElements() immediately become invalid. This function is automatically called when a sequence AP_Type is destroyed, but can be invoked explicitly by a plugin to copy changes back during a long-running computation.
Note that string sequence element arrays do not own the strings they reference and will never delete a string the plugin has placed in the array - if the plugin has set a value, it must delete that string (and it cannot use the value in the array returned from stringSequenceElement
|
pure virtual |
|
pure virtual |
Generate an array of pointers to AP_Type objects, encapsulating elements [start..start+length-1] of the sequence object.
This may or may not require copying the original MonitorScript objects.
|
pure virtual |
Get the number of elements in a sequence object.
|
pure virtual |
Get the element type of a sequence object.
|
pure virtual |
Set the length of a sequence object.
Increasing the length will populate the sequence with default-initialised objects. Decreasing the length will remove items from the end.
You are not permitted to call setSequenceLength after calling sequenceElements without releasing the elements. If you call setSequenceLength any references returned from sequenceElement or operator[] are invalid and may not be used.
|
pure virtual |
Generate an array of string pointers encapsulating elements [start..start+length-1] of the sequence object.
This may or may not require copying the original MonitorScript objects. Strings pointed to by this sequence are only valid for the lifetime of a call into the plugin.
|
pure virtual |
Get the string value of the object.
|
pure virtual |
Set the string value of the object.
Note that this is only possible on sequence elements and return values, not arguments (which are const)
|
inline |
Visit the specified elements of a sequence using the specified functor.
Although less convenient than other sequence element accessors, it is more efficient as it entails no memory allocation.