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

« back to all changes in this revision

Viewing changes to include/libtorrent/asio/detail/handler_invoke_helpers.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Cristian Greco
  • Date: 2008-07-02 10:46:21 UTC
  • Revision ID: james.westby@ubuntu.com-20080702104621-jzx3pfke9lkcxfxn
Tags: upstream-0.13.1
ImportĀ upstreamĀ versionĀ 0.13.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// handler_invoke_helpers.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_DETAIL_HANDLER_INVOKE_HELPERS_HPP
 
12
#define ASIO_DETAIL_HANDLER_INVOKE_HELPERS_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/detail/workaround.hpp>
 
22
#include "asio/detail/pop_options.hpp"
 
23
 
 
24
#include "asio/handler_invoke_hook.hpp"
 
25
 
 
26
// Calls to asio_handler_invoke must be made from a namespace that does not
 
27
// contain overloads of this function. The asio_handler_invoke_helpers
 
28
// namespace is defined here for that purpose.
 
29
namespace asio_handler_invoke_helpers {
 
30
 
 
31
template <typename Function, typename Context>
 
32
inline void invoke(const Function& function, Context* context)
 
33
{
 
34
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
 
35
  Function tmp(function);
 
36
  tmp();
 
37
#else
 
38
  using namespace asio;
 
39
  asio_handler_invoke(function, context);
 
40
#endif
 
41
}
 
42
 
 
43
} // namespace asio_handler_invoke_helpers
 
44
 
 
45
#include "asio/detail/pop_options.hpp"
 
46
 
 
47
#endif // ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP