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

This class is intended to be used as a base class for connector classes of the socket-based transport. More...

#include <ConnectorBase.h>

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

Public Member Functions

 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)
 

Protected Member Functions

virtual void activate ()
 
virtual void deactivate ()
 
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

volatile bool active
 

Private Attributes

rsc::logging::LoggerPtr logger
 
Scope scope
 
BusPtr bus
 
std::string host
 
unsigned int port
 
Server server
 
bool tcpnodelay
 

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
 

Detailed Description

This class is intended to be used as a base class for connector classes of the socket-based transport.

It provides establishing and managing a connection to the bus via an instance of the Bus class.

Author
jmoringe

Definition at line 58 of file ConnectorBase.h.

Constructor & Destructor Documentation

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.

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 ConnectorBase.cpp.

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

Definition at line 54 of file ConnectorBase.cpp.

References active, and deactivate().

Here is the call graph for this function:

Member Function Documentation

void rsb::transport::socket::ConnectorBase::activate ( )
protectedvirtual

Reimplemented in rsb::transport::socket::InConnector, and rsb::transport::socket::OutConnector.

Definition at line 71 of file ConnectorBase.cpp.

References active, bus, rsb::transport::socket::Factory::getBus(), getBus(), host, logger, port, server, and tcpnodelay.

Referenced by rsb::transport::socket::OutConnector::activate(), and rsb::transport::socket::InConnector::activate().

Here is the call graph for this function:

Here is the caller graph for this function:

void rsb::transport::socket::ConnectorBase::deactivate ( )
protectedvirtual

Reimplemented in rsb::transport::socket::InConnector, and rsb::transport::socket::OutConnector.

Definition at line 86 of file ConnectorBase.cpp.

References active, bus, getBus(), and logger.

Referenced by rsb::transport::socket::OutConnector::deactivate(), rsb::transport::socket::InConnector::deactivate(), and ~ConnectorBase().

Here is the call graph for this function:

Here is the caller graph for this function:

BusPtr rsb::transport::socket::ConnectorBase::getBus ( )
protected

Return the Bus object through which this connector is connected to a socket-based bus.

Returns
a shared_pointer to the bus object.

Definition at line 100 of file ConnectorBase.cpp.

References bus.

Referenced by rsb::transport::socket::InConnector::activate(), activate(), rsb::transport::socket::InConnector::deactivate(), deactivate(), and rsb::transport::socket::OutConnector::handle().

Here is the caller graph for this function:

Scope rsb::transport::socket::ConnectorBase::getScope ( ) const
virtual

Definition at line 60 of file ConnectorBase.cpp.

References scope.

Referenced by rsb::transport::socket::InConnector::printContents(), and rsb::transport::socket::Bus::removeSink().

Here is the caller graph for this function:

void rsb::transport::socket::ConnectorBase::setScope ( const Scope scope)
virtual

Member Data Documentation

BusPtr rsb::transport::socket::ConnectorBase::bus
private
std::string rsb::transport::socket::ConnectorBase::host
private

Definition at line 114 of file ConnectorBase.h.

Referenced by activate().

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

Definition at line 108 of file ConnectorBase.h.

Referenced by activate(), and deactivate().

unsigned int rsb::transport::socket::ConnectorBase::port
private

Definition at line 115 of file ConnectorBase.h.

Referenced by activate().

Scope rsb::transport::socket::ConnectorBase::scope
private

Definition at line 110 of file ConnectorBase.h.

Referenced by getScope(), and setScope().

Server rsb::transport::socket::ConnectorBase::server
private

Definition at line 116 of file ConnectorBase.h.

Referenced by activate().

bool rsb::transport::socket::ConnectorBase::tcpnodelay
private

Definition at line 117 of file ConnectorBase.h.

Referenced by activate().


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