2
// basic_resolver_entry.hpp
3
// ~~~~~~~~~~~~~~~~~~~~~~~~
5
// Copyright (c) 2003-2007 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 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/push_options.hpp"
20
#include "asio/detail/push_options.hpp"
22
#include "asio/detail/pop_options.hpp"
27
/// An entry produced by a resolver.
29
* The 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& endpoint,
53
const std::string& host_name, const std::string& service_name)
54
: endpoint_(endpoint),
55
host_name_(host_name),
56
service_name_(service_name)
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_;
93
#include "asio/detail/pop_options.hpp"
95
#endif // ASIO_IP_BASIC_RESOLVER_ENTRY_HPP