11 #ifndef ASIO_IP_BASIC_RESOLVER_ENTRY_HPP 12 #define ASIO_IP_BASIC_RESOLVER_ENTRY_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 18 #include "asio/detail/config.hpp" 20 #include "asio/detail/string_view.hpp" 22 #include "asio/detail/push_options.hpp" 36 template <
typename InternetProtocol>
53 ASIO_STRING_VIEW_PARAM host, ASIO_STRING_VIEW_PARAM service)
55 host_name_(static_cast<
std::string>(host)),
56 service_name_(static_cast<
std::string>(service))
79 template <
class Allocator>
80 std::basic_string<char, std::char_traits<char>, Allocator>
host_name(
81 const Allocator& alloc = Allocator())
const 83 return std::basic_string<char, std::char_traits<char>, Allocator>(
84 host_name_.c_str(), alloc);
94 template <
class Allocator>
95 std::basic_string<char, std::char_traits<char>, Allocator>
service_name(
96 const Allocator& alloc = Allocator())
const 98 return std::basic_string<char, std::char_traits<char>, Allocator>(
99 service_name_.c_str(), alloc);
103 endpoint_type endpoint_;
104 std::string host_name_;
105 std::string service_name_;
111 #include "asio/detail/pop_options.hpp" 113 #endif // ASIO_IP_BASIC_RESOLVER_ENTRY_HPP basic_resolver_entry(const endpoint_type &ep, ASIO_STRING_VIEW_PARAM host, ASIO_STRING_VIEW_PARAM service)
Construct with specified endpoint, host name and service name.
Definition: basic_resolver_entry.hpp:52
Definition: awaitable.hpp:421
endpoint_type endpoint() const
Get the endpoint associated with the entry.
Definition: basic_resolver_entry.hpp:61
std::string service_name() const
Get the service name associated with the entry.
Definition: basic_resolver_entry.hpp:88
InternetProtocol::endpoint endpoint_type
The endpoint type associated with the endpoint entry.
Definition: basic_resolver_entry.hpp:44
std::basic_string< char, std::char_traits< char >, Allocator > host_name(const Allocator &alloc=Allocator()) const
Get the host name associated with the entry.
Definition: basic_resolver_entry.hpp:80
std::basic_string< char, std::char_traits< char >, Allocator > service_name(const Allocator &alloc=Allocator()) const
Get the service name associated with the entry.
Definition: basic_resolver_entry.hpp:95
std::string host_name() const
Get the host name associated with the entry.
Definition: basic_resolver_entry.hpp:73
An entry produced by a resolver.
Definition: basic_resolver_entry.hpp:37
basic_resolver_entry()
Default constructor.
Definition: basic_resolver_entry.hpp:47
Definition: any_io_executor.hpp:28
InternetProtocol protocol_type
The protocol type associated with the endpoint entry.
Definition: basic_resolver_entry.hpp:41