RSB  0.15.1
rsb::transport::socket::LifecycledBusServer Class Reference

A facade around BusServer instances to allow breaking dependency cycles. More...

#include <LifecycledBusServer.h>

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

Public Member Functions

 LifecycledBusServer (BusServerPtr server)
 
virtual ~LifecycledBusServer ()
 
virtual void addSink (InConnectorPtr sink)
 
virtual void removeSink (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 AsioServiceContextPtr getService () const
 
void activate ()
 
void deactivate ()
 
void handleIncoming (EventPtr event, BusConnectionPtr connection)
 
virtual const std::string getTransportURL () const
 
virtual void printContents (std::ostream &stream) const
 
- Public Member Functions inherited from rsb::transport::socket::BusServer
 BusServer (AsioServiceContextPtr asioService, bool tcpnodelay)
 
virtual ~BusServer ()
 
- Public Member Functions inherited from rsb::transport::socket::Bus
 Bus (AsioServiceContextPtr asioService, bool tcpnodelay=false)
 
virtual ~Bus ()
 
- Public Member Functions inherited from rsb::eventprocessing::Handler
virtual ~Handler ()
 

Private Attributes

rsc::logging::LoggerPtr logger
 
BusServerPtr server
 

Additional Inherited Members

- Protected Types inherited from rsb::transport::socket::Bus
typedef std::list< BusConnectionPtrConnectionList
 
- Protected Member Functions inherited from rsb::transport::socket::Bus
ConnectionList getConnections () const
 
boost::recursive_mutex & getConnectionLock ()
 

Detailed Description

A facade around BusServer instances to allow breaking dependency cycles.

This implementation specifically calls deactivate on the underlying server instance in its destructor. This is known to break a dependency cycle in BusServerImpl which would otherwise prevent clean destruction through shared_ptr instances.

Apart from this behavior, all calls are passed to the underlying instance.

Author
jwienke

Definition at line 47 of file LifecycledBusServer.h.

Constructor & Destructor Documentation

rsb::transport::socket::LifecycledBusServer::LifecycledBusServer ( BusServerPtr  server)

Definition at line 37 of file LifecycledBusServer.cpp.

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

Definition at line 43 of file LifecycledBusServer.cpp.

References logger, and server.

Member Function Documentation

void rsb::transport::socket::LifecycledBusServer::activate ( )
virtual

Implements rsb::transport::socket::BusServer.

Definition at line 79 of file LifecycledBusServer.cpp.

References logger, and server.

void rsb::transport::socket::LifecycledBusServer::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.

Reimplemented from rsb::transport::socket::Bus.

Definition at line 59 of file LifecycledBusServer.cpp.

References server.

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

Reimplemented from rsb::transport::socket::Bus.

Definition at line 51 of file LifecycledBusServer.cpp.

References server.

void rsb::transport::socket::LifecycledBusServer::deactivate ( )
virtual

Implements rsb::transport::socket::BusServer.

Definition at line 84 of file LifecycledBusServer.cpp.

References logger, and server.

AsioServiceContextPtr rsb::transport::socket::LifecycledBusServer::getService ( ) const
virtual

Reimplemented from rsb::transport::socket::Bus.

Definition at line 75 of file LifecycledBusServer.cpp.

References server.

const string rsb::transport::socket::LifecycledBusServer::getTransportURL ( ) const
virtual

Reimplemented from rsb::transport::socket::Bus.

Definition at line 94 of file LifecycledBusServer.cpp.

References server.

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

Handle event.

Parameters
eventThe event that should be handled.

Reimplemented from rsb::transport::socket::Bus.

Definition at line 71 of file LifecycledBusServer.cpp.

References server.

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

Implements rsb::transport::socket::BusServer.

Definition at line 89 of file LifecycledBusServer.cpp.

References server.

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

Reimplemented from rsb::transport::socket::Bus.

Definition at line 67 of file LifecycledBusServer.cpp.

References server.

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

Reimplemented from rsb::transport::socket::Bus.

Definition at line 98 of file LifecycledBusServer.cpp.

References server.

void rsb::transport::socket::LifecycledBusServer::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.

Reimplemented from rsb::transport::socket::Bus.

Definition at line 63 of file LifecycledBusServer.cpp.

References server.

void rsb::transport::socket::LifecycledBusServer::removeSink ( InConnector sink)
virtual

Reimplemented from rsb::transport::socket::Bus.

Definition at line 55 of file LifecycledBusServer.cpp.

References server.

Member Data Documentation

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

Definition at line 77 of file LifecycledBusServer.h.

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


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