PageRenderTime 52ms CodeModel.GetById 41ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/asio/placeholders.hpp

http://hadesmem.googlecode.com/
C++ Header | 122 lines | 75 code | 26 blank | 21 comment | 2 complexity | 2d3ba588469d1835b556f901609b9b0a MD5 | raw file
  1//
  2// placeholders.hpp
  3// ~~~~~~~~~~~~~~~~
  4//
  5// Copyright (c) 2003-2011 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 BOOST_ASIO_PLACEHOLDERS_HPP
 12#define BOOST_ASIO_PLACEHOLDERS_HPP
 13
 14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
 15# pragma once
 16#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 17
 18#include <boost/asio/detail/config.hpp>
 19#include <boost/bind/arg.hpp>
 20#include <boost/detail/workaround.hpp>
 21
 22#include <boost/asio/detail/push_options.hpp>
 23
 24namespace boost {
 25namespace asio {
 26namespace placeholders {
 27
 28#if defined(GENERATING_DOCUMENTATION)
 29
 30/// An argument placeholder, for use with boost::bind(), that corresponds to
 31/// the error argument of a handler for any of the asynchronous functions.
 32unspecified error;
 33
 34/// An argument placeholder, for use with boost::bind(), that corresponds to
 35/// the bytes_transferred argument of a handler for asynchronous functions such
 36/// as boost::asio::basic_stream_socket::async_write_some or
 37/// boost::asio::async_write.
 38unspecified bytes_transferred;
 39
 40/// An argument placeholder, for use with boost::bind(), that corresponds to
 41/// the iterator argument of a handler for asynchronous functions such as
 42/// boost::asio::basic_resolver::async_resolve.
 43unspecified iterator;
 44
 45/// An argument placeholder, for use with boost::bind(), that corresponds to
 46/// the signal_number argument of a handler for asynchronous functions such as
 47/// boost::asio::signal_set::async_wait.
 48unspecified signal_number;
 49
 50#elif defined(__BORLANDC__) || defined(__GNUC__)
 51
 52inline boost::arg<1> error()
 53{
 54  return boost::arg<1>();
 55}
 56
 57inline boost::arg<2> bytes_transferred()
 58{
 59  return boost::arg<2>();
 60}
 61
 62inline boost::arg<2> iterator()
 63{
 64  return boost::arg<2>();
 65}
 66
 67inline boost::arg<2> signal_number()
 68{
 69  return boost::arg<2>();
 70}
 71
 72#else
 73
 74namespace detail
 75{
 76  template <int Number>
 77  struct placeholder
 78  {
 79    static boost::arg<Number>& get()
 80    {
 81      static boost::arg<Number> result;
 82      return result;
 83    }
 84  };
 85}
 86
 87#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
 88
 89static boost::arg<1>& error
 90  = boost::asio::placeholders::detail::placeholder<1>::get();
 91static boost::arg<2>& bytes_transferred
 92  = boost::asio::placeholders::detail::placeholder<2>::get();
 93static boost::arg<2>& iterator
 94  = boost::asio::placeholders::detail::placeholder<2>::get();
 95static boost::arg<2>& signal_number
 96  = boost::asio::placeholders::detail::placeholder<2>::get();
 97
 98#else
 99
100namespace
101{
102  boost::arg<1>& error
103    = boost::asio::placeholders::detail::placeholder<1>::get();
104  boost::arg<2>& bytes_transferred
105    = boost::asio::placeholders::detail::placeholder<2>::get();
106  boost::arg<2>& iterator
107    = boost::asio::placeholders::detail::placeholder<2>::get();
108  boost::arg<2>& signal_number
109    = boost::asio::placeholders::detail::placeholder<2>::get();
110} // namespace
111
112#endif
113
114#endif
115
116} // namespace placeholders
117} // namespace asio
118} // namespace boost
119
120#include <boost/asio/detail/pop_options.hpp>
121
122#endif // BOOST_ASIO_PLACEHOLDERS_HPP