| 1 | // Copyright Oliver Kowalke 2013. |
| 2 | // Distributed under the Boost Software License, Version 1.0. |
| 3 | // (See accompanying file LICENSE_1_0.txt or copy at |
| 4 | // http://www.boost.org/LICENSE_1_0.txt) |
| 5 | |
| 6 | #ifndef BOOST_FIBERS_DETAIL_TASK_BASE_H |
| 7 | #define BOOST_FIBERS_DETAIL_TASK_BASE_H |
| 8 | |
| 9 | #include <boost/config.hpp> |
| 10 | #include <boost/intrusive_ptr.hpp> |
| 11 | |
| 12 | #include <boost/fiber/detail/config.hpp> |
| 13 | #include <boost/fiber/future/detail/shared_state.hpp> |
| 14 | |
| 15 | #ifdef BOOST_HAS_ABI_HEADERS |
| 16 | # include BOOST_ABI_PREFIX |
| 17 | #endif |
| 18 | |
| 19 | namespace boost { |
| 20 | namespace fibers { |
| 21 | namespace detail { |
| 22 | |
| 23 | template< typename R, typename ... Args > |
| 24 | struct task_base : public shared_state< R > { |
| 25 | typedef intrusive_ptr< task_base > ptr_type; |
| 26 | |
| 27 | virtual ~task_base() { |
| 28 | } |
| 29 | |
| 30 | virtual void run( Args && ... args) = 0; |
| 31 | |
| 32 | virtual ptr_type reset() = 0; |
| 33 | }; |
| 34 | |
| 35 | }}} |
| 36 | |
| 37 | #ifdef BOOST_HAS_ABI_HEADERS |
| 38 | # include BOOST_ABI_SUFFIX |
| 39 | #endif |
| 40 | |
| 41 | #endif // BOOST_FIBERS_DETAIL_TASK_BASE_H |
| 42 | |