source: trunk/FACT++/src/DimServerList.h@ 10572

Last change on this file since 10572 was 10427, checked in by tbretz, 14 years ago
Some paranoia change to the order of the data members to ensure proper destruction.
File size: 1.9 KB
Line 
1#ifndef FACT_DimServerList
2#define FACT_DimServerList
3
4#include <vector>
5#include <string>
6
7#include "dic.hxx"
8
9class DimServerList : public DimClient
10{
11public:
12 typedef std::vector<std::string> ServerList;
13
14private:
15 ServerList fServerList; /// A list with the available servers
16 DimInfo fDimServers; /// A DimInfo to retrieve the SERVER_LIST from teh DNS server
17
18 virtual void AddServer(const std::string &) { };
19 virtual void RemoveServer(const std::string &) { };
20 virtual void RemoveAllServers() { };
21
22protected:
23 void infoHandler();
24
25public:
26 DimServerList();
27
28 /// @returns a reference to the list of servers
29 const ServerList &GetServerList() const { return fServerList; }
30
31 /// @returns whether the given server is in the list or not
32 /// @param server string with the server which availability should be checked
33 bool HasServer(const std::string &server) const;
34};
35
36#endif
37
38// ***************************************************************************
39/** @fn DimServerList::AddServer(const std::string &server)
40
41This virtual function is called as a callback whenever a new server appears
42to be available on the dns.
43
44The default is to do nothing.
45
46@param server
47 Server name of the server which was added
48
49**/
50// ***************************************************************************
51/** @fn DimServerList::RemoveServer(const std::string &server)
52
53This virtual function is called as a callback whenever a server disappears
54from the dns.
55
56The default is to do nothing.
57
58@param server
59 Server name of the server which was removed
60
61
62**/
63// ***************************************************************************
64/** @fn DimServerList::RemoveAllServers()
65
66This virtual function is called as a callback whenever a all servers
67disappear, e.g. the dns has vanished.
68
69The default is to do nothing.
70
71
72**/
73// ***************************************************************************
Note: See TracBrowser for help on using the repository browser.