00001 // 00002 // basic_resolver_entry.hpp 00003 // ~~~~~~~~~~~~~~~~~~~~~~~~ 00004 // 00005 // Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) 00006 // 00007 // Distributed under the Boost Software License, Version 1.0. (See accompanying 00008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 00009 // 00010 00011 #ifndef ASIO_IP_BASIC_RESOLVER_ENTRY_HPP 00012 #define ASIO_IP_BASIC_RESOLVER_ENTRY_HPP 00013 00014 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 00015 # pragma once 00016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 00017 00018 #include "asio/detail/push_options.hpp" 00019 00020 #include "asio/detail/push_options.hpp" 00021 #include <string> 00022 #include "asio/detail/pop_options.hpp" 00023 00024 namespace asio { 00025 namespace ip { 00026 00028 00036 template <typename InternetProtocol> 00037 class basic_resolver_entry 00038 { 00039 public: 00041 typedef InternetProtocol protocol_type; 00042 00044 typedef typename InternetProtocol::endpoint endpoint_type; 00045 00047 basic_resolver_entry() 00048 { 00049 } 00050 00052 basic_resolver_entry(const endpoint_type& endpoint, 00053 const std::string& host_name, const std::string& service_name) 00054 : endpoint_(endpoint), 00055 host_name_(host_name), 00056 service_name_(service_name) 00057 { 00058 } 00059 00061 endpoint_type endpoint() const 00062 { 00063 return endpoint_; 00064 } 00065 00067 operator endpoint_type() const 00068 { 00069 return endpoint_; 00070 } 00071 00073 std::string host_name() const 00074 { 00075 return host_name_; 00076 } 00077 00079 std::string service_name() const 00080 { 00081 return service_name_; 00082 } 00083 00084 private: 00085 endpoint_type endpoint_; 00086 std::string host_name_; 00087 std::string service_name_; 00088 }; 00089 00090 } // namespace ip 00091 } // namespace asio 00092 00093 #include "asio/detail/pop_options.hpp" 00094 00095 #endif // ASIO_IP_BASIC_RESOLVER_ENTRY_HPP