/* */ #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_