- Aldebaran documentation |
- C++ Libraries |
- index

libalcommon 2.8.7.4

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
AL::ALBrokerManager Class Reference
Broker

ALBrokerManager is a class to manage brokers. More...

`#include "alcommon/albrokermanager.h"`

## Public Member Functions
virtual | ~ALBrokerManager ()
| Destructor. More...
void | addBroker (boost::shared_ptr< ALBroker > pBroker)
| Add a Broker in the map of broker. More...
void | removeBroker (boost::shared_ptr< ALBroker > pBroker)
| Remove a broker from the map of broker. More...
void | removeFromList (boost::shared_ptr< ALBroker > pBroker)
| Remove a broker from the map of broker. More...
boost::shared_ptr< ALBroker > | getBrokerByName (const std::string &brokerName)
| Get the suitable broker. More...
boost::shared_ptr< ALBroker > | getRandomBroker (void)
| Get the first broker in the list. More...
boost::shared_ptr< ALBroker > | getBroker (int i)
| Get a broker from index. More...
boost::shared_ptr< ALBroker > | getBrokerByIPPort (const std::string &strEndPoint)
| Get a broker from IP and port address. More...
boost::shared_ptr< ALBroker > | getBrokerByIPPort (const std::string &strIP, int pPort)
| Get a broker by port address. More...
boost::shared_ptr< ALBroker > | getBrokerByParentIPPort (const std::string &strIP, int pPort)
| Get a broker by parent's broker port. More...
void | killAllBroker (void)
| Remove and shutdown all brokers. More...
boost::shared_ptr< ALBroker > | getReservedBroker (void)
| Create a empty broker. More...

## Static Public Member Functions
static boost::shared_ptr < ALBrokerManager > | getInstance ()
| Get the ALBrokerManager singleton. More...
static boost::shared_ptr < ALBrokerManager > | setInstance (boost::shared_ptr< ALBrokerManager > pSingleton)
| Set the ALBrokerManager singleton. More...
static void | kill ()
| Reset the ALBrokerManager singleton. More...

## Public Attributes
ALBrokerManagerPrivate * | _p

## Protected Member Functions
| ALBrokerManager ()
| Constructor. More...
| ALBrokerManager (const ALBrokerManager &)
ALBrokerManager & | operator= (const ALBrokerManager &)

## Detailed Description

ALBrokerManager is a class to manage brokers.

It should be only singleton with various main pointer.

Definition at line 32 of file albrokermanager.h.

## Constructor & Destructor Documentation

AL::ALBrokerManager::ALBrokerManager | ( |  | ) |
| protected

Constructor.

AL::ALBrokerManager::ALBrokerManager | ( | const ALBrokerManager & |  | ) |
| protected

virtual AL::ALBrokerManager::~ALBrokerManager | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

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.

Parameters

  pBroker | pointer to a broker

boost::shared_ptr<ALBroker> AL::ALBrokerManager::getBroker | ( | int | i | ) |

Get a broker from index.

Parameters

  i | index to the broker

Returns
  A pointer to the broker.

boost::shared_ptr<ALBroker> AL::ALBrokerManager::getBrokerByIPPort | ( | const std::string & | strEndPoint | ) |

Get a broker from IP and port address.

Parameters

  strEndPoint | broker's address, format "127.0.0.1:5559/"

Returns
  A pointer to the broker if we find it, a pointer to the first borker in the list otherwise.

boost::shared_ptr<ALBroker> AL::ALBrokerManager::getBrokerByIPPort | ( | const std::string & | strIP,
|  | int | pPort
| ) |  |

Get a broker by port address.

Parameters

  strIP | broker's IP (unused)
  pPort | broker's port

Returns
  A pointer to the broker if we find it, a pointer to the first borker in the list otherwise.

boost::shared_ptr<ALBroker> AL::ALBrokerManager::getBrokerByName | ( | const std::string & | brokerName | ) |

Get the suitable broker.

Parameters

  brokerName | name of wanted broker

boost::shared_ptr<ALBroker> AL::ALBrokerManager::getBrokerByParentIPPort | ( | const std::string & | strIP,
|  | int | pPort
| ) |  |

Get a broker by parent's broker port.

Parameters

  strIP | broker's IP (unused)
  pPort | parent's port the broker

Returns
  A pointer to the broker, boost::shared_ptr<ALBroker>() otherwise

static boost::shared_ptr<ALBrokerManager> AL::ALBrokerManager::getInstance | ( |  | ) |
| static

Get the ALBrokerManager singleton.

Returns
  A poitner to the instance of the ALBrokerManager

boost::shared_ptr<ALBroker> AL::ALBrokerManager::getRandomBroker | ( | void |  | ) |

Get the first broker in the list.

Returns
  A pointer to a broker, throw if broker's list is empty

Exceptions

  ALERROR |

boost::shared_ptr<ALBroker> AL::ALBrokerManager::getReservedBroker | ( | void |  | ) |

Create a empty broker.

Returns
  A pointer to a Broker

static void AL::ALBrokerManager::kill | ( |  | ) |
| static

Reset the ALBrokerManager singleton.

void AL::ALBrokerManager::killAllBroker | ( | void |  | ) |

Remove and shutdown all brokers.

Warning
  Program should not work any more after that.

ALBrokerManager& AL::ALBrokerManager::operator= | ( | const ALBrokerManager & |  | ) |
| protected

void AL::ALBrokerManager::removeBroker | ( | boost::shared_ptr< ALBroker > | pBroker | ) |

Remove a broker from the map of broker.

Warning
  It will also shutdown the broker.

Parameters

  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

Parameters

  pBroker | pointer to a broker

static boost::shared_ptr<ALBrokerManager> AL::ALBrokerManager::setInstance | ( | boost::shared_ptr< ALBrokerManager > | pSingleton | ) |
| static

Set the ALBrokerManager singleton.

Warning
  It will kill the old singleton to replace it by the new one

Parameters

  pSingleton | A pointer to a new ALBrokerManager

Returns
  A poitner to the new instance of the ALBrokerManager

## Member Data Documentation

ALBrokerManagerPrivate* AL::ALBrokerManager::_p

A pointer to the private implementation of ALBrokerManager.

Definition at line 151 of file albrokermanager.h.

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

- /home/opennao/work/release-2.8/sdk/libnaoqi/libalcommon/alcommon/albrokermanager.h