Eris 1.3.18
ServerInfo.h
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         
00079 protected:
00080     friend class Meta;
00081     friend class Connection;
00082     
00084     ServerInfo(const std::string &host);
00085     
00088     void processServer(const Atlas::Objects::Entity::RootEntity &svr);
00089 
00090     void setPing(int p);
00091         void setStatus(Status s);
00092     
00093 private:
00094     Status m_status;
00095     
00096     std::string _host;          
00097 
00098     std::string _name,          
00099             _ruleset,   
00100             _server;    
00101     
00102     int _clients;               
00103     int _ping;                  
00104     
00105     double _uptime;             
00106     
00107     std::string m_version,
00108         m_buildDate;
00109 };
00110 
00111 } // of namespace Eris
00112 
00113 #endif
00114