/* */ #ifndef _D_DHT_PEER_ADDR_ENTRY_H_ #define _D_DHT_PEER_ADDR_ENTRY_H_ #include "common.h" #include #include "TimerA2.h" namespace aria2 { class PeerAddrEntry { private: std::string _ipaddr; uint16_t _port; Timer _lastUpdated; public: PeerAddrEntry (const std::string& ipaddr, uint16_t port, Timer updated = Timer()): _ipaddr(ipaddr), _port(port), _lastUpdated(updated) {} const std::string& getIPAddress() const { return _ipaddr; } uint16_t getPort() const { return _port; } const Timer& 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_