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