represents the underlying protocol and address used by a Face More...
#include <ndn-cxx/net/face-uri.hpp>
Classes | |
class | Error |
Public Types | |
typedef function< void(const std::string &reason)> | CanonizeFailureCallback |
typedef function< void(const FaceUri &)> | CanonizeSuccessCallback |
Public Member Functions | |
FaceUri () | |
FaceUri (const std::string &uri) | |
construct by parsing More... | |
FaceUri (const char *uri) | |
FaceUri (const boost::asio::ip::udp::endpoint &endpoint) | |
construct udp4 or udp6 canonical FaceUri More... | |
FaceUri (const boost::asio::ip::tcp::endpoint &endpoint) | |
construct tcp4 or tcp6 canonical FaceUri More... | |
FaceUri (const boost::asio::ip::tcp::endpoint &endpoint, const std::string &scheme) | |
construct tcp canonical FaceUri with custom scheme More... | |
FaceUri (const ethernet::Address &address) | |
construct ether canonical FaceUri More... | |
void | canonize (const CanonizeSuccessCallback &onSuccess, const CanonizeFailureCallback &onFailure, boost::asio::io_service &io, time::nanoseconds timeout) const |
asynchronously convert this FaceUri to canonical form More... | |
const std::string & | getHost () const |
get host (domain) More... | |
const std::string & | getPath () const |
get path More... | |
const std::string & | getPort () const |
get port More... | |
const std::string & | getScheme () const |
get scheme (protocol) More... | |
bool | isCanonical () const |
determine whether this FaceUri is in canonical form More... | |
bool | operator!= (const FaceUri &rhs) const |
bool | operator== (const FaceUri &rhs) const |
bool | parse (const std::string &uri) |
exception-safe parsing More... | |
std::string | toString () const |
write as a string More... | |
Static Public Member Functions | |
static bool | canCanonize (const std::string &scheme) |
static FaceUri | fromDev (const std::string &ifname) |
create dev FaceUri from network device name More... | |
static FaceUri | fromFd (int fd) |
create fd FaceUri from file descriptor More... | |
static FaceUri | fromUdpDev (const boost::asio::ip::udp::endpoint &endpoint, const std::string &ifname) |
create udp4 or udp6 NIC-associated FaceUri from endpoint and network device name More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const FaceUri &uri) |
represents the underlying protocol and address used by a Face
Definition at line 44 of file face-uri.hpp.
typedef function<void(const std::string& reason)> ndn::FaceUri::CanonizeFailureCallback |
Definition at line 161 of file face-uri.hpp.
typedef function<void(const FaceUri&)> ndn::FaceUri::CanonizeSuccessCallback |
Definition at line 160 of file face-uri.hpp.
ndn::FaceUri::FaceUri | ( | ) |
Definition at line 45 of file face-uri.cpp.
|
explicit |
construct by parsing
uri | scheme://host[:port]/path |
FaceUri::Error | if URI cannot be parsed |
Definition at line 50 of file face-uri.cpp.
|
explicit |
Definition at line 57 of file face-uri.cpp.
|
explicit |
construct udp4 or udp6 canonical FaceUri
Definition at line 119 of file face-uri.cpp.
|
explicit |
construct tcp4 or tcp6 canonical FaceUri
Definition at line 127 of file face-uri.cpp.
ndn::FaceUri::FaceUri | ( | const boost::asio::ip::tcp::endpoint & | endpoint, |
const std::string & | scheme | ||
) |
construct tcp canonical FaceUri with custom scheme
Definition at line 135 of file face-uri.cpp.
|
explicit |
construct ether canonical FaceUri
Definition at line 161 of file face-uri.cpp.
|
static |
Definition at line 628 of file face-uri.cpp.
void ndn::FaceUri::canonize | ( | const CanonizeSuccessCallback & | onSuccess, |
const CanonizeFailureCallback & | onFailure, | ||
boost::asio::io_service & | io, | ||
time::nanoseconds | timeout | ||
) | const |
asynchronously convert this FaceUri to canonical form
onSuccess | function to call after this FaceUri is converted to canonical form |
onFailure | function to call if this FaceUri cannot be converted to canonical form |
io | reference to boost::asio::io_service instance |
timeout | maximum allowable duration of the operations. It's intentional not to provide a default value: the caller should set a reasonable value in balance between network delay and user experience. |
Definition at line 645 of file face-uri.cpp.
|
static |
create dev FaceUri from network device name
Definition at line 169 of file face-uri.cpp.
|
static |
create fd FaceUri from file descriptor
Definition at line 153 of file face-uri.cpp.
|
static |
create udp4 or udp6 NIC-associated FaceUri from endpoint and network device name
Definition at line 178 of file face-uri.cpp.
|
inline |
get host (domain)
Definition at line 116 of file face-uri.hpp.
|
inline |
get path
Definition at line 130 of file face-uri.hpp.
|
inline |
get port
Definition at line 123 of file face-uri.hpp.
|
inline |
get scheme (protocol)
Definition at line 109 of file face-uri.hpp.
bool ndn::FaceUri::isCanonical | ( | ) | const |
bool ndn::FaceUri::operator!= | ( | const FaceUri & | rhs | ) | const |
Definition at line 198 of file face-uri.cpp.
bool ndn::FaceUri::operator== | ( | const FaceUri & | rhs | ) | const |
Definition at line 188 of file face-uri.cpp.
bool ndn::FaceUri::parse | ( | const std::string & | uri | ) |
exception-safe parsing
Definition at line 63 of file face-uri.cpp.
std::string ndn::FaceUri::toString | ( | ) | const |
write as a string
Definition at line 204 of file face-uri.cpp.
|
friend |
Definition at line 212 of file face-uri.cpp.