|
LSSTApplications
8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
|
Coordinate publishing and receiving events. More...
#include <EventSystem.h>
Public Member Functions | |
| EventSystem () | |
| EventSystem object. This object allows creation of the system's event transmitters and receivers, which can be specified at the beginning, and later used by specifying the topic to receive from or send on. More... | |
| ~EventSystem () | |
| destructor More... | |
| void | createTransmitter (const pexPolicy::Policy &policy) |
| create an EventTransmitter to send messages to the message broker More... | |
| void | createTransmitter (const std::string &hostName, const std::string &topicName, int hostPort=EventBroker::DEFAULTHOSTPORT) |
| create an EventTransmitter to send messages to the message broker More... | |
| void | createReceiver (const pexPolicy::Policy &policy) |
| create an EventReceiver to receive messages from the message broker More... | |
| void | createReceiver (const std::string &hostName, const std::string &topicName, int hostPort=EventBroker::DEFAULTHOSTPORT) |
| create an EventReceiver which will receive message More... | |
| void | createReceiver (const std::string &hostName, const std::string &topicName, const std::string &selector, int hostPort=EventBroker::DEFAULTHOSTPORT) |
| create an EventReceiver which will receive message More... | |
| void | publishEvent (const std::string &topicName, Event &event) |
| send an event on a topic More... | |
| Event * | receiveEvent (const std::string &topicName) |
| blocking receive for events. Waits until an event is received for the topic specified in the constructor More... | |
| Event * | receiveEvent (const std::string &topicName, const long timeout) |
| blocking receive for events, with timeout (in milliseconds). Waits until an event is received for the topic specified in the constructor, or until the timeout expires. More... | |
| int64_t | createOriginatorId () |
| int | extractIPId (int64_t identificationId) |
| extract the 32-bit IPId embedded in this identificationId. This is the integer representation of the IPV4 network address of the host associated with this identificationId More... | |
| int | extractProcessId (int64_t identificationId) |
| extract the 17-bit processId embedded in this identificationId More... | |
| short | extractLocalId (int64_t identificationId) |
| extract the 15-bit localId embedded in this identificationId More... | |
| StatusEvent * | castToStatusEvent (Event *event) |
| CommandEvent * | castToCommandEvent (Event *event) |
Static Public Member Functions | |
| static EventSystem & | getDefaultEventSystem () |
| return the default EventSystem object, which can access all previously created Transmitters and receivers More... | |
Protected Attributes | |
| list< boost::shared_ptr < EventTransmitter > > | _transmitters |
| list< boost::shared_ptr < EventReceiver > > | _receivers |
Static Protected Attributes | |
| static EventSystem * | defaultEventSystem = 0 |
| static short | _localId = 0 |
| static int | _IPId = 0 |
Private Member Functions | |
| boost::shared_ptr < EventTransmitter > | getTransmitter (const std::string &name) |
| boost::shared_ptr< EventReceiver > | getReceiver (const std::string &name) |
Coordinate publishing and receiving events.
Definition at line 65 of file EventSystem.h.
| lsst.ctrl.events::EventSystem::EventSystem | ( | ) |
EventSystem object. This object allows creation of the system's event transmitters and receivers, which can be specified at the beginning, and later used by specifying the topic to receive from or send on.
Definition at line 67 of file EventSystem.cc.
| lsst.ctrl.events::EventSystem::~EventSystem | ( | ) |
| CommandEvent * lsst.ctrl.events::EventSystem::castToCommandEvent | ( | Event * | event | ) |
Definition at line 283 of file EventSystem.cc.
| StatusEvent * lsst.ctrl.events::EventSystem::castToStatusEvent | ( | Event * | event | ) |
Definition at line 279 of file EventSystem.cc.
| int64_t lsst.ctrl.events::EventSystem::createOriginatorId | ( | ) |
Definition at line 244 of file EventSystem.cc.
| void lsst.ctrl.events::EventSystem::createReceiver | ( | const pexPolicy::Policy & | policy | ) |
create an EventReceiver to receive messages from the message broker
| policy | the Policy object to use to configure the EventReceiver |
Definition at line 143 of file EventSystem.cc.
| void lsst.ctrl.events::EventSystem::createReceiver | ( | const std::string & | hostName, |
| const std::string & | topicName, | ||
| int | hostPort = EventBroker::DEFAULTHOSTPORT |
||
| ) |
create an EventReceiver which will receive message
| hostName | the location of the message broker to use |
| topicName | the topic to receive messages from |
| hostPort | the port where the broker can be reached |
Definition at line 158 of file EventSystem.cc.
| void lsst.ctrl.events::EventSystem::createReceiver | ( | const std::string & | hostName, |
| const std::string & | topicName, | ||
| const std::string & | selector, | ||
| int | hostPort = EventBroker::DEFAULTHOSTPORT |
||
| ) |
create an EventReceiver which will receive message
| hostName | the location of the message broker to use |
| topicName | the topic to receive messages from |
| selector | the message selector to specify which messages to receive |
| hostPort | the port where the broker can be reached |
Definition at line 174 of file EventSystem.cc.
| void lsst.ctrl.events::EventSystem::createTransmitter | ( | const pexPolicy::Policy & | policy | ) |
create an EventTransmitter to send messages to the message broker
| policy | the Policy object to use to configure the EventTransmitter |
Definition at line 115 of file EventSystem.cc.
| void lsst.ctrl.events::EventSystem::createTransmitter | ( | const std::string & | hostName, |
| const std::string & | topicName, | ||
| int | hostPort = EventBroker::DEFAULTHOSTPORT |
||
| ) |
create an EventTransmitter to send messages to the message broker
| hostName | the location of the message broker to use |
| topicName | the topic to transmit events to |
| hostPort | the port where the broker can be reached |
Definition at line 130 of file EventSystem.cc.
| int lsst.ctrl.events::EventSystem::extractIPId | ( | int64_t | identificationId | ) |
extract the 32-bit IPId embedded in this identificationId. This is the integer representation of the IPV4 network address of the host associated with this identificationId
Definition at line 261 of file EventSystem.cc.
| short lsst.ctrl.events::EventSystem::extractLocalId | ( | int64_t | identificationId | ) |
extract the 15-bit localId embedded in this identificationId
Definition at line 275 of file EventSystem.cc.
| int lsst.ctrl.events::EventSystem::extractProcessId | ( | int64_t | identificationId | ) |
extract the 17-bit processId embedded in this identificationId
Definition at line 268 of file EventSystem.cc.
|
static |
return the default EventSystem object, which can access all previously created Transmitters and receivers
Definition at line 80 of file EventSystem.cc.
|
private |
private method used to retrieve the named EventReceiver object
Definition at line 235 of file EventSystem.cc.
|
private |
private method to retrieve a transmitter from the internal list
Definition at line 196 of file EventSystem.cc.
| void lsst.ctrl.events::EventSystem::publishEvent | ( | const std::string & | topicName, |
| Event & | event | ||
| ) |
send an event on a topic
| topicName | the topic to send messages to |
| event | the Event to send |
| Runtime | exception if the topic wasn't already registered using the createTransmitter method |
Definition at line 186 of file EventSystem.cc.
| Event * lsst.ctrl.events::EventSystem::receiveEvent | ( | const std::string & | topicName | ) |
blocking receive for events. Waits until an event is received for the topic specified in the constructor
| topicName | the topic to listen on |
Definition at line 211 of file EventSystem.cc.
| Event * lsst.ctrl.events::EventSystem::receiveEvent | ( | const std::string & | topicName, |
| const long | timeout | ||
| ) |
blocking receive for events, with timeout (in milliseconds). Waits until an event is received for the topic specified in the constructor, or until the timeout expires.
| topicName | the topic to listen on |
| timeout | the time in milliseconds to wait before returning |
Definition at line 223 of file EventSystem.cc.
|
staticprotected |
Definition at line 103 of file EventSystem.h.
|
staticprotected |
Definition at line 102 of file EventSystem.h.
|
protected |
Definition at line 106 of file EventSystem.h.
|
protected |
Definition at line 105 of file EventSystem.h.
|
staticprotected |
Definition at line 100 of file EventSystem.h.
1.8.5