Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60882 - in trunk: boost/asio boost/asio/detail boost/asio/ip libs/asio/doc
From: chris_at_[hidden]
Date: 2010-03-27 18:23:00


Author: chris_kohlhoff
Date: 2010-03-27 18:22:59 EDT (Sat, 27 Mar 2010)
New Revision: 60882
URL: http://svn.boost.org/trac/boost/changeset/60882

Log:
Change the resolver implementation to no longer require the typedefs
InternetProtocol::resolver_query and InternetProtocol::resolver_iterator,
as neither typedef is part of the documented InternetProtocol requirements.

The following typedefs are now marked as deprecated:
- ip::icmp::resolver_query
- ip::icmp::resolver_iterator
- ip::tcp::resolver_query
- ip::tcp::resolver_iterator
- ip::udp::resolver_query
- ip::udp::resolver_iterator

Text files modified:
   trunk/boost/asio/basic_socket_streambuf.hpp | 8
   trunk/boost/asio/detail/resolver_service.hpp | 6
   trunk/boost/asio/ip/basic_resolver.hpp | 6
   trunk/boost/asio/ip/icmp.hpp | 4
   trunk/boost/asio/ip/resolver_service.hpp | 6
   trunk/boost/asio/ip/tcp.hpp | 4
   trunk/boost/asio/ip/udp.hpp | 4
   trunk/libs/asio/doc/reference.qbk | 378 ++++++++++++++++++++++++++++++++++++++-
   8 files changed, 385 insertions(+), 31 deletions(-)

Modified: trunk/boost/asio/basic_socket_streambuf.hpp
==============================================================================
--- trunk/boost/asio/basic_socket_streambuf.hpp (original)
+++ trunk/boost/asio/basic_socket_streambuf.hpp 2010-03-27 18:22:59 EDT (Sat, 27 Mar 2010)
@@ -50,7 +50,8 @@
 // init_buffers();
 // boost::system::error_code ec;
 // this->basic_socket<Protocol, StreamSocketService>::close(ec);
-// typedef typename Protocol::resolver_query resolver_query;
+// typedef typename Protocol::resolver resolver_type;
+// typedef typename resolver_type::query resolver_query;
 // resolver_query query(x1, ..., xn);
 // resolve_and_connect(query, ec);
 // return !ec ? this : 0;
@@ -65,7 +66,8 @@
     init_buffers(); \
     boost::system::error_code ec; \
     this->basic_socket<Protocol, StreamSocketService>::close(ec); \
- typedef typename Protocol::resolver_query resolver_query; \
+ typedef typename Protocol::resolver resolver_type; \
+ typedef typename resolver_type::query resolver_query; \
     resolver_query query(BOOST_PP_ENUM_PARAMS(n, x)); \
     resolve_and_connect(query, ec); \
     return !ec ? this : 0; \
@@ -259,7 +261,7 @@
       boost::system::error_code& ec)
   {
     typedef typename Protocol::resolver resolver_type;
- typedef typename Protocol::resolver_iterator iterator_type;
+ typedef typename resolver_type::iterator iterator_type;
     resolver_type resolver(
         boost::base_from_member<boost::asio::io_service>::member);
     iterator_type i = resolver.resolve(query, ec);

Modified: trunk/boost/asio/detail/resolver_service.hpp
==============================================================================
--- trunk/boost/asio/detail/resolver_service.hpp (original)
+++ trunk/boost/asio/detail/resolver_service.hpp 2010-03-27 18:22:59 EDT (Sat, 27 Mar 2010)
@@ -26,6 +26,8 @@
 
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/basic_resolver_iterator.hpp>
+#include <boost/asio/ip/basic_resolver_query.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/mutex.hpp>
@@ -81,10 +83,10 @@
   typedef typename Protocol::endpoint endpoint_type;
 
   // The query type.
- typedef typename Protocol::resolver_query query_type;
+ typedef boost::asio::ip::basic_resolver_query<Protocol> query_type;
 
   // The iterator type.
- typedef typename Protocol::resolver_iterator iterator_type;
+ typedef boost::asio::ip::basic_resolver_iterator<Protocol> iterator_type;
 
   // Constructor.
   resolver_service(boost::asio::io_service& io_service)

Modified: trunk/boost/asio/ip/basic_resolver.hpp
==============================================================================
--- trunk/boost/asio/ip/basic_resolver.hpp (original)
+++ trunk/boost/asio/ip/basic_resolver.hpp 2010-03-27 18:22:59 EDT (Sat, 27 Mar 2010)
@@ -19,6 +19,8 @@
 
 #include <boost/asio/basic_io_object.hpp>
 #include <boost/asio/error.hpp>
+#include <boost/asio/ip/basic_resolver_iterator.hpp>
+#include <boost/asio/ip/basic_resolver_query.hpp>
 #include <boost/asio/ip/resolver_service.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 
@@ -48,10 +50,10 @@
   typedef typename InternetProtocol::endpoint endpoint_type;
 
   /// The query type.
- typedef typename InternetProtocol::resolver_query query;
+ typedef basic_resolver_query<InternetProtocol> query;
 
   /// The iterator type.
- typedef typename InternetProtocol::resolver_iterator iterator;
+ typedef basic_resolver_iterator<InternetProtocol> iterator;
 
   /// Constructor.
   /**

Modified: trunk/boost/asio/ip/icmp.hpp
==============================================================================
--- trunk/boost/asio/ip/icmp.hpp (original)
+++ trunk/boost/asio/ip/icmp.hpp 2010-03-27 18:22:59 EDT (Sat, 27 Mar 2010)
@@ -45,10 +45,10 @@
   /// The type of a ICMP endpoint.
   typedef basic_endpoint<icmp> endpoint;
 
- /// The type of a resolver query.
+ /// (Deprecated: use resolver::query.) The type of a resolver query.
   typedef basic_resolver_query<icmp> resolver_query;
 
- /// The type of a resolver iterator.
+ /// (Deprecated: use resolver::iterator.) The type of a resolver iterator.
   typedef basic_resolver_iterator<icmp> resolver_iterator;
 
   /// Construct to represent the IPv4 ICMP protocol.

Modified: trunk/boost/asio/ip/resolver_service.hpp
==============================================================================
--- trunk/boost/asio/ip/resolver_service.hpp (original)
+++ trunk/boost/asio/ip/resolver_service.hpp 2010-03-27 18:22:59 EDT (Sat, 27 Mar 2010)
@@ -19,6 +19,8 @@
 
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/basic_resolver_iterator.hpp>
+#include <boost/asio/ip/basic_resolver_query.hpp>
 #include <boost/asio/detail/resolver_service.hpp>
 #include <boost/asio/detail/service_base.hpp>
 
@@ -49,10 +51,10 @@
   typedef typename InternetProtocol::endpoint endpoint_type;
 
   /// The query type.
- typedef typename InternetProtocol::resolver_query query_type;
+ typedef basic_resolver_query<InternetProtocol> query_type;
 
   /// The iterator type.
- typedef typename InternetProtocol::resolver_iterator iterator_type;
+ typedef basic_resolver_iterator<InternetProtocol> iterator_type;
 
 private:
   // The type of the platform-specific implementation.

Modified: trunk/boost/asio/ip/tcp.hpp
==============================================================================
--- trunk/boost/asio/ip/tcp.hpp (original)
+++ trunk/boost/asio/ip/tcp.hpp 2010-03-27 18:22:59 EDT (Sat, 27 Mar 2010)
@@ -48,10 +48,10 @@
   /// The type of a TCP endpoint.
   typedef basic_endpoint<tcp> endpoint;
 
- /// The type of a resolver query.
+ /// (Deprecated: use resolver::query.) The type of a resolver query.
   typedef basic_resolver_query<tcp> resolver_query;
 
- /// The type of a resolver iterator.
+ /// (Deprecated: use resolver::iterator.) The type of a resolver iterator.
   typedef basic_resolver_iterator<tcp> resolver_iterator;
 
   /// Construct to represent the IPv4 TCP protocol.

Modified: trunk/boost/asio/ip/udp.hpp
==============================================================================
--- trunk/boost/asio/ip/udp.hpp (original)
+++ trunk/boost/asio/ip/udp.hpp 2010-03-27 18:22:59 EDT (Sat, 27 Mar 2010)
@@ -45,10 +45,10 @@
   /// The type of a UDP endpoint.
   typedef basic_endpoint<udp> endpoint;
 
- /// The type of a resolver query.
+ /// (Deprecated: use resolver::query.) The type of a resolver query.
   typedef basic_resolver_query<udp> resolver_query;
 
- /// The type of a resolver iterator.
+ /// (Deprecated: use resolver::iterator.) The type of a resolver iterator.
   typedef basic_resolver_iterator<udp> resolver_iterator;
 
   /// Construct to represent the IPv4 UDP protocol.

Modified: trunk/libs/asio/doc/reference.qbk
==============================================================================
--- trunk/libs/asio/doc/reference.qbk (original)
+++ trunk/libs/asio/doc/reference.qbk 2010-03-27 18:22:59 EDT (Sat, 27 Mar 2010)
@@ -42231,7 +42231,76 @@
 The iterator type.
 
 
- typedef InternetProtocol::resolver_iterator iterator;
+ typedef basic_resolver_iterator< InternetProtocol > iterator;
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
+ [Default constructor creates an end iterator. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.create [*create]]]
+ [Create an iterator from an addrinfo list returned by getaddrinfo.
+
+ Create an iterator from an endpoint, host name and service name. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]]
+ [Dereference an iterator. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]]
+ [Increment operator (prefix).
+
+ Increment operator (postfix). ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]]
+ [Dereference an iterator. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]]
+ [Test two iterators for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]]
+ [Test two iterators for equality. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver.
+
+The iterator's value\_type, obtained when the iterator is dereferenced, is:
+
+ const basic_resolver_entry<InternetProtocol>
+
+
+
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
 
 
 
@@ -42273,7 +42342,111 @@
 The query type.
 
 
- typedef InternetProtocol::resolver_query query;
+ typedef basic_resolver_query< InternetProtocol > query;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver_query.flags [*flags]]]
+ [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint query. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
+ [Construct with specified service name for any protocol.
+
+ Construct with specified service name for a given protocol.
+
+ Construct with specified host name and service name for any protocol.
+
+ Construct with specified host name and service name for a given protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
+ [Get the hints associated with the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.host_name [*host_name]]]
+ [Get the host name associated with the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.service_name [*service_name]]]
+ [Get the service name associated with the query. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.address_configured [*address_configured]]]
+ [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.all_matching [*all_matching]]]
+ [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.canonical_name [*canonical_name]]]
+ [Determine the canonical name of the host specified in the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.numeric_host [*numeric_host]]]
+ [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.numeric_service [*numeric_service]]]
+ [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
+ [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.v4_mapped [*v4_mapped]]]
+ [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class template describes a query that can be passed to a resolver.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
 
 
 
@@ -43581,14 +43754,14 @@
   [
 
     [[link boost_asio.reference.ip__icmp.resolver_iterator [*resolver_iterator]]]
- [The type of a resolver iterator. ]
+ [(Deprecated: use resolver::iterator.) The type of a resolver iterator. ]
   
   ]
 
   [
 
     [[link boost_asio.reference.ip__icmp.resolver_query [*resolver_query]]]
- [The type of a resolver query. ]
+ [(Deprecated: use resolver::query.) The type of a resolver query. ]
   
   ]
 
@@ -44024,7 +44197,7 @@
 [section:resolver_iterator ip::icmp::resolver_iterator]
 
 [indexterm2 resolver_iterator..ip::icmp]
-The type of a resolver iterator.
+(Deprecated: use `resolver::iterator`.) The type of a resolver iterator.
 
 
   typedef basic_resolver_iterator< icmp > resolver_iterator;
@@ -44114,7 +44287,7 @@
 [section:resolver_query ip::icmp::resolver_query]
 
 [indexterm2 resolver_query..ip::icmp]
-The type of a resolver query.
+(Deprecated: use `resolver::query`.) The type of a resolver query.
 
 
   typedef basic_resolver_query< icmp > resolver_query;
@@ -45440,7 +45613,76 @@
 The iterator type.
 
 
- typedef InternetProtocol::resolver_iterator iterator_type;
+ typedef basic_resolver_iterator< InternetProtocol > iterator_type;
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
+ [Default constructor creates an end iterator. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.create [*create]]]
+ [Create an iterator from an addrinfo list returned by getaddrinfo.
+
+ Create an iterator from an endpoint, host name and service name. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]]
+ [Dereference an iterator. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]]
+ [Increment operator (prefix).
+
+ Increment operator (postfix). ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]]
+ [Dereference an iterator. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]]
+ [Test two iterators for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]]
+ [Test two iterators for equality. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver.
+
+The iterator's value\_type, obtained when the iterator is dereferenced, is:
+
+ const basic_resolver_entry<InternetProtocol>
+
+
+
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
 
 
 
@@ -45482,7 +45724,111 @@
 The query type.
 
 
- typedef InternetProtocol::resolver_query query_type;
+ typedef basic_resolver_query< InternetProtocol > query_type;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver_query.flags [*flags]]]
+ [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint query. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
+ [Construct with specified service name for any protocol.
+
+ Construct with specified service name for a given protocol.
+
+ Construct with specified host name and service name for any protocol.
+
+ Construct with specified host name and service name for a given protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
+ [Get the hints associated with the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.host_name [*host_name]]]
+ [Get the host name associated with the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.service_name [*service_name]]]
+ [Get the service name associated with the query. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.address_configured [*address_configured]]]
+ [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.all_matching [*all_matching]]]
+ [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.canonical_name [*canonical_name]]]
+ [Determine the canonical name of the host specified in the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.numeric_host [*numeric_host]]]
+ [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.numeric_service [*numeric_service]]]
+ [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
+ [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.v4_mapped [*v4_mapped]]]
+ [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class template describes a query that can be passed to a resolver.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
 
 
 
@@ -45637,14 +45983,14 @@
   [
 
     [[link boost_asio.reference.ip__tcp.resolver_iterator [*resolver_iterator]]]
- [The type of a resolver iterator. ]
+ [(Deprecated: use resolver::iterator.) The type of a resolver iterator. ]
   
   ]
 
   [
 
     [[link boost_asio.reference.ip__tcp.resolver_query [*resolver_query]]]
- [The type of a resolver query. ]
+ [(Deprecated: use resolver::query.) The type of a resolver query. ]
   
   ]
 
@@ -46509,7 +46855,7 @@
 [section:resolver_iterator ip::tcp::resolver_iterator]
 
 [indexterm2 resolver_iterator..ip::tcp]
-The type of a resolver iterator.
+(Deprecated: use `resolver::iterator`.) The type of a resolver iterator.
 
 
   typedef basic_resolver_iterator< tcp > resolver_iterator;
@@ -46599,7 +46945,7 @@
 [section:resolver_query ip::tcp::resolver_query]
 
 [indexterm2 resolver_query..ip::tcp]
-The type of a resolver query.
+(Deprecated: use `resolver::query`.) The type of a resolver query.
 
 
   typedef basic_resolver_query< tcp > resolver_query;
@@ -47184,14 +47530,14 @@
   [
 
     [[link boost_asio.reference.ip__udp.resolver_iterator [*resolver_iterator]]]
- [The type of a resolver iterator. ]
+ [(Deprecated: use resolver::iterator.) The type of a resolver iterator. ]
   
   ]
 
   [
 
     [[link boost_asio.reference.ip__udp.resolver_query [*resolver_query]]]
- [The type of a resolver query. ]
+ [(Deprecated: use resolver::query.) The type of a resolver query. ]
   
   ]
 
@@ -47627,7 +47973,7 @@
 [section:resolver_iterator ip::udp::resolver_iterator]
 
 [indexterm2 resolver_iterator..ip::udp]
-The type of a resolver iterator.
+(Deprecated: use `resolver::iterator`.) The type of a resolver iterator.
 
 
   typedef basic_resolver_iterator< udp > resolver_iterator;
@@ -47717,7 +48063,7 @@
 [section:resolver_query ip::udp::resolver_query]
 
 [indexterm2 resolver_query..ip::udp]
-The type of a resolver query.
+(Deprecated: use `resolver::query`.) The type of a resolver query.
 
 
   typedef basic_resolver_query< udp > resolver_query;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk