Ocean
|
This class implements an address resolver. More...
Public Types | |
typedef std::vector< Address4 > | Addresses4 |
Definition of a vector holding addresses. More... | |
typedef std::unordered_set< Address4, Address4 > | AddressSet4 |
Definition of an unordered set holding addresses. More... | |
Public Member Functions | |
Addresses4 | localAddresses () const |
Returns all current local addresses. More... | |
void | addLocalAddress (const Address4 &localAddress) |
Adds an explicit local address. More... | |
Static Public Member Functions | |
static Address4 | resolveFirstIp4 (const std::string &host) |
Resolves a given host name to it's first found ip4 address. More... | |
static Addresses4 | resolveIp4 (const std::string &host) |
Resolves a given host name to all possible ip4 addresses. More... | |
static std::string | resolve (const Address4 &address) |
Resolves a given address to it's host name. More... | |
Static Public Member Functions inherited from Ocean::Singleton< Resolver > | |
static Resolver & | get () |
Returns a reference to the unique object. More... | |
Protected Member Functions | |
Resolver () | |
Creates a new resolver object. More... | |
Protected Member Functions inherited from Ocean::Singleton< Resolver > | |
Singleton ()=default | |
Default constructor. More... | |
Protected Attributes | |
AddressSet4 | explicitLocalAddresses_ |
The local addresses explicitly set. More... | |
Lock | lock_ |
The resolver's lock. More... | |
Friends | |
class | Singleton< Resolver > |
This class implements an address resolver.
typedef std::vector<Address4> Ocean::Network::Resolver::Addresses4 |
Definition of a vector holding addresses.
typedef std::unordered_set<Address4, Address4> Ocean::Network::Resolver::AddressSet4 |
Definition of an unordered set holding addresses.
|
protected |
Creates a new resolver object.
void Ocean::Network::Resolver::addLocalAddress | ( | const Address4 & | localAddress | ) |
Adds an explicit local address.
localAddress | The explicit local address to be set, must be valid |
Addresses4 Ocean::Network::Resolver::localAddresses | ( | ) | const |
Returns all current local addresses.
|
static |
Resolves a given address to it's host name.
If the address could not be resolved an empty string is returned.
address | Address4 to resolve |
|
static |
Resolves a given host name to it's first found ip4 address.
host | Name of the host to resolve |
|
static |
Resolves a given host name to all possible ip4 addresses.
host | Name of the host to resolve |
|
protected |
The local addresses explicitly set.
|
mutableprotected |
The resolver's lock.