An interface to the correlator which lets plug-ins call methods on the host.
More...
#include <epl_plugin.hpp>
|
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 | 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...
|
|
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.
◆ event_mode_t
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.
|
◆ getCurrentContextId()
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.
◆ pluginMethodBlocking()
void com::apama::epl::CorrelatorInterface::pluginMethodBlocking |
( |
| ) |
const |
◆ receiveThreadEndedCallbacks()
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
◆ registerEventHandler()
Register an event handler to receive events on the given channel in the given mode.
- Parameters
-
handler | The event handler to be registered (takes ownership). |
channel | The channel to receive from. |
mode | The mode to receive events in. Either STRING_MODE or MAP_MODE |
blocking | True 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.
◆ sendEventTo() [1/6]
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
-
event | The event in Apama string form |
ctx | The 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 |
◆ sendEventTo() [2/6]
void com::apama::epl::CorrelatorInterface::sendEventTo |
( |
const char * |
event, |
|
|
uint64_t |
ctx |
|
) |
| const |
Send an event in string form to a specific context.
- Parameters
-
event | The event in Apama string form |
ctx | The 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 |
◆ sendEventTo() [3/6]
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
-
type | The name of the event type to parse this as |
event | Either a map_t containing the event data as a string->object map or the event in Apama string form |
ctx | The 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 |
◆ sendEventTo() [4/6]
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
-
event | The event in Apama string form |
channel | The channel to deliver to |
◆ sendEventTo() [5/6]
void com::apama::epl::CorrelatorInterface::sendEventTo |
( |
const char * |
event, |
|
|
const char * |
channel |
|
) |
| const |
Send an event in string form to a channel.
- Parameters
-
event | The event in Apama string form |
channel | The channel to deliver to |
◆ sendEventTo() [6/6]
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
-
type | The name of the event type to parse this as |
event | Either a map_t containing the event data as a string->object map or the event in Apama string form |
channel | The channel to deliver to |
The documentation for this class was generated from the following file: