2 // ip/basic_resolver_entry.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_ASIO_IP_BASIC_RESOLVER_ENTRY_HPP
12 #define BOOST_ASIO_IP_BASIC_RESOLVER_ENTRY_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
21 #include <boost/asio/detail/push_options.hpp>
27 /// An entry produced by a resolver.
29 * The boost::asio::ip::basic_resolver_entry class template describes an entry
30 * as returned by a resolver.
33 * @e Distinct @e objects: Safe.@n
34 * @e Shared @e objects: Unsafe.
36 template <typename InternetProtocol>
37 class basic_resolver_entry
40 /// The protocol type associated with the endpoint entry.
41 typedef InternetProtocol protocol_type;
43 /// The endpoint type associated with the endpoint entry.
44 typedef typename InternetProtocol::endpoint endpoint_type;
46 /// Default constructor.
47 basic_resolver_entry()
51 /// Construct with specified endpoint, host name and service name.
52 basic_resolver_entry(const endpoint_type& ep,
53 const std::string& host, const std::string& service)
56 service_name_(service)
60 /// Get the endpoint associated with the entry.
61 endpoint_type endpoint() const
66 /// Convert to the endpoint associated with the entry.
67 operator endpoint_type() const
72 /// Get the host name associated with the entry.
73 std::string host_name() const
78 /// Get the service name associated with the entry.
79 std::string service_name() const
85 endpoint_type endpoint_;
86 std::string host_name_;
87 std::string service_name_;
94 #include <boost/asio/detail/pop_options.hpp>
96 #endif // BOOST_ASIO_IP_BASIC_RESOLVER_ENTRY_HPP