40 std::string service_instance;
44 Entry(
const std::string& service,
const std::string host,
45 const std::string& _ip,
const std::string _port)
46 : service_instance(service), hostname(host), ip(_ip), port(_port) {}
69 bool Add(
const std::string& service,
const std::string& host,
70 const std::string& _ip,
const std::string& _port);
77 bool Add(
const std::string& _ip,
const std::string& _port);
80 const std::vector<Entry>&
GetCache()
const {
return m_cache; }
83 mutable std::mutex m_mutex;
84 std::vector<Entry> m_cache;
Singleton cache for hosts looked up using mdns.
bool Add(const Entry &entry)
Add new entry to the cache.
void Validate()
Check that all entries are accessible, remove stale ones.
const std::vector< Entry > & GetCache() const
Return read-only cached entries reference.