1 // 2 // handler_continuation_hook.hpp 3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 // 5 // Copyright (c) 2003-2016 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_HANDLER_CONTINUATION_HOOK_HPP 12 #define ASIO_HANDLER_CONTINUATION_HOOK_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" 19 20 #include "asio/detail/push_options.hpp" 21 22 namespace asio { 23 24 /// Default continuation function for handlers. 25 /** 26 * Asynchronous operations may represent a continuation of the asynchronous 27 * control flow associated with the current handler. The implementation can use 28 * this knowledge to optimise scheduling of the handler. 29 * 30 * Implement asio_handler_is_continuation for your own handlers to indicate 31 * when a handler represents a continuation. 32 * 33 * The default implementation of the continuation hook returns <tt>false</tt>. 34 * 35 * @par Example 36 * @code 37 * class my_handler; 38 * 39 * bool asio_handler_is_continuation(my_handler* context) 40 * { 41 * return true; 42 * } 43 * @endcode 44 */ asio_handler_is_continuation(...)45inline bool asio_handler_is_continuation(...) 46 { 47 return false; 48 } 49 50 } // namespace asio 51 52 #include "asio/detail/pop_options.hpp" 53 54 #endif // ASIO_HANDLER_CONTINUATION_HOOK_HPP 55