RSB
0.7.0
|
Instances of this class receive events from a bus that is accessed via a socket connection. More...
#include <InConnector.h>
Public Member Functions | |
InConnector (ConverterSelectionStrategyPtr converters, const std::string &host, unsigned int port, Server server, bool tcpnodelay) | |
Creates a connector for the given combination of host, port and server. | |
virtual | ~InConnector () |
Scope | getScope () const |
void | setScope (const Scope &scope) |
Sets the scope this connector will receive events from. | |
virtual void | activate () |
virtual void | deactivate () |
void | setQualityOfServiceSpecs (const QualityOfServiceSpec &specs) |
Requests new QoS settings for publishing events. | |
virtual void | handle (EventPtr event)=0 |
Handle event. | |
Public Member Functions inherited from rsb::transport::socket::ConnectorBase | |
ConnectorBase (ConverterSelectionStrategyPtr converters, const std::string &host, unsigned int port, Server server, bool tcpnodelay) | |
Creates a connector for the given combination of host, port and server. | |
virtual | ~ConnectorBase () |
Public Member Functions inherited from rsb::eventprocessing::Handler | |
virtual | ~Handler () |
Private Member Functions | |
void | printContents (std::ostream &stream) const |
Private Attributes | |
rsc::logging::LoggerPtr | logger |
Scope | scope |
Additional Inherited Members | |
Public Types inherited from rsb::transport::ConverterSelectingConnector< std::string > | |
typedef converter::Converter < std::string >::Ptr | ConverterPtr |
typedef converter::ConverterSelectionStrategy < std::string >::Ptr | ConverterSelectionStrategyPtr |
Public Types inherited from rsb::transport::InConnector | |
typedef boost::shared_ptr < InConnector > | Ptr |
Protected Member Functions inherited from rsb::transport::socket::ConnectorBase | |
BusPtr | getBus () |
Return the Bus object through which this connector is connected to a socket-based bus. | |
Protected Attributes inherited from rsb::transport::socket::ConnectorBase | |
volatile bool | active |
Instances of this class receive events from a bus that is accessed via a socket connection.
The receiving and dispatching of events is done in push mode: each instance has a BusConnection which pushes appropriate events into the instance. The connector deserializes event payloads and pushes the events into handlers (usually objects which implement EventReceivingStrategy).
Definition at line 62 of file InConnector.h.
rsb::transport::socket::InConnector::InConnector | ( | ConverterSelectionStrategyPtr | converters, |
const std::string & | host, | ||
unsigned int | port, | ||
Server | server, | ||
bool | tcpnodelay | ||
) |
Creates a connector for the given combination of host, port and server.
converters | A strategy for converter selection within the newly created connector. |
host | The host of the socket through which the newly created connector will operate. |
port | The port of the socket through which the newly created connector will operate. |
server | Controls whether the newly created connector should create a listening socket and wait for connections (value SERVER_YES), connect to an existing listen socket (value SERVER_NO) or try to automatically determine whether there already is a listening socket and create one only if necessary (value SERVER_AUTO). |
tcpnodelay | Controls whether the TCP_NODELAY socket option should be set for the socket implementing the communication of the newly created connector. Setting this option trades decreased latency for decreased throughput. |
Definition at line 44 of file InConnector.cpp.
|
virtual |
Reimplemented from rsb::transport::InConnector.
Definition at line 53 of file InConnector.cpp.
References rsb::transport::socket::ConnectorBase::active, and deactivate().
|
virtual |
Reimplemented from rsb::transport::socket::ConnectorBase.
Definition at line 70 of file InConnector.cpp.
References rsb::transport::socket::ConnectorBase::getBus(), and logger.
|
virtual |
Reimplemented from rsb::transport::socket::ConnectorBase.
Definition at line 78 of file InConnector.cpp.
References rsb::transport::socket::ConnectorBase::getBus(), and logger.
Referenced by ~InConnector(), and rsb::spread::InPushConnector::~InPushConnector().
Scope rsb::transport::socket::InConnector::getScope | ( | ) | const |
Definition at line 59 of file InConnector.cpp.
References scope.
Referenced by rsb::transport::socket::Bus::removeSink().
|
pure virtual |
Handle event.
event | The event that should be handled. |
Implements rsb::eventprocessing::Handler.
Implemented in rsb::transport::socket::InPullConnector, and rsb::transport::socket::InPushConnector.
|
private |
Definition at line 91 of file InConnector.cpp.
References scope.
|
virtual |
Requests new QoS settings for publishing events.
Does not influence the receiving part.
specs | QoS specification |
UnsupportedQualityOfServiceException | requirements cannot be met |
Implements rsb::transport::Connector.
Definition at line 87 of file InConnector.cpp.
References logger.
|
virtual |
Sets the scope this connector will receive events from.
scope | scope of the connector |
Implements rsb::transport::InConnector.
Definition at line 63 of file InConnector.cpp.
References rsb::transport::socket::ConnectorBase::active, and scope.
Referenced by rsb::spread::InPushConnector::activate().
|
private |
Definition at line 87 of file InConnector.h.
Referenced by activate(), deactivate(), and setQualityOfServiceSpecs().
|
private |
Definition at line 89 of file InConnector.h.
Referenced by getScope(), printContents(), and setScope().