~ubuntu-branches/ubuntu/maverick/libtorrent-rasterbar/maverick

« back to all changes in this revision

Viewing changes to include/libtorrent/asio/ip/resolver_query_base.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Sauthier
  • Date: 2010-08-10 12:59:37 UTC
  • mfrom: (1.3.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100810125937-jbcmmf17y8yo9hgz
Tags: 0.15.0-0ubuntu1
* New upstream version.
* debian/patches/100_fix_html_docs.patch: refreshed.
* debian/control: bump up standards-version to 3.9.1 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
// resolver_query_base.hpp
3
 
// ~~~~~~~~~~~~~~~~~~~~~~~
4
 
//
5
 
// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6
 
//
7
 
// Distributed under the Boost Software License, Version 1.0. (See accompanying
8
 
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9
 
//
10
 
 
11
 
#ifndef ASIO_IP_RESOLVER_QUERY_BASE_HPP
12
 
#define ASIO_IP_RESOLVER_QUERY_BASE_HPP
13
 
 
14
 
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15
 
# pragma once
16
 
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
 
 
18
 
#include "asio/detail/push_options.hpp"
19
 
 
20
 
#include "asio/detail/push_options.hpp"
21
 
#include <boost/config.hpp>
22
 
#include <boost/detail/workaround.hpp>
23
 
#include "asio/detail/pop_options.hpp"
24
 
 
25
 
#include "asio/detail/socket_types.hpp"
26
 
 
27
 
namespace asio {
28
 
namespace ip {
29
 
 
30
 
/// The resolver_query_base class is used as a base for the
31
 
/// basic_resolver_query class templates to provide a common place to define
32
 
/// the flag constants.
33
 
class resolver_query_base
34
 
{
35
 
public:
36
 
#if defined(GENERATING_DOCUMENTATION)
37
 
  /// Determine the canonical name of the host specified in the query.
38
 
  static const int canonical_name = implementation_defined;
39
 
 
40
 
  /// Indicate that returned endpoint is intended for use as a locally bound
41
 
  /// socket endpoint.
42
 
  static const int passive = implementation_defined;
43
 
 
44
 
  /// Host name should be treated as a numeric string defining an IPv4 or IPv6
45
 
  /// address and no name resolution should be attempted.
46
 
  static const int numeric_host = implementation_defined;
47
 
 
48
 
  /// Service name should be treated as a numeric string defining a port number
49
 
  /// and no name resolution should be attempted.
50
 
  static const int numeric_service = implementation_defined;
51
 
 
52
 
  /// If the query protocol family is specified as IPv6, return IPv4-mapped
53
 
  /// IPv6 addresses on finding no IPv6 addresses.
54
 
  static const int v4_mapped = implementation_defined;
55
 
 
56
 
  /// If used with v4_mapped, return all matching IPv6 and IPv4 addresses.
57
 
  static const int all_matching = implementation_defined;
58
 
 
59
 
  /// Only return IPv4 addresses if a non-loopback IPv4 address is configured
60
 
  /// for the system. Only return IPv6 addresses if a non-loopback IPv6 address
61
 
  /// is configured for the system.
62
 
  static const int address_configured = implementation_defined;
63
 
#else
64
 
  BOOST_STATIC_CONSTANT(int, canonical_name = AI_CANONNAME);
65
 
  BOOST_STATIC_CONSTANT(int, passive = AI_PASSIVE);
66
 
  BOOST_STATIC_CONSTANT(int, numeric_host = AI_NUMERICHOST);
67
 
# if defined(AI_NUMERICSERV)
68
 
  BOOST_STATIC_CONSTANT(int, numeric_service = AI_NUMERICSERV);
69
 
# else
70
 
  BOOST_STATIC_CONSTANT(int, numeric_service = 0);
71
 
# endif
72
 
  // Note: QNX Neutrino 6.3 defines AI_V4MAPPED, AI_ALL and AI_ADDRCONFIG but
73
 
  // does not implement them. Therefore they are specifically excluded here.
74
 
# if defined(AI_V4MAPPED) && !defined(__QNXNTO__)
75
 
  BOOST_STATIC_CONSTANT(int, v4_mapped = AI_V4MAPPED);
76
 
# else
77
 
  BOOST_STATIC_CONSTANT(int, v4_mapped = 0);
78
 
# endif
79
 
# if defined(AI_ALL) && !defined(__QNXNTO__)
80
 
  BOOST_STATIC_CONSTANT(int, all_matching = AI_ALL);
81
 
# else
82
 
  BOOST_STATIC_CONSTANT(int, all_matching = 0);
83
 
# endif
84
 
# if defined(AI_ADDRCONFIG) && !defined(__QNXNTO__)
85
 
  BOOST_STATIC_CONSTANT(int, address_configured = AI_ADDRCONFIG);
86
 
# else
87
 
  BOOST_STATIC_CONSTANT(int, address_configured = 0);
88
 
# endif
89
 
#endif
90
 
 
91
 
protected:
92
 
  /// Protected destructor to prevent deletion through this type.
93
 
  ~resolver_query_base()
94
 
  {
95
 
  }
96
 
 
97
 
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
98
 
private:
99
 
  // Workaround to enable the empty base optimisation with Borland C++.
100
 
  char dummy_;
101
 
#endif
102
 
};
103
 
 
104
 
} // namespace ip
105
 
} // namespace asio
106
 
 
107
 
#include "asio/detail/pop_options.hpp"
108
 
 
109
 
#endif // ASIO_IP_RESOLVER_QUERY_BASE_HPP