RSB  0.7.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::transport::socket::InPullConnector Class Reference

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

#include <InPullConnector.h>

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

Public Member Functions

 InPullConnector (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 ~InPullConnector ()
void handle (rsb::EventPtr event)
 Handle event.
EventPtr raiseEvent (bool block)
- Public Member Functions inherited from 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.
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.
- 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 ()

Static Public Member Functions

static
rsb::transport::InPullConnector
create (const rsc::runtime::Properties &args)

Private Attributes

rsc::logging::LoggerPtr logger
rsc::threading::SynchronizedQueue
< EventPtr
queue

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
- Public Types inherited from rsb::transport::InPullConnector
typedef boost::shared_ptr
< InPullConnector
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

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 65 of file InPullConnector.h.

Constructor & Destructor Documentation

rsb::transport::socket::InPullConnector::InPullConnector ( 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 56 of file InPullConnector.cpp.

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

Reimplemented from rsb::transport::InPullConnector.

Definition at line 66 of file InPullConnector.cpp.

Member Function Documentation

static rsb::transport::InPullConnector* rsb::transport::socket::InPullConnector::create ( const rsc::runtime::Properties &  args)
static
void rsb::transport::socket::InPullConnector::handle ( rsb::EventPtr  event)
virtual

Handle event.

Parameters
eventThe event that should be handled.

Implements rsb::transport::socket::InConnector.

Definition at line 69 of file InPullConnector.cpp.

References rsb::transport::socket::ConnectorBase::active, rsb::transport::ConverterSelectingConnector< std::string >::getConverter(), and queue.

Here is the call graph for this function:

EventPtr rsb::transport::socket::InPullConnector::raiseEvent ( bool  block)
virtual

Implements rsb::transport::InPullConnector.

Definition at line 94 of file InPullConnector.cpp.

References queue.

Member Data Documentation

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

Definition at line 85 of file InPullConnector.h.

rsc::threading::SynchronizedQueue<EventPtr> rsb::transport::socket::InPullConnector::queue
private

Definition at line 87 of file InPullConnector.h.

Referenced by handle(), and raiseEvent().


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