28 #ifndef NDN_UTIL_FACE_URI_HPP 29 #define NDN_UTIL_FACE_URI_HPP 31 #include "../common.hpp" 32 #include <boost/asio/ip/udp.hpp> 33 #include <boost/asio/ip/tcp.hpp> 34 #include <boost/asio/local/stream_protocol.hpp> 47 class Error :
public std::invalid_argument
52 :
std::invalid_argument(what)
65 FaceUri(
const std::string& uri);
74 parse(
const std::string& uri);
79 FaceUri(
const boost::asio::ip::udp::endpoint& endpoint);
83 FaceUri(
const boost::asio::ip::tcp::endpoint& endpoint);
86 FaceUri(
const boost::asio::ip::tcp::endpoint& endpoint,
const std::string& scheme);
88 #ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS 91 FaceUri(
const boost::asio::local::stream_protocol::endpoint& endpoint);
92 #endif // BOOST_ASIO_HAS_LOCAL_SOCKETS 104 fromDev(
const std::string& ifname);
172 canonize(
const CanonizeSuccessCallback& onSuccess,
173 const CanonizeFailureCallback& onFailure,
174 boost::asio::io_service& io,
const time::nanoseconds& timeout)
const;
177 std::string m_scheme;
193 #endif // NDN_UTIL_FACE_URI_HPP Copyright (c) 2011-2015 Regents of the University of California.
const std::string & getPath() const
get path
bool parse(const std::string &uri)
exception-safe parsing
static bool canCanonize(const std::string &scheme)
bool operator==(const FaceUri &rhs) const
represents an Ethernet hardware address
represents the underlying protocol and address used by a Face
function< void(const FaceUri &)> CanonizeSuccessCallback
const std::string & getPort() const
get port
bool isCanonical() const
determine whether this FaceUri is in canonical form
friend std::ostream & operator<<(std::ostream &os, const FaceUri &uri)
const std::string & getScheme() const
get scheme (protocol)
Error(const std::string &what)
bool operator!=(const FaceUri &rhs) const
const std::string & getHost() const
get host (domain)
static FaceUri fromDev(const std::string &ifname)
create dev FaceUri from network device name
std::string toString() const
write as a string
function< void(const std::string &reason)> CanonizeFailureCallback
static FaceUri fromFd(int fd)
create fd FaceUri from file descriptor
void canonize(const CanonizeSuccessCallback &onSuccess, const CanonizeFailureCallback &onFailure, boost::asio::io_service &io, const time::nanoseconds &timeout) const
asynchronously convert this FaceUri to canonical form