RSB
0.19.0
|
#include <BusImpl.h>
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< BusConnectionPtr > | ConnectionList |
Protected Member Functions | |
ConnectionList | getConnections () const |
boost::recursive_mutex & | getConnectionLock () |
virtual AsioServiceContextPtr | getService () const |
Private Types | |
typedef eventprocessing::WeakScopeDispatcher< InConnector > | SinkDispatcher |
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 |
|
protected |
rsb::transport::socket::BusImpl::BusImpl | ( | AsioServiceContextPtr | asioService, |
bool | tcpnodelay = false |
||
) |
Definition at line 48 of file BusImpl.cpp.
|
virtual |
Definition at line 53 of file BusImpl.cpp.
References connections, rsb::eventprocessing::ScopeDispatcher< T >::empty(), logger, sinkDispatcher, and rsb::eventprocessing::ScopeDispatcher< T >::size().
|
virtual |
Adds connection to the list of connections of the bus.
connection should start receiving events, only after being added to the bus.
connection | The 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().
|
virtual |
Implements rsb::transport::socket::Bus.
Definition at line 92 of file BusImpl.cpp.
References rsb::eventprocessing::ScopeDispatcher< T >::addSink(), connectorLock, logger, and sinkDispatcher.
|
protected |
Definition at line 88 of file BusImpl.cpp.
References connectionLock.
Referenced by rsb::transport::socket::BusServerImpl::handleIncoming().
|
protected |
Definition at line 84 of file BusImpl.cpp.
References connections.
Referenced by rsb::transport::socket::BusServerImpl::handleIncoming().
|
protectedvirtual |
Definition at line 76 of file BusImpl.cpp.
References asioService.
Referenced by rsb::transport::socket::BusServerImpl::acceptOne().
|
virtual |
Implements rsb::transport::socket::Bus.
Reimplemented in rsb::transport::socket::BusServerImpl.
Definition at line 215 of file BusImpl.cpp.
References connections.
|
virtual |
Handle event.
event | The 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.
|
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().
|
virtual |
Implements rsb::transport::socket::Bus.
Definition at line 80 of file BusImpl.cpp.
References tcpnodelay.
Referenced by rsb::transport::socket::BusServerImpl::handleAccept().
|
virtual |
Definition at line 210 of file BusImpl.cpp.
References connections, sinkDispatcher, and rsb::eventprocessing::ScopeDispatcher< T >::size().
|
virtual |
Removes connection from the list of connections of this bus.
connection is not closed or otherwise modified.
connection | The 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().
|
virtual |
Implements rsb::transport::socket::Bus.
Definition at line 100 of file BusImpl.cpp.
References connectorLock, rsb::transport::socket::ConnectorBase::getScope(), logger, rsb::eventprocessing::WeakScopeDispatcher< T >::removeSink(), and sinkDispatcher.
|
friend |
Definition at line 64 of file BusImpl.h.
Referenced by rsb::transport::socket::BusServerImpl::handleAccept().
|
private |
Definition at line 115 of file BusImpl.h.
Referenced by getService().
|
private |
Definition at line 118 of file BusImpl.h.
Referenced by addConnection(), getConnectionLock(), handle(), and removeConnection().
|
private |
Definition at line 117 of file BusImpl.h.
Referenced by addConnection(), getConnections(), getTransportURL(), handle(), rsb::transport::socket::BusServerImpl::handleIncoming(), printContents(), removeConnection(), and ~BusImpl().
|
private |
Definition at line 121 of file BusImpl.h.
Referenced by addSink(), handle(), handleIncoming(), and removeSink().
|
private |
Definition at line 111 of file BusImpl.h.
Referenced by addConnection(), addSink(), handle(), handleIncoming(), removeConnection(), removeSink(), and ~BusImpl().
|
private |
Definition at line 120 of file BusImpl.h.
Referenced by addSink(), handle(), handleIncoming(), printContents(), removeSink(), and ~BusImpl().
|
private |
Definition at line 123 of file BusImpl.h.
Referenced by isTcpnodelay().