Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::asio::ip::basic_resolver< InternetProtocol, ResolverService > Class Template Reference

Provides endpoint resolution functionality. More...

#include <basic_resolver.hpp>

Inheritance diagram for boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >:
Collaboration diagram for boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >:

Public Types

typedef InternetProtocol protocol_type
 The protocol type. More...
 
typedef InternetProtocol::endpoint endpoint_type
 The endpoint type. More...
 
typedef basic_resolver_query
< InternetProtocol > 
query
 The query type. More...
 
typedef
basic_resolver_iterator
< InternetProtocol > 
iterator
 The iterator type. More...
 
typedef ResolverService service_type
 The type of the service that will be used to provide I/O operations. More...
 
typedef
service_type::implementation_type 
implementation_type
 The underlying implementation type of I/O object. More...
 

Public Member Functions

 basic_resolver (boost::asio::io_service &io_service)
 Constructor. More...
 
void cancel ()
 Cancel any asynchronous operations that are waiting on the resolver. More...
 
iterator resolve (const query &q)
 Perform forward resolution of a query to a list of entries. More...
 
iterator resolve (const query &q, boost::system::error_code &ec)
 Perform forward resolution of a query to a list of entries. More...
 
template<typename ResolveHandler >
 BOOST_ASIO_INITFN_RESULT_TYPE (ResolveHandler, void(boost::system::error_code, iterator)) async_resolve(const query &q
 Asynchronously perform forward resolution of a query to a list of entries. More...
 
 BOOST_ASIO_MOVE_ARG (ResolveHandler) handler)
 
iterator resolve (const endpoint_type &e)
 Perform reverse resolution of an endpoint to a list of entries. More...
 
iterator resolve (const endpoint_type &e, boost::system::error_code &ec)
 Perform reverse resolution of an endpoint to a list of entries. More...
 
template<typename ResolveHandler >
 BOOST_ASIO_INITFN_RESULT_TYPE (ResolveHandler, void(boost::system::error_code, iterator)) async_resolve(const endpoint_type &e
 Asynchronously perform reverse resolution of an endpoint to a list of entries. More...
 
 BOOST_ASIO_MOVE_ARG (ResolveHandler) handler)
 
boost::asio::io_serviceget_io_service ()
 Get the io_service associated with the object. More...
 

Protected Member Functions

service_typeget_service ()
 Get the service associated with the I/O object. More...
 
const service_typeget_service () const
 Get the service associated with the I/O object. More...
 
implementation_typeget_implementation ()
 Get the underlying implementation of the I/O object. More...
 
const implementation_typeget_implementation () const
 Get the underlying implementation of the I/O object. More...
 

Protected Attributes

service_typeservice
 (Deprecated: Use get_service().) The service associated with the I/O object. More...
 
implementation_type implementation
 (Deprecated: Use get_implementation().) The underlying implementation of the I/O object. More...
 

Detailed Description

template<typename InternetProtocol, typename ResolverService = resolver_service<InternetProtocol>>
class boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >

Provides endpoint resolution functionality.

The basic_resolver class template provides the ability to resolve a query to a list of endpoints.

Thread Safety
Distinct objects: Safe.
Shared objects: Unsafe.

Member Typedef Documentation

template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
typedef InternetProtocol::endpoint boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::endpoint_type

The endpoint type.

typedef service_type::implementation_type boost::asio::basic_io_object< ResolverService >::implementation_type
inherited

The underlying implementation type of I/O object.

template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
typedef basic_resolver_iterator<InternetProtocol> boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::iterator

The iterator type.

template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
typedef InternetProtocol boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::protocol_type

The protocol type.

template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
typedef basic_resolver_query<InternetProtocol> boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::query

The query type.

typedef ResolverService boost::asio::basic_io_object< ResolverService >::service_type
inherited

The type of the service that will be used to provide I/O operations.

Constructor & Destructor Documentation

template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::basic_resolver ( boost::asio::io_service io_service)
inlineexplicit

Constructor.

This constructor creates a basic_resolver.

Parameters
io_serviceThe io_service object that the resolver will use to dispatch handlers for any asynchronous operations performed on the timer.

Member Function Documentation

template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
template<typename ResolveHandler >
boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::BOOST_ASIO_INITFN_RESULT_TYPE ( ResolveHandler  ,
void(boost::system::error_code, iterator  
) const

Asynchronously perform forward resolution of a query to a list of entries.

This function is used to asynchronously resolve a query into a list of endpoint entries.

Parameters
qA query object that determines what endpoints will be returned.
handlerThe handler to be called when the resolve operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
void handler(
const boost::system::error_code& error, // Result of operation.
resolver::iterator iterator // Forward-only iterator that can
// be used to traverse the list
// of endpoint entries.
);
Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using boost::asio::io_service::post().
Note
A default constructed iterator represents the end of the list.

A successful resolve operation is guaranteed to pass at least one entry to the handler.

template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
template<typename ResolveHandler >
boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::BOOST_ASIO_INITFN_RESULT_TYPE ( ResolveHandler  ,
void(boost::system::error_code, iterator  
) const

Asynchronously perform reverse resolution of an endpoint to a list of entries.

This function is used to asynchronously resolve an endpoint into a list of endpoint entries.

Parameters
eAn endpoint object that determines what endpoints will be returned.
handlerThe handler to be called when the resolve operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
void handler(
const boost::system::error_code& error, // Result of operation.
resolver::iterator iterator // Forward-only iterator that can
// be used to traverse the list
// of endpoint entries.
);
Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using boost::asio::io_service::post().
Note
A default constructed iterator represents the end of the list.

A successful resolve operation is guaranteed to pass at least one entry to the handler.

template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::BOOST_ASIO_MOVE_ARG ( ResolveHandler  )
inline
template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::BOOST_ASIO_MOVE_ARG ( ResolveHandler  )
inline
template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
void boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::cancel ( )
inline

Cancel any asynchronous operations that are waiting on the resolver.

This function forces the completion of any pending asynchronous operations on the host resolver. The handler for each cancelled operation will be invoked with the boost::asio::error::operation_aborted error code.

References boost::asio::basic_io_object< ResolverService >::implementation, and boost::asio::basic_io_object< ResolverService >::service.

implementation_type& boost::asio::basic_io_object< ResolverService >::get_implementation ( )
inlineprotectedinherited

Get the underlying implementation of the I/O object.

const implementation_type& boost::asio::basic_io_object< ResolverService >::get_implementation ( ) const
inlineprotectedinherited

Get the underlying implementation of the I/O object.

boost::asio::io_service& boost::asio::basic_io_object< ResolverService >::get_io_service ( )
inlineinherited

Get the io_service associated with the object.

This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.

Returns
A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
service_type& boost::asio::basic_io_object< ResolverService >::get_service ( )
inlineprotectedinherited

Get the service associated with the I/O object.

const service_type& boost::asio::basic_io_object< ResolverService >::get_service ( ) const
inlineprotectedinherited

Get the service associated with the I/O object.

template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
iterator boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::resolve ( const query q)
inline

Perform forward resolution of a query to a list of entries.

This function is used to resolve a query into a list of endpoint entries.

Parameters
qA query object that determines what endpoints will be returned.
Returns
A forward-only iterator that can be used to traverse the list of endpoint entries.
Exceptions
boost::system::system_errorThrown on failure.
Note
A default constructed iterator represents the end of the list.

A successful call to this function is guaranteed to return at least one entry.

References boost::multiprecision::backends::i, boost::asio::basic_io_object< ResolverService >::implementation, and boost::asio::basic_io_object< ResolverService >::service.

template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
iterator boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::resolve ( const query q,
boost::system::error_code ec 
)
inline

Perform forward resolution of a query to a list of entries.

This function is used to resolve a query into a list of endpoint entries.

Parameters
qA query object that determines what endpoints will be returned.
ecSet to indicate what error occurred, if any.
Returns
A forward-only iterator that can be used to traverse the list of endpoint entries. Returns a default constructed iterator if an error occurs.
Note
A default constructed iterator represents the end of the list.

A successful call to this function is guaranteed to return at least one entry.

References boost::asio::basic_io_object< ResolverService >::implementation, and boost::asio::basic_io_object< ResolverService >::service.

template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
iterator boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::resolve ( const endpoint_type e)
inline

Perform reverse resolution of an endpoint to a list of entries.

This function is used to resolve an endpoint into a list of endpoint entries.

Parameters
eAn endpoint object that determines what endpoints will be returned.
Returns
A forward-only iterator that can be used to traverse the list of endpoint entries.
Exceptions
boost::system::system_errorThrown on failure.
Note
A default constructed iterator represents the end of the list.

A successful call to this function is guaranteed to return at least one entry.

References boost::multiprecision::backends::i, boost::asio::basic_io_object< ResolverService >::implementation, and boost::asio::basic_io_object< ResolverService >::service.

template<typename InternetProtocol , typename ResolverService = resolver_service<InternetProtocol>>
iterator boost::asio::ip::basic_resolver< InternetProtocol, ResolverService >::resolve ( const endpoint_type e,
boost::system::error_code ec 
)
inline

Perform reverse resolution of an endpoint to a list of entries.

This function is used to resolve an endpoint into a list of endpoint entries.

Parameters
eAn endpoint object that determines what endpoints will be returned.
ecSet to indicate what error occurred, if any.
Returns
A forward-only iterator that can be used to traverse the list of endpoint entries. Returns a default constructed iterator if an error occurs.
Note
A default constructed iterator represents the end of the list.

A successful call to this function is guaranteed to return at least one entry.

References boost::asio::basic_io_object< ResolverService >::implementation, and boost::asio::basic_io_object< ResolverService >::service.

Member Data Documentation

service_type& boost::asio::basic_io_object< ResolverService >::service
protectedinherited

The documentation for this class was generated from the following file: