RSB  0.19.0
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 (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...
 
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
virtual ~BusServer ()
 
- Public Member Functions inherited from rsb::transport::socket::Bus
virtual ~Bus ()
 
- Public Member Functions inherited from rsb::eventprocessing::Handler
virtual ~Handler ()
 

Private Attributes

rsc::logging::LoggerPtr logger
 
BusServerPtr server
 

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 50 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 42 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 74 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.

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

Definition at line 58 of file LifecycledBusServer.cpp.

References server.

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

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

Definition at line 50 of file LifecycledBusServer.cpp.

References server.

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

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

Definition at line 79 of file LifecycledBusServer.cpp.

References logger, and server.

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

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

Definition at line 89 of file LifecycledBusServer.cpp.

References server.

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

Handle event.

Parameters
eventThe event that should be handled.

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

Definition at line 70 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 84 of file LifecycledBusServer.cpp.

References server.

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

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

Definition at line 66 of file LifecycledBusServer.cpp.

References server.

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

Definition at line 93 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.

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

Definition at line 62 of file LifecycledBusServer.cpp.

References server.

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

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

Definition at line 54 of file LifecycledBusServer.cpp.

References server.

Member Data Documentation

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

Definition at line 78 of file LifecycledBusServer.h.

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


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