RSB  0.7.0
 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.
virtual ~ConnectorBase ()

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

Protected Attributes

volatile bool active

Private Attributes

rsc::logging::LoggerPtr logger
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 56 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 60 of file ConnectorBase.cpp.

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

Here is the call 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 75 of file ConnectorBase.cpp.

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

Referenced by ~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 86 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:

Member Data Documentation

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

Definition at line 105 of file ConnectorBase.h.

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

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

Definition at line 107 of file ConnectorBase.h.

Referenced by activate().

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

Definition at line 103 of file ConnectorBase.h.

Referenced by activate(), and deactivate().

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

Definition at line 108 of file ConnectorBase.h.

Referenced by activate().

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

Definition at line 109 of file ConnectorBase.h.

Referenced by activate().

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

Definition at line 110 of file ConnectorBase.h.

Referenced by activate().


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