RSB
0.7.0
|
A Reader receives events published by a informers by participating in a channel with a suitable scope. More...
#include <Reader.h>
Public Member Functions | |
Reader (const std::vector< transport::InPullConnectorPtr > &connectors, const Scope &scope, const ParticipantConfig &config) | |
Constructs a new reader object assigned to scope. | |
EventPtr | read (bool block=true) |
Reads one event from the bus. | |
Public Member Functions inherited from rsb::Participant | |
virtual | ~Participant () |
void | printContents (std::ostream &stream) const |
rsc::misc::UUID | getId () const |
Returns the unique id of the participant. | |
ScopePtr | getScope () const |
Returns the scope of this participant. | |
ParticipantConfig | getConfig () const |
Returns a copy of the participant's configuration. |
Private Member Functions | |
std::string | getClassName () const |
Private Attributes | |
rsc::logging::LoggerPtr | logger |
eventprocessing::InRouteConfiguratorPtr | configurator |
Additional Inherited Members | |
Protected Member Functions inherited from rsb::Participant | |
Participant (const Scope &scope, const ParticipantConfig &config) |
A Reader receives events published by a informers by participating in a channel with a suitable scope.
In contrast to the Listener participant, a Reader receives events using a pull-style interface: the read method has to be explicitly in order to receive events. This method may then block (depending on the block parameter) until an event becomes available. The received event, if any, is returned to the caller. There are no context swichtes or queuing involved.
Usage example:
rsb::Reader::Reader | ( | const std::vector< transport::InPullConnectorPtr > & | connectors, |
const Scope & | scope, | ||
const ParticipantConfig & | config | ||
) |
Constructs a new reader object assigned to scope.
The reader connects to the bus using the supplied connectors.
connectors | a list of connectors that the reader should use to communicate with the bus. |
scope | the scope where the data is received from. |
config | the configuration that was used to setup this listener |
Definition at line 41 of file Reader.cpp.
References configurator.
|
private |
Definition at line 60 of file Reader.cpp.
EventPtr rsb::Reader::read | ( | bool | block = true | ) |
Reads one event from the bus.
If block is true, blocks until an event is available. If block is false and no event is available, an empty EventPtr is returned.
block | Controls whether the call should block and wait for an event if no event is immediately available. |
RSBError | when a communication error occurs while receiving or decoding the event. |
Definition at line 53 of file Reader.cpp.
References configurator.
|
private |