/* */ #ifndef _D_DHT_PEER_ADDR_ENTRY_H_ #define _D_DHT_PEER_ADDR_ENTRY_H_ #include "common.h" #include "TimeA2.h" class PeerAddrEntry { private: string _ipaddr; uint16_t _port; Time _lastUpdated; public: PeerAddrEntry(const string& ipaddr, uint16_t port, Time updated = Time()): _ipaddr(ipaddr), _port(port), _lastUpdated(updated) {} const 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; } }; typedef deque PeerAddrEntries; #endif // _D_DHT_PEER_ADDR_ENTRY_H_