Realistic 3D camera system
3D camera system components
handler_invoke_helpers.hpp
Go to the documentation of this file.
1 //
2 // detail/handler_invoke_helpers.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 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/config.hpp"
21 
23 
24 // Calls to asio_handler_invoke must be made from a namespace that does not
25 // contain overloads of this function. The asio_handler_invoke_helpers
26 // namespace is defined here for that purpose.
28 
29 template <typename Function, typename Context>
30 inline void invoke(Function& function, Context& context)
31 {
32 #if !defined(ASIO_HAS_HANDLER_HOOKS)
33  Function tmp(function);
34  tmp();
35 #else
37  asio_handler_invoke(function, asio::detail::addressof(context));
38 #endif
39 }
40 
41 template <typename Function, typename Context>
42 inline void invoke(const Function& function, Context& context)
43 {
44 #if !defined(ASIO_HAS_HANDLER_HOOKS)
45  Function tmp(function);
46  tmp();
47 #else
49  asio_handler_invoke(function, asio::detail::addressof(context));
50 #endif
51 }
52 
53 } // namespace asio_handler_invoke_helpers
54 
56 
57 #endif // ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP
void invoke(Function &function, Context &context)
void asio_handler_invoke(Function &function,...)
Default handler invocation hook used for non-const function objects.
void asio_handler_invoke(Function f, handler_priority_queue::wrapped_handler< Handler > *h)