Chris@16: // Chris@16: // ip/basic_resolver_entry.hpp Chris@16: // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Chris@16: // Chris@101: // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: Chris@16: #ifndef BOOST_ASIO_IP_BASIC_RESOLVER_ENTRY_HPP Chris@16: #define BOOST_ASIO_IP_BASIC_RESOLVER_ENTRY_HPP Chris@16: Chris@16: #if defined(_MSC_VER) && (_MSC_VER >= 1200) Chris@16: # pragma once Chris@16: #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace asio { Chris@16: namespace ip { Chris@16: Chris@16: /// An entry produced by a resolver. Chris@16: /** Chris@16: * The boost::asio::ip::basic_resolver_entry class template describes an entry Chris@16: * as returned by a resolver. Chris@16: * Chris@16: * @par Thread Safety Chris@16: * @e Distinct @e objects: Safe.@n Chris@16: * @e Shared @e objects: Unsafe. Chris@16: */ Chris@16: template Chris@16: class basic_resolver_entry Chris@16: { Chris@16: public: Chris@16: /// The protocol type associated with the endpoint entry. Chris@16: typedef InternetProtocol protocol_type; Chris@16: Chris@16: /// The endpoint type associated with the endpoint entry. Chris@16: typedef typename InternetProtocol::endpoint endpoint_type; Chris@16: Chris@16: /// Default constructor. Chris@16: basic_resolver_entry() Chris@16: { Chris@16: } Chris@16: Chris@16: /// Construct with specified endpoint, host name and service name. Chris@16: basic_resolver_entry(const endpoint_type& ep, Chris@16: const std::string& host, const std::string& service) Chris@16: : endpoint_(ep), Chris@16: host_name_(host), Chris@16: service_name_(service) Chris@16: { Chris@16: } Chris@16: Chris@16: /// Get the endpoint associated with the entry. Chris@16: endpoint_type endpoint() const Chris@16: { Chris@16: return endpoint_; Chris@16: } Chris@16: Chris@16: /// Convert to the endpoint associated with the entry. Chris@16: operator endpoint_type() const Chris@16: { Chris@16: return endpoint_; Chris@16: } Chris@16: Chris@16: /// Get the host name associated with the entry. Chris@16: std::string host_name() const Chris@16: { Chris@16: return host_name_; Chris@16: } Chris@16: Chris@16: /// Get the service name associated with the entry. Chris@16: std::string service_name() const Chris@16: { Chris@16: return service_name_; Chris@16: } Chris@16: Chris@16: private: Chris@16: endpoint_type endpoint_; Chris@16: std::string host_name_; Chris@16: std::string service_name_; Chris@16: }; Chris@16: Chris@16: } // namespace ip Chris@16: } // namespace asio Chris@16: } // namespace boost Chris@16: Chris@16: #include Chris@16: Chris@16: #endif // BOOST_ASIO_IP_BASIC_RESOLVER_ENTRY_HPP