| Home | Libraries | People | FAQ | More

# boost::asio::ip::basic_resolver_query< Protocol > Class Template Reference

Inherits boost::asio::ip::resolver_query_base.

Inheritance diagram for boost::asio::ip::basic_resolver_query< Protocol >:

List of all members.

## Detailed Description

### template<typename Protocol>
class boost::asio::ip::basic_resolver_query< Protocol >

An query to be passed to a resolver.

The boost::asio::ip::basic_resolver_query class template describes a query that can be passed to a resolver.

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

Concepts:
  Endpoint.

## Public Types

typedef Protocol | protocol_type
| The protocol type associated with the endpoint query.

## Public Member Functions

| basic_resolver_query (const std::string &service_name, int flags=passive|address_configured)
| Construct with specified service name for any protocol.
| basic_resolver_query (const protocol_type &protocol, const std::string &service_name, int flags=passive|address_configured)
| Construct with specified service name for a given protocol.
| basic_resolver_query (const std::string &host_name, const std::string &service_name, int flags=address_configured)
| Construct with specified host name and service name for any protocol.
| basic_resolver_query (const protocol_type &protocol, const std::string &host_name, const std::string &service_name, int flags=address_configured)
| Construct with specified host name and service name for a given protocol.
const boost::asio::detail::addrinfo_type & | hints () const
| Get the hints associated with the query.
std::string | host_name () const
| Get the host name associated with the query.
std::string | service_name () const
| Get the service name associated with the query.

## Static Public Attributes

static const int | canonical_name = implementation_defined
| Determine the canonical name of the host specified in the query.
static const int | passive = implementation_defined
| Indicate that returned endpoint is intended for use as a locally bound socket endpoint.
static const int | numeric_host = implementation_defined
| Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.
static const int | numeric_service = implementation_defined
| Service name should be treated as a numeric string defining a port number and no name resolution should be attempted.
static const int | v4_mapped = implementation_defined
| If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses.
static const int | all_matching = implementation_defined
| If used with v4_mapped, return all matching IPv6 and IPv4 addresses.
static const int | address_configured = implementation_defined
| 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.

## Member Typedef Documentation

template<typename Protocol>

typedef Protocol boost::asio::ip::basic_resolver_query< Protocol >::protocol_type

The protocol type associated with the endpoint query.

## Constructor & Destructor Documentation

template<typename Protocol>

boost::asio::ip::basic_resolver_query< Protocol >::basic_resolver_query | ( | const std::string & | service_name,
|  | int | flags = `passive | address_configured` |
| ) |  |  |

Construct with specified service name for any protocol.

template<typename Protocol>

boost::asio::ip::basic_resolver_query< Protocol >::basic_resolver_query | ( | const protocol_type & | protocol,
|  | const std::string & | service_name,
|  | int | flags = `passive | address_configured` |
| ) |  |  |

Construct with specified service name for a given protocol.

template<typename Protocol>

boost::asio::ip::basic_resolver_query< Protocol >::basic_resolver_query | ( | const std::string & | host_name,
|  | const std::string & | service_name,
|  | int | flags = `address_configured` |
| ) |  |  |

Construct with specified host name and service name for any protocol.

template<typename Protocol>

boost::asio::ip::basic_resolver_query< Protocol >::basic_resolver_query | ( | const protocol_type & | protocol,
|  | const std::string & | host_name,
|  | const std::string & | service_name,
|  | int | flags = `address_configured` |
| ) |  |  |

Construct with specified host name and service name for a given protocol.

## Member Function Documentation

template<typename Protocol>

const boost::asio::detail::addrinfo_type& boost::asio::ip::basic_resolver_query< Protocol >::hints | ( |  | ) | const

Get the hints associated with the query.

template<typename Protocol>

std::string boost::asio::ip::basic_resolver_query< Protocol >::host_name | ( |  | ) | const

Get the host name associated with the query.

template<typename Protocol>

std::string boost::asio::ip::basic_resolver_query< Protocol >::service_name | ( |  | ) | const

Get the service name associated with the query.

## Member Data Documentation

const int boost::asio::ip::resolver_query_base::canonical_name = implementation_defined`[static, inherited]`

Determine the canonical name of the host specified in the query.

const int boost::asio::ip::resolver_query_base::passive = implementation_defined`[static, inherited]`

Indicate that returned endpoint is intended for use as a locally bound socket endpoint.

const int boost::asio::ip::resolver_query_base::numeric_host = implementation_defined`[static, inherited]`

Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.

const int boost::asio::ip::resolver_query_base::numeric_service = implementation_defined`[static, inherited]`

Service name should be treated as a numeric string defining a port number and no name resolution should be attempted.

const int boost::asio::ip::resolver_query_base::v4_mapped = implementation_defined`[static, inherited]`

If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses.

const int boost::asio::ip::resolver_query_base::all_matching = implementation_defined`[static, inherited]`

If used with v4_mapped, return all matching IPv6 and IPv4 addresses.

const int boost::asio::ip::resolver_query_base::address_configured = implementation_defined`[static, inherited]`

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.

| Copyright © 2003 - 2006 Christopher M. Kohlhoff