RSB  0.19.0
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 (FactoryPtr factory, 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)
 
virtual const std::string getTransportURL () const
 

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
 
FactoryPtr factory
 
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 59 of file ConnectorBase.h.

Constructor & Destructor Documentation

rsb::transport::socket::ConnectorBase::ConnectorBase ( FactoryPtr  factory,
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 56 of file ConnectorBase.cpp.

References active, deactivate(), and logger.

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 79 of file ConnectorBase.cpp.

References active, bus, factory, 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
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 101 of file ConnectorBase.cpp.

References bus.

Referenced by rsb::transport::socket::InConnector::activate(), activate(), rsb::transport::socket::InConnector::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 64 of file ConnectorBase.cpp.

References scope.

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

Here is the caller graph for this function:

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

Member Data Documentation

BusPtr rsb::transport::socket::ConnectorBase::bus
private
FactoryPtr rsb::transport::socket::ConnectorBase::factory
private

Definition at line 119 of file ConnectorBase.h.

Referenced by activate().

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

Definition at line 121 of file ConnectorBase.h.

Referenced by activate().

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

Definition at line 113 of file ConnectorBase.h.

Referenced by activate(), deactivate(), and ~ConnectorBase().

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

Definition at line 122 of file ConnectorBase.h.

Referenced by activate().

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

Definition at line 115 of file ConnectorBase.h.

Referenced by getScope(), and setScope().

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

Definition at line 123 of file ConnectorBase.h.

Referenced by activate().

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

Definition at line 124 of file ConnectorBase.h.

Referenced by activate().


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