libalcommon  2.1.4.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
albrokermanager.h
Go to the documentation of this file.
1 
10 #pragma once
11 #ifndef _LIBALCOMMON_ALCOMMON_ALBROKERMANAGER_H_
12 #define _LIBALCOMMON_ALCOMMON_ALBROKERMANAGER_H_
13 
14 # include <alcommon/api.h>
15 # include <vector>
16 # include <boost/shared_ptr.hpp>
17 
18 # define MAXBROKER 10
20 namespace AL
21 {
22  class ALBroker;
23  class ALBrokerManagerPrivate;
24 
33  {
34  protected:
38  ALBrokerManager &operator=(const ALBrokerManager &);
39  public:
41  virtual ~ALBrokerManager();
42 
49  void addBroker(boost::shared_ptr<ALBroker> pBroker);
50 
56  void removeBroker(boost::shared_ptr<ALBroker> pBroker);
57 
64  void removeFromList(boost::shared_ptr<ALBroker> pBroker);
65 
71  boost::shared_ptr<ALBroker> getBrokerByName(const std::string &brokerName);
72 
78  boost::shared_ptr<ALBroker> getRandomBroker(void);
79 
85  boost::shared_ptr<ALBroker> getBroker(int i);
86 
93  boost::shared_ptr<ALBroker> getBrokerByIPPort(const std::string &strEndPoint);
94 
95 
103  boost::shared_ptr<ALBroker> getBrokerByIPPort(const std::string &strIP,
104  int pPort);
105 
112  boost::shared_ptr<ALBroker> getBrokerByParentIPPort(const std::string &strIP, int pPort);
113 
118  void killAllBroker(void);
119 
124  boost::shared_ptr<ALBroker> getReservedBroker(void);
125 
130  static boost::shared_ptr<ALBrokerManager> getInstance();
131 
138  static boost::shared_ptr<ALBrokerManager> setInstance(boost::shared_ptr<ALBrokerManager> pSingleton);
139 
143  static void kill();
144 
145  private:
147  static boost::shared_ptr<ALBrokerManager> *_singleton;
148 
149  public:
151  ALBrokerManagerPrivate *_p;
152  };
153 } // !namespace AL
154 #endif // _LIBALCOMMON_ALCOMMON_ALBROKERMANAGER_H_
ALBrokerManagerPrivate * _p
ALBrokerManager is a class to manage brokers.