Apama  10.1.0.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
com::apama::epl::CorrelatorInterface Class Reference

An interface to the correlator which lets plug-ins call methods on the host. More...

#include <epl_plugin.hpp>

Public Types

enum  event_mode_t { STRING_MODE, MAP_MODE }
 Mode for receiving events in. More...
 

Public Member Functions

void receiveThreadEndedCallbacks (std::unique_ptr< ThreadEndedHandler > &&handler) const
 Register a handler to be called when a thread is about to be destroyed. More...
 
EventHandler::subscription_t registerEventHandler (std::unique_ptr< EventHandler > &&handler, const char *channel, event_mode_t mode=MAP_MODE, bool blocking=true) const
 Register an event handler to receive events on the given channel in the given mode. More...
 
void sendEvent (const char *event) const
 (deprecated) Send an event in string form to the default input queue. More...
 
void sendEvent (const std::string &event) const
 (deprecated) Send an event in string form to the default input queue. More...
 
void sendEvent (const char *type, data_t &&event) const
 (deprecated) Send an event in map form to the default input queue. More...
 
void sendEventTo (const std::string &event, uint64_t ctx) const
 Send an event in string form to a specific context. More...
 
void sendEventTo (const char *event, uint64_t ctx) const
 Send an event in string form to a specific context. More...
 
void sendEventTo (const char *type, data_t &&event, uint64_t ctx) const
 Send an event in map form to a specific context. More...
 
void sendEventTo (const std::string &event, const std::string &channel) const
 Send an event in string form to a channel. More...
 
void sendEventTo (const char *event, const char *channel) const
 Send an event in string form to a channel. More...
 
void sendEventTo (const char *type, data_t &&event, const char *channel) const
 Send an event in map form to a channel. More...
 
void pluginMethodBlocking () const
 Indicate that a previously declared non-blocking method call or event handler may now actually be blocking. More...
 
int64_t getCurrentContextId () const
 Return the ID of the current context, for passing to sendEventTo. More...
 

Detailed Description

An interface to the correlator which lets plug-ins call methods on the host.

Can be obtained via calling com::apama::epl::EPLPlugin<DERIVED>::getCorrelator

All of the methods on this interface are safe to be called from multiple threads.

Member Enumeration Documentation

Mode for receiving events in.

  • STRING_MODE: as a string
  • MAP_MODE: as a map_t(string => data_t)
Enumerator
STRING_MODE 

Deliver events in string form.

MAP_MODE 

Deliver events in map_t(string => data_t) form.

Member Function Documentation

int64_t com::apama::epl::CorrelatorInterface::getCurrentContextId ( ) const

Return the ID of the current context, for passing to sendEventTo.

If being called from EPL, this returns the ID of the caller context. If called from own thread or from an event handler it will return 0, which is not legal to pass to sendEventTo.

void com::apama::epl::CorrelatorInterface::pluginMethodBlocking ( ) const

Indicate that a previously declared non-blocking method call or event handler may now actually be blocking.

Method calls are marked as non-blocking via the blocking flag on the MethodData<DERIVED>::registerMethod function. Event handlers are marked as non-blocking via the blocking flag on the CorrelatorInterface::registerEventHandler method. This method is idempotent.

void com::apama::epl::CorrelatorInterface::receiveThreadEndedCallbacks ( std::unique_ptr< ThreadEndedHandler > &&  handler) const

Register a handler to be called when a thread is about to be destroyed.

Takes ownership of handler

EventHandler::subscription_t com::apama::epl::CorrelatorInterface::registerEventHandler ( std::unique_ptr< EventHandler > &&  handler,
const char *  channel,
event_mode_t  mode = MAP_MODE,
bool  blocking = true 
) const

Register an event handler to receive events on the given channel in the given mode.

Parameters
handlerThe event handler to be registered (takes ownership).
modeThe mode to receive events in. Either STRING_MODE or MAP_MODE
blockingTrue if the handler may block, False if it will not block (can be overridden with CorrelatorInterface::pluginMethodBlocking).
Returns
an object which can be used to add more channels to the subscription, or remove channels. When all channels are removed the handler will be deleted.
void com::apama::epl::CorrelatorInterface::sendEvent ( const char *  event) const

(deprecated) Send an event in string form to the default input queue.

Parameters
eventThe event in Apama string form
Deprecated:
Use sendEventTo instead
void com::apama::epl::CorrelatorInterface::sendEvent ( const std::string &  event) const
inline

(deprecated) Send an event in string form to the default input queue.

Parameters
eventThe event in Apama string form
Deprecated:
Use sendEventTo instead
void com::apama::epl::CorrelatorInterface::sendEvent ( const char *  type,
data_t &&  event 
) const

(deprecated) Send an event in map form to the default input queue.

Parameters
typeThe name of the event type to parse this as
eventEither a map_t containing the event data as a string->object map or the event in Apama string form
Deprecated:
Use sendEventTo instead
void com::apama::epl::CorrelatorInterface::sendEventTo ( const std::string &  event,
uint64_t  ctx 
) const
inline

Send an event in string form to a specific context.

Parameters
eventThe event in Apama string form
ctxThe ID of the context to deliver to Context IDs can be obtained via CorrelatorInterface::getCurrentContextId (even if currently on another thread) or passed from EPL context objects, either directly or part of an event
void com::apama::epl::CorrelatorInterface::sendEventTo ( const char *  event,
uint64_t  ctx 
) const

Send an event in string form to a specific context.

Parameters
eventThe event in Apama string form
ctxThe ID of the context to deliver to Context IDs can be obtained via CorrelatorInterface::getCurrentContextId (even if currently on another thread) or passed from EPL context objects, either directly or part of an event
void com::apama::epl::CorrelatorInterface::sendEventTo ( const char *  type,
data_t &&  event,
uint64_t  ctx 
) const

Send an event in map form to a specific context.

Parameters
typeThe name of the event type to parse this as
eventEither a map_t containing the event data as a string->object map or the event in Apama string form
ctxThe ID of the context to deliver to Context IDs can be obtained via CorrelatorInterface::getCurrentContextId (even if currently on another thread) or passed from EPL context objects, either directly or part of an event
void com::apama::epl::CorrelatorInterface::sendEventTo ( const std::string &  event,
const std::string &  channel 
) const
inline

Send an event in string form to a channel.

Parameters
eventThe event in Apama string form
channelThe channel to deliver to
void com::apama::epl::CorrelatorInterface::sendEventTo ( const char *  event,
const char *  channel 
) const

Send an event in string form to a channel.

Parameters
eventThe event in Apama string form
channelThe channel to deliver to
void com::apama::epl::CorrelatorInterface::sendEventTo ( const char *  type,
data_t &&  event,
const char *  channel 
) const

Send an event in map form to a channel.

Parameters
typeThe name of the event type to parse this as
eventEither a map_t containing the event data as a string->object map or the event in Apama string form
channelThe channel to deliver to

The documentation for this class was generated from the following file: