Chris@16: // Chris@16: // handler_continuation_hook.hpp Chris@16: // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Chris@16: // Chris@101: // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: Chris@16: #ifndef BOOST_ASIO_HANDLER_CONTINUATION_HOOK_HPP Chris@16: #define BOOST_ASIO_HANDLER_CONTINUATION_HOOK_HPP Chris@16: Chris@16: #if defined(_MSC_VER) && (_MSC_VER >= 1200) Chris@16: # pragma once Chris@16: #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace asio { Chris@16: Chris@16: /// Default continuation function for handlers. Chris@16: /** Chris@16: * Asynchronous operations may represent a continuation of the asynchronous Chris@16: * control flow associated with the current handler. The implementation can use Chris@16: * this knowledge to optimise scheduling of the handler. Chris@16: * Chris@16: * Implement asio_handler_is_continuation for your own handlers to indicate Chris@16: * when a handler represents a continuation. Chris@16: * Chris@16: * The default implementation of the continuation hook returns false. Chris@16: * Chris@16: * @par Example Chris@16: * @code Chris@16: * class my_handler; Chris@16: * Chris@16: * bool asio_handler_is_continuation(my_handler* context) Chris@16: * { Chris@16: * return true; Chris@16: * } Chris@16: * @endcode Chris@16: */ Chris@16: inline bool asio_handler_is_continuation(...) Chris@16: { Chris@16: return false; Chris@16: } Chris@16: Chris@16: } // namespace asio Chris@16: } // namespace boost Chris@16: Chris@16: #include Chris@16: Chris@16: #endif // BOOST_ASIO_HANDLER_CONTINUATION_HOOK_HPP