Eris  1.3.19
ServerInfo.h
1 #ifndef ERIS_SERVER_INFO_H
2 #define ERIS_SERVER_INFO_H
3 
4 #include <Atlas/Objects/ObjectsFwd.h>
5 
6 #include <string>
7 
8 namespace Eris {
9 
10 class Meta;
11 
22 {
23 public:
24  ServerInfo();
25 
26  typedef enum {
27  INVALID,
28  QUERYING,
29  VALID,
31  } Status;
32 
33  // bookmark / favourites functionality
34 
35 // accessors
36  Status getStatus() const
37  { return m_status; }
38 
42  const std::string& getHostname() const
43  { return _host; }
44 
46  const std::string& getServername() const
47  { return _name; }
48 
50  const std::string& getRuleset() const
51  { return _ruleset; }
52 
54  const std::string& getServer() const
55  { return _server; }
56 
58  const std::string& getVersion() const
59  { return m_version; }
60 
62  const std::string& getBuildDate() const
63  { return m_buildDate; }
64 
66  int getNumClients() const
67  { return _clients; }
68 
72  int getPing() const
73  { return _ping; }
74 
76  double getUptime() const
77  { return _uptime; }
78 
79 protected:
80  friend class Meta;
81  friend class Connection;
82 
84  ServerInfo(const std::string &host);
85 
88  void processServer(const Atlas::Objects::Entity::RootEntity &svr);
89 
90  void setPing(int p);
91  void setStatus(Status s);
92 
93 private:
94  Status m_status;
95 
96  std::string _host;
97 
98  std::string _name,
99  _ruleset,
100  _server;
101 
102  int _clients;
103  int _ping;
104 
105  double _uptime;
106 
107  std::string m_version,
108  m_buildDate;
109 };
110 
111 } // of namespace Eris
112 
113 #endif
114