task_base.hpp 944 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #ifndef BOOST_FIBERS_DETAIL_TASK_BASE_H
  6. #define BOOST_FIBERS_DETAIL_TASK_BASE_H
  7. #include <boost/config.hpp>
  8. #include <boost/intrusive_ptr.hpp>
  9. #include <boost/fiber/detail/config.hpp>
  10. #include <boost/fiber/future/detail/shared_state.hpp>
  11. #ifdef BOOST_HAS_ABI_HEADERS
  12. # include BOOST_ABI_PREFIX
  13. #endif
  14. namespace boost {
  15. namespace fibers {
  16. namespace detail {
  17. template< typename R, typename ... Args >
  18. struct task_base : public shared_state< R > {
  19. typedef intrusive_ptr< task_base > ptr_type;
  20. virtual ~task_base() {
  21. }
  22. virtual void run( Args && ... args) = 0;
  23. virtual ptr_type reset() = 0;
  24. };
  25. }}}
  26. #ifdef BOOST_HAS_ABI_HEADERS
  27. # include BOOST_ABI_SUFFIX
  28. #endif
  29. #endif // BOOST_FIBERS_DETAIL_TASK_BASE_H