Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:32

0001 
0002 //          Copyright Oliver Kowalke 2009.
0003 // Distributed under the Boost Software License, Version 1.0.
0004 //    (See accompanying file LICENSE_1_0.txt or copy at
0005 //          http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_COROUTINES_DETAIL_TRAMPOLINE_PULL_H
0008 #define BOOST_COROUTINES_DETAIL_TRAMPOLINE_PULL_H
0009 
0010 #include <boost/assert.hpp>
0011 #include <boost/config.hpp>
0012 #include <boost/context/detail/fcontext.hpp>
0013 #include <boost/cstdint.hpp>
0014 
0015 #include <boost/coroutine/detail/config.hpp>
0016 #include <boost/coroutine/detail/data.hpp>
0017 
0018 #ifdef BOOST_HAS_ABI_HEADERS
0019 #  include BOOST_ABI_PREFIX
0020 #endif
0021 
0022 namespace boost {
0023 namespace coroutines {
0024 namespace detail {
0025 
0026 template< typename Coro >
0027 void trampoline_pull( context::detail::transfer_t t)
0028 {
0029     typedef typename Coro::param_type   param_type;
0030 
0031     data_t * data = static_cast< data_t * >( t.data);
0032     data->from->ctx_ = t.fctx;
0033     param_type * param(
0034         static_cast< param_type * >( data->data) );
0035     BOOST_ASSERT( 0 != param);
0036 
0037     Coro * coro(
0038         static_cast< Coro * >( param->coro) );
0039     BOOST_ASSERT( 0 != coro);
0040 
0041     coro->run();
0042 }
0043 
0044 }}}
0045 
0046 #ifdef BOOST_HAS_ABI_HEADERS
0047 #  include BOOST_ABI_SUFFIX
0048 #endif
0049 
0050 #endif // BOOST_COROUTINES_DETAIL_TRAMPOLINE_PULL_H