libalcommon
1.14.5
|
ALBrokerManager is a class to manage brokers. More...
#include <alcommon/albrokermanager.h>
Public Member Functions | |
virtual | ~ALBrokerManager () |
Destructor. | |
void | addBroker (boost::shared_ptr< ALBroker > pBroker) |
Add a Broker in the map of broker. | |
void | removeBroker (boost::shared_ptr< ALBroker > pBroker) |
Remove a broker from the map of broker. | |
void | removeFromList (boost::shared_ptr< ALBroker > pBroker) |
Remove a broker from the map of broker. | |
boost::shared_ptr< ALBroker > | getRandomBroker (void) |
Get the first broker in the list. | |
boost::shared_ptr< ALBroker > | getBroker (int i) |
Get a broker from index. | |
boost::shared_ptr< ALBroker > | getBrokerByIPPort (const std::string &strEndPoint) |
Get a broker from IP and port address. | |
boost::shared_ptr< ALBroker > | getBrokerByIPPort (const std::string &strIP, int pPort) |
Get a broker by port address. | |
boost::shared_ptr< ALBroker > | getBrokerByParentIPPort (const std::string &strIP, int pPort) |
Get a broker by parent's broker port. | |
void | killAllBroker (void) |
Remove and shutdown all brokers. | |
boost::shared_ptr< ALBroker > | getReservedBroker (void) |
Create a empty broker. | |
Static Public Member Functions | |
static boost::shared_ptr < ALBrokerManager > | getInstance () |
Get the ALBrokerManager singleton. | |
static boost::shared_ptr < ALBrokerManager > | setInstance (boost::shared_ptr< ALBrokerManager > pSingleton) |
Set the ALBrokerManager singleton. | |
static void | kill () |
Reset the ALBrokerManager singleton. | |
Protected Member Functions | |
ALBrokerManager () | |
Constructor. |
ALBrokerManager is a class to manage brokers.
It should be only singleton with various main pointer.
Definition at line 31 of file albrokermanager.h.
void AL::ALBrokerManager::addBroker | ( | boost::shared_ptr< ALBroker > | pBroker | ) |
Add a Broker in the map of broker.
Add a broker to the map if it do not already exist.
pBroker | pointer to a broker |
boost::shared_ptr<ALBroker> AL::ALBrokerManager::getBroker | ( | int | i | ) |
Get a broker from index.
i | index to the broker |
boost::shared_ptr<ALBroker> AL::ALBrokerManager::getBrokerByIPPort | ( | const std::string & | strEndPoint | ) |
Get a broker from IP and port address.
strEndPoint | broker's address, format "127.0.0.1:5559/" |
boost::shared_ptr<ALBroker> AL::ALBrokerManager::getBrokerByIPPort | ( | const std::string & | strIP, |
int | pPort | ||
) |
Get a broker by port address.
strIP | broker's IP (unused) |
pPort | broker's port |
boost::shared_ptr<ALBroker> AL::ALBrokerManager::getBrokerByParentIPPort | ( | const std::string & | strIP, |
int | pPort | ||
) |
Get a broker by parent's broker port.
strIP | broker's IP (unused) |
pPort | parent's port the broker |
static boost::shared_ptr<ALBrokerManager> AL::ALBrokerManager::getInstance | ( | ) | [static] |
Get the ALBrokerManager singleton.
boost::shared_ptr<ALBroker> AL::ALBrokerManager::getRandomBroker | ( | void | ) |
Get the first broker in the list.
ALERROR |
boost::shared_ptr<ALBroker> AL::ALBrokerManager::getReservedBroker | ( | void | ) |
Create a empty broker.
void AL::ALBrokerManager::killAllBroker | ( | void | ) |
Remove and shutdown all brokers.
void AL::ALBrokerManager::removeBroker | ( | boost::shared_ptr< ALBroker > | pBroker | ) |
Remove a broker from the map of broker.
pBroker | pointer to a broker |
void AL::ALBrokerManager::removeFromList | ( | boost::shared_ptr< ALBroker > | pBroker | ) |
Remove a broker from the map of broker.
It won't shutdown of the broker
pBroker | pointer to a broker |
static boost::shared_ptr<ALBrokerManager> AL::ALBrokerManager::setInstance | ( | boost::shared_ptr< ALBrokerManager > | pSingleton | ) | [static] |
Set the ALBrokerManager singleton.
pSingleton | A pointer to a new ALBrokerManager |