RSB  0.19.0
rsb::transport::socket::BusImpl Class Reference

#include <BusImpl.h>

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

Public Member Functions

 BusImpl (AsioServiceContextPtr asioService, bool tcpnodelay=false)
 
virtual ~BusImpl ()
 
virtual void addSink (InConnectorPtr sink)
 
virtual void removeSink (const InConnector *sink)
 
virtual void addConnection (BusConnectionPtr connection)
 Adds connection to the list of connections of the bus. More...
 
virtual void removeConnection (BusConnectionPtr connection)
 Removes connection from the list of connections of this bus. More...
 
virtual bool isTcpnodelay () const
 
virtual void handle (EventPtr event)
 Handle event. More...
 
virtual void handleIncoming (EventPtr event, BusConnectionPtr connection)
 
virtual void printContents (std::ostream &stream) const
 
virtual const std::string getTransportURL () const
 
- Public Member Functions inherited from rsb::transport::socket::Bus
virtual ~Bus ()
 
- Public Member Functions inherited from rsb::eventprocessing::Handler
virtual ~Handler ()
 

Protected Types

typedef std::list< BusConnectionPtrConnectionList
 

Protected Member Functions

ConnectionList getConnections () const
 
boost::recursive_mutex & getConnectionLock ()
 
virtual AsioServiceContextPtr getService () const
 

Private Types

typedef eventprocessing::WeakScopeDispatcher< InConnectorSinkDispatcher
 

Private Attributes

rsc::logging::LoggerPtr logger
 
AsioServiceContextPtr asioService
 
ConnectionList connections
 
boost::recursive_mutex connectionLock
 
SinkDispatcher sinkDispatcher
 
boost::recursive_mutex connectorLock
 
bool tcpnodelay
 

Friends

class BusConnection
 

Detailed Description

Author
jmoringe

Definition at line 63 of file BusImpl.h.

Member Typedef Documentation

Definition at line 102 of file BusImpl.h.

Constructor & Destructor Documentation

rsb::transport::socket::BusImpl::BusImpl ( AsioServiceContextPtr  asioService,
bool  tcpnodelay = false 
)

Definition at line 48 of file BusImpl.cpp.

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

Definition at line 53 of file BusImpl.cpp.

References connections, rsb::eventprocessing::ScopeDispatcher< T >::empty(), logger, sinkDispatcher, and rsb::eventprocessing::ScopeDispatcher< T >::size().

Here is the call graph for this function:

Member Function Documentation

void rsb::transport::socket::BusImpl::addConnection ( BusConnectionPtr  connection)
virtual

Adds connection to the list of connections of the bus.

connection should start receiving events, only after being added to the bus.

Parameters
connectionThe connection that should be added.

Implements rsb::transport::socket::Bus.

Definition at line 108 of file BusImpl.cpp.

References connectionLock, connections, and logger.

Referenced by rsb::transport::socket::BusServerImpl::handleAccept().

Here is the caller graph for this function:

void rsb::transport::socket::BusImpl::addSink ( InConnectorPtr  sink)
virtual

Implements rsb::transport::socket::Bus.

Definition at line 92 of file BusImpl.cpp.

References rsb::eventprocessing::ScopeDispatcher< T >::addSink(), connectorLock, logger, and sinkDispatcher.

Here is the call graph for this function:

boost::recursive_mutex & rsb::transport::socket::BusImpl::getConnectionLock ( )
protected

Definition at line 88 of file BusImpl.cpp.

References connectionLock.

Referenced by rsb::transport::socket::BusServerImpl::handleIncoming().

Here is the caller graph for this function:

BusImpl::ConnectionList rsb::transport::socket::BusImpl::getConnections ( ) const
protected

Definition at line 84 of file BusImpl.cpp.

References connections.

Referenced by rsb::transport::socket::BusServerImpl::handleIncoming().

Here is the caller graph for this function:

AsioServiceContextPtr rsb::transport::socket::BusImpl::getService ( ) const
protectedvirtual

Definition at line 76 of file BusImpl.cpp.

References asioService.

Referenced by rsb::transport::socket::BusServerImpl::acceptOne().

Here is the caller graph for this function:

const std::string rsb::transport::socket::BusImpl::getTransportURL ( ) const
virtual

Implements rsb::transport::socket::Bus.

Reimplemented in rsb::transport::socket::BusServerImpl.

Definition at line 215 of file BusImpl.cpp.

References connections.

void rsb::transport::socket::BusImpl::handle ( EventPtr  event)
virtual

Handle event.

Parameters
eventThe event that should be handled.

Implements rsb::transport::socket::Bus.

Definition at line 138 of file BusImpl.cpp.

References connectionLock, connections, connectorLock, event, rsb::transport::socket::InConnector::handle(), logger, rsb::eventprocessing::WeakScopeDispatcher< T >::mapSinks(), removeConnection(), and sinkDispatcher.

Here is the call graph for this function:

void rsb::transport::socket::BusImpl::handleIncoming ( EventPtr  event,
BusConnectionPtr  connection 
)
virtual

Implements rsb::transport::socket::Bus.

Reimplemented in rsb::transport::socket::BusServerImpl.

Definition at line 195 of file BusImpl.cpp.

References connectorLock, logger, rsb::eventprocessing::WeakScopeDispatcher< T >::mapSinks(), and sinkDispatcher.

Referenced by rsb::transport::socket::BusServerImpl::handleIncoming().

Here is the call graph for this function:

Here is the caller graph for this function:

bool rsb::transport::socket::BusImpl::isTcpnodelay ( ) const
virtual

Implements rsb::transport::socket::Bus.

Definition at line 80 of file BusImpl.cpp.

References tcpnodelay.

Referenced by rsb::transport::socket::BusServerImpl::handleAccept().

Here is the caller graph for this function:

void rsb::transport::socket::BusImpl::printContents ( std::ostream &  stream) const
virtual

Definition at line 210 of file BusImpl.cpp.

References connections, sinkDispatcher, and rsb::eventprocessing::ScopeDispatcher< T >::size().

Here is the call graph for this function:

void rsb::transport::socket::BusImpl::removeConnection ( BusConnectionPtr  connection)
virtual

Removes connection from the list of connections of this bus.

connection is not closed or otherwise modified.

Parameters
connectionThe connection that should be removed.

Implements rsb::transport::socket::Bus.

Definition at line 116 of file BusImpl.cpp.

References connectionLock, connections, and logger.

Referenced by handle(), and rsb::transport::socket::BusServerImpl::handleIncoming().

Here is the caller graph for this function:

void rsb::transport::socket::BusImpl::removeSink ( const InConnector sink)
virtual

Friends And Related Function Documentation

friend class BusConnection
friend

Definition at line 64 of file BusImpl.h.

Referenced by rsb::transport::socket::BusServerImpl::handleAccept().

Member Data Documentation

AsioServiceContextPtr rsb::transport::socket::BusImpl::asioService
private

Definition at line 115 of file BusImpl.h.

Referenced by getService().

boost::recursive_mutex rsb::transport::socket::BusImpl::connectionLock
private

Definition at line 118 of file BusImpl.h.

Referenced by addConnection(), getConnectionLock(), handle(), and removeConnection().

boost::recursive_mutex rsb::transport::socket::BusImpl::connectorLock
private

Definition at line 121 of file BusImpl.h.

Referenced by addSink(), handle(), handleIncoming(), and removeSink().

rsc::logging::LoggerPtr rsb::transport::socket::BusImpl::logger
private
SinkDispatcher rsb::transport::socket::BusImpl::sinkDispatcher
private

Definition at line 120 of file BusImpl.h.

Referenced by addSink(), handle(), handleIncoming(), printContents(), removeSink(), and ~BusImpl().

bool rsb::transport::socket::BusImpl::tcpnodelay
private

Definition at line 123 of file BusImpl.h.

Referenced by isTcpnodelay().


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