RSB
0.15.1
|
The singleton instance of this class is responsible for managing bus provider objects. More...
#include <Factory.h>
Public Member Functions | |
Factory () | |
~Factory () | |
BusPtr | getBus (const Server &serverMode, const std::string &host, const boost::uint16_t &port, bool tcpnodelay) |
Returns either a BusClient or Server depending on the chosen serverMode and the existence of a server in the current process. More... | |
Private Types | |
typedef std::pair< std::string, boost::uint16_t > | Endpoint |
typedef boost::shared_ptr< boost::asio::ip::tcp::socket > | SocketPtr |
typedef boost::shared_ptr< boost::asio::io_service::work > | WorkPtr |
typedef std::map< Endpoint, boost::weak_ptr< Bus > > | BusClientMap |
typedef std::map< Endpoint, boost::weak_ptr< BusServer > > | BusServerMap |
Private Member Functions | |
BusPtr | getBusClientFor (const std::string &host, boost::uint16_t port, bool tcpnodelay) |
BusServerPtr | getBusServerFor (const std::string &host, boost::uint16_t port, bool tcpnodelay) |
template<class BusType > | |
boost::shared_ptr< BusType > | searchInMap (const Endpoint &endpoint, bool tcpnodelay, std::map< Endpoint, boost::weak_ptr< BusType > > &map) |
Searches inside a given map for an active pointer to a Bus instance matching the given query. More... | |
Static Private Member Functions | |
static void | checkOptions (BusPtr bus, bool tcpnodelay) |
Private Attributes | |
rsc::logging::LoggerPtr | logger |
BusClientMap | busClients |
BusServerMap | busServers |
boost::mutex | busMutex |
AsioServiceContextPtr | asioService |
The singleton instance of this class is responsible for managing bus provider objects.
For each endpoint (i.e. address and port), at most one client or server bus provider can exist.
|
private |
|
private |
|
private |
|
private |
|
private |
rsb::transport::socket::Factory::Factory | ( | ) |
Definition at line 55 of file Factory.cpp.
References logger.
rsb::transport::socket::Factory::~Factory | ( | ) |
Definition at line 61 of file Factory.cpp.
References logger.
|
staticprivate |
Definition at line 217 of file Factory.cpp.
Referenced by searchInMap().
BusPtr rsb::transport::socket::Factory::getBus | ( | const Server & | serverMode, |
const std::string & | host, | ||
const boost::uint16_t & | port, | ||
bool | tcpnodelay | ||
) |
Returns either a BusClient or Server depending on the chosen serverMode and the existence of a server in the current process.
Definition at line 190 of file Factory.cpp.
References busMutex, getBusClientFor(), getBusServerFor(), logger, rsb::transport::socket::SERVER_AUTO, rsb::transport::socket::SERVER_NO, and rsb::transport::socket::SERVER_YES.
|
private |
Definition at line 84 of file Factory.cpp.
References asioService, busClients, logger, and searchInMap().
Referenced by getBus().
|
private |
Definition at line 160 of file Factory.cpp.
References asioService, busServers, logger, and searchInMap().
Referenced by getBus().
|
private |
Searches inside a given map for an active pointer to a Bus instance matching the given query.
Definition at line 66 of file Factory.cpp.
References checkOptions(), and logger.
Referenced by getBusClientFor(), and getBusServerFor().
|
private |
Definition at line 91 of file Factory.h.
Referenced by getBusClientFor(), and getBusServerFor().
|
private |
Definition at line 87 of file Factory.h.
Referenced by getBusClientFor().
|
private |
|
private |
Definition at line 88 of file Factory.h.
Referenced by getBusServerFor().
|
private |
Definition at line 85 of file Factory.h.
Referenced by Factory(), getBus(), getBusClientFor(), getBusServerFor(), searchInMap(), and ~Factory().