Chris@16
|
1 //
|
Chris@16
|
2 // detail/handler_cont_helpers.hpp
|
Chris@16
|
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Chris@16
|
4 //
|
Chris@101
|
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
Chris@16
|
6 //
|
Chris@16
|
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
9 //
|
Chris@16
|
10
|
Chris@16
|
11 #ifndef BOOST_ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP
|
Chris@16
|
12 #define BOOST_ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP
|
Chris@16
|
13
|
Chris@16
|
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
Chris@16
|
15 # pragma once
|
Chris@16
|
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
|
Chris@16
|
17
|
Chris@16
|
18 #include <boost/asio/detail/config.hpp>
|
Chris@16
|
19 #include <boost/asio/detail/addressof.hpp>
|
Chris@16
|
20 #include <boost/asio/handler_continuation_hook.hpp>
|
Chris@16
|
21
|
Chris@16
|
22 #include <boost/asio/detail/push_options.hpp>
|
Chris@16
|
23
|
Chris@16
|
24 // Calls to asio_handler_is_continuation must be made from a namespace that
|
Chris@16
|
25 // does not contain overloads of this function. This namespace is defined here
|
Chris@16
|
26 // for that purpose.
|
Chris@16
|
27 namespace boost_asio_handler_cont_helpers {
|
Chris@16
|
28
|
Chris@16
|
29 template <typename Context>
|
Chris@16
|
30 inline bool is_continuation(Context& context)
|
Chris@16
|
31 {
|
Chris@16
|
32 #if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
|
Chris@16
|
33 return false;
|
Chris@16
|
34 #else
|
Chris@16
|
35 using boost::asio::asio_handler_is_continuation;
|
Chris@16
|
36 return asio_handler_is_continuation(
|
Chris@16
|
37 boost::asio::detail::addressof(context));
|
Chris@16
|
38 #endif
|
Chris@16
|
39 }
|
Chris@16
|
40
|
Chris@16
|
41 } // namespace boost_asio_handler_cont_helpers
|
Chris@16
|
42
|
Chris@16
|
43 #include <boost/asio/detail/pop_options.hpp>
|
Chris@16
|
44
|
Chris@16
|
45 #endif // BOOST_ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP
|