/* */ #ifndef _D_DHT_PEER_ADDR_ENTRY_H_ #define _D_DHT_PEER_ADDR_ENTRY_H_ #include "common.h" #include "TimeA2.h" #include namespace aria2 { class PeerAddrEntry { private: std::string _ipaddr; uint16_t _port; Time _lastUpdated; public: PeerAddrEntry(const std::string& ipaddr, uint16_t port, Time updated = Time()): _ipaddr(ipaddr), _port(port), _lastUpdated(updated) {} const std::string& getIPAddress() const { return _ipaddr; } uint16_t getPort() const { return _port; } const Time& getLastUpdated() const { return _lastUpdated; } void notifyUpdate() { _lastUpdated.reset(); } bool operator==(const PeerAddrEntry& entry) const { return _ipaddr == entry._ipaddr && _port == entry._port; } }; } // namespace aria2 #endif // _D_DHT_PEER_ADDR_ENTRY_H_