// Host Update // // Douglas Thrift // // $Id$ #ifndef _Host_hpp_ #define _Host_hpp_ #include "HostUpdate.hpp" #ifndef _WIN32 #include #include #include #include #else #include #include typedef unsigned long in_addr_t; #endif class Host { private: #ifdef _WIN32 static unsigned count; static WSADATA data; #endif string host; string name; struct in_addr address; string platform; public: Host(const string& host, const string& name = "", const string& address = "", const string& platform = "Unknown"); ~Host(); void setHost(const string& host) { this->host = host; } void setName(const string& name, bool lookup = false); void setAddress(const string& address, bool lookup = false); void setPlatform(const string& platform) { this->platform = platform; } string getHost() const { return host; } string getName() const { return name; } string getAddress() const { return inet_ntoa(address); } string getPlatform() const { return platform; } bool operator==(const Host& host) const; bool operator!=(const Host& host) const { return !(*this == host); } bool operator<(const Host& host) const { return this->host < host.host; } bool operator>(const Host& host) const { return this->host > host.host; } Host operator++(); Host operator++(int); Host operator--(); Host operator--(int); }; #endif // _Host_hpp_