OpenCPN Partial API docs
|
Singleton cache for hosts looked up using mdns. More...
#include <mdns_cache.h>
Classes | |
struct | Entry |
Public Member Functions | |
MdnsCache & | operator= (MdnsCache &)=delete |
MdnsCache (const MdnsCache &)=delete | |
void | Validate () |
Check that all entries are accessible, remove stale ones. | |
bool | Add (const Entry &entry) |
Add new entry to the cache. | |
bool | Add (const std::string &service, const std::string &host, const std::string &_ip, const std::string &_port) |
Add new entry to the cache. | |
bool | Add (const std::string &_ip, const std::string &_port) |
Add a manual entry where only IP and port is known. | |
const std::vector< Entry > & | GetCache () const |
Return read-only cached entries reference. | |
Static Public Member Functions | |
static MdnsCache & | GetInstance () |
Singleton cache for hosts looked up using mdns.
A critical region accessed both by timer routines and the main thread.
Entries are added by the various Add() signatures. The Validate() method removes all entries where host does not respond to a http request on port 8443.
Definition at line 41 of file mdns_cache.h.
bool MdnsCache::Add | ( | const Entry & | entry | ) |
Add new entry to the cache.
Definition at line 54 of file mdns_cache.cpp.
bool MdnsCache::Add | ( | const std::string & | _ip, |
const std::string & | _port | ||
) |
Add a manual entry where only IP and port is known.
Definition at line 70 of file mdns_cache.cpp.
bool MdnsCache::Add | ( | const std::string & | service, |
const std::string & | host, | ||
const std::string & | _ip, | ||
const std::string & | _port | ||
) |
Add new entry to the cache.
Definition at line 65 of file mdns_cache.cpp.
|
inline |
Return read-only cached entries reference.
Definition at line 84 of file mdns_cache.h.
|
static |
Definition at line 49 of file mdns_cache.cpp.
void MdnsCache::Validate | ( | ) |
Check that all entries are accessible, remove stale ones.
Definition at line 74 of file mdns_cache.cpp.