RSB  0.9.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::transport::socket::InConnector Class Referenceabstract

Instances of this class receive events from a bus that is accessed via a socket connection. More...

#include <InConnector.h>

Inheritance diagram for rsb::transport::socket::InConnector:
Inheritance graph
Collaboration diagram for rsb::transport::socket::InConnector:
Collaboration graph

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. More...
 
virtual ~InConnector ()
 
virtual void activate ()
 
virtual void deactivate ()
 
void setQualityOfServiceSpecs (const QualityOfServiceSpec &specs)
 Requests new QoS settings for publishing events. More...
 
virtual void handle (EventPtr event)=0
 Handle event. More...
 
- 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. More...
 
virtual ~ConnectorBase ()
 
virtual Scope getScope () const
 
virtual void setScope (const Scope &scope)
 
- Public Member Functions inherited from rsb::transport::Connector
virtual ~Connector ()
 
virtual void setScope (const Scope &scope)=0
 Sets the scope this connector will send/receive events to/from. More...
 
- Public Member Functions inherited from rsb::filter::FilterObserver
 FilterObserver ()
 
virtual ~FilterObserver ()
 
virtual void notify (Filter *filter, const FilterAction::Types &at)
 
virtual void notify (ScopeFilter *filter, const FilterAction::Types &at)
 
- 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
 

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. More...
 
- Protected Member Functions inherited from rsb::transport::ConverterSelectingConnector< std::string >
 ConverterSelectingConnector (ConverterSelectionStrategyPtr converters)
 
ConverterPtr getConverter (const std::string &key) const
 Try to find a suitable converter for key . More...
 
- Protected Attributes inherited from rsb::transport::socket::ConnectorBase
volatile bool active
 

Detailed Description

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).

Author
jmoringe

Definition at line 60 of file InConnector.h.

Constructor & Destructor Documentation

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.

Parameters
convertersA strategy for converter selection within the newly created connector.
hostThe host of the socket through which the newly created connector will operate.
portThe port of the socket through which the newly created connector will operate.
serverControls 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).
tcpnodelayControls 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.

rsb::transport::socket::InConnector::~InConnector ( )
virtual

Reimplemented from rsb::transport::InConnector.

Definition at line 53 of file InConnector.cpp.

References rsb::transport::socket::ConnectorBase::active, and deactivate().

Here is the call graph for this function:

Member Function Documentation

void rsb::transport::socket::InConnector::activate ( )
virtual

Reimplemented from rsb::transport::socket::ConnectorBase.

Definition at line 59 of file InConnector.cpp.

References rsb::transport::socket::ConnectorBase::activate(), rsb::transport::socket::ConnectorBase::getBus(), and logger.

Here is the call graph for this function:

void rsb::transport::socket::InConnector::deactivate ( )
virtual

Reimplemented from rsb::transport::socket::ConnectorBase.

Definition at line 67 of file InConnector.cpp.

References rsb::transport::socket::ConnectorBase::bus, rsb::transport::socket::ConnectorBase::deactivate(), rsb::transport::socket::ConnectorBase::getBus(), and logger.

Referenced by ~InConnector().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void rsb::transport::socket::InConnector::handle ( EventPtr  event)
pure virtual

Handle event.

Parameters
eventThe event that should be handled.

Implements rsb::eventprocessing::Handler.

Implemented in rsb::transport::socket::InPullConnector, and rsb::transport::socket::InPushConnector.

void rsb::transport::socket::InConnector::printContents ( std::ostream &  stream) const
private

Definition at line 83 of file InConnector.cpp.

References rsb::transport::socket::ConnectorBase::getScope().

Here is the call graph for this function:

void rsb::transport::socket::InConnector::setQualityOfServiceSpecs ( const QualityOfServiceSpec specs)
virtual

Requests new QoS settings for publishing events.

Does not influence the receiving part.

Parameters
specsQoS specification
Exceptions
UnsupportedQualityOfServiceExceptionrequirements cannot be met

Implements rsb::transport::Connector.

Definition at line 79 of file InConnector.cpp.

References logger.

Member Data Documentation

rsc::logging::LoggerPtr rsb::transport::socket::InConnector::logger
private

Definition at line 82 of file InConnector.h.

Referenced by activate(), deactivate(), and setQualityOfServiceSpecs().


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