pull_coroutine_synthesized.hpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Copyright Oliver Kowalke 2009.
  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_COROUTINES_DETAIL_PULL_COROUTINE_SYNTHESIZED_H
  6. #define BOOST_COROUTINES_DETAIL_PULL_COROUTINE_SYNTHESIZED_H
  7. #include <boost/config.hpp>
  8. #include <boost/coroutine/detail/config.hpp>
  9. #include <boost/coroutine/detail/coroutine_context.hpp>
  10. #include <boost/coroutine/detail/pull_coroutine_impl.hpp>
  11. #ifdef BOOST_HAS_ABI_HEADERS
  12. # include BOOST_ABI_PREFIX
  13. #endif
  14. namespace boost {
  15. namespace coroutines {
  16. namespace detail {
  17. template< typename R >
  18. class pull_coroutine_synthesized : public pull_coroutine_impl< R >
  19. {
  20. private:
  21. typedef pull_coroutine_impl< R > impl_t;
  22. public:
  23. pull_coroutine_synthesized( coroutine_context * caller,
  24. coroutine_context * callee,
  25. bool unwind,
  26. R * result) :
  27. impl_t( caller, callee, unwind, result)
  28. {}
  29. void destroy() {}
  30. };
  31. template< typename R >
  32. class pull_coroutine_synthesized< R & > : public pull_coroutine_impl< R & >
  33. {
  34. private:
  35. typedef pull_coroutine_impl< R & > impl_t;
  36. public:
  37. pull_coroutine_synthesized( coroutine_context * caller,
  38. coroutine_context * callee,
  39. bool unwind,
  40. R * result) :
  41. impl_t( caller, callee, unwind, result)
  42. {}
  43. void destroy() {}
  44. };
  45. template<>
  46. class pull_coroutine_synthesized< void > : public pull_coroutine_impl< void >
  47. {
  48. private:
  49. typedef pull_coroutine_impl< void > impl_t;
  50. public:
  51. pull_coroutine_synthesized( coroutine_context * caller,
  52. coroutine_context * callee,
  53. bool unwind) :
  54. impl_t( caller, callee, unwind)
  55. {}
  56. inline void destroy() {}
  57. };
  58. }}}
  59. #ifdef BOOST_HAS_ABI_HEADERS
  60. # include BOOST_ABI_SUFFIX
  61. #endif
  62. #endif // BOOST_COROUTINES_DETAIL_PULL_COROUTINE_SYNTHESIZED_H