ServerInfo.h

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

Generated on Sun Aug 19 18:51:26 2007 for Eris by  doxygen 1.5.2