Eris
1.3.21
|
00001 #ifndef ERIS_SERVER_INFO_H 00002 #define ERIS_SERVER_INFO_H 00003 00004 #include <Atlas/Objects/ObjectsFwd.h> 00005 00006 #include <string> 00007 00008 namespace Eris { 00009 00010 class Meta; 00011 00021 class ServerInfo 00022 { 00023 public: 00024 ServerInfo(); 00025 00026 typedef enum { 00027 INVALID, 00028 QUERYING, 00029 VALID, 00030 TIMEOUT 00031 } Status; 00032 00033 // bookmark / favourites functionality 00034 00035 // accessors 00036 Status getStatus() const 00037 { return m_status; } 00038 00042 const std::string& getHostname() const 00043 { return _host; } 00044 00046 const std::string& getServername() const 00047 { return _name; } 00048 00050 const std::string& getRuleset() const 00051 { return _ruleset; } 00052 00054 const std::string& getServer() const 00055 { return _server; } 00056 00058 const std::string& getVersion() const 00059 { return m_version; } 00060 00062 const std::string& getBuildDate() const 00063 { return m_buildDate; } 00064 00066 int getNumClients() const 00067 { return _clients; } 00068 00072 int getPing() const 00073 { return _ping; } 00074 00076 double getUptime() const 00077 { return _uptime; } 00078 00080 long getEntities() const 00081 { return _entities; } 00082 00083 protected: 00084 friend class Meta; 00085 friend class Connection; 00086 00088 ServerInfo(const std::string &host); 00089 00092 void processServer(const Atlas::Objects::Entity::RootEntity &svr); 00093 00094 void setPing(int p); 00095 void setStatus(Status s); 00096 00097 private: 00098 Status m_status; 00099 00100 std::string _host; 00101 00102 std::string _name, 00103 _ruleset, 00104 _server; 00105 00106 int _clients; 00107 int _ping; 00108 long _entities; 00109 00110 double _uptime; 00111 00112 std::string m_version, 00113 m_buildDate; 00114 }; 00115 00116 } // of namespace Eris 00117 00118 #endif 00119