async_handler.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright (c) 2016 Klemens D. Morgenstern
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_PROCESS_POSIX_ASYNC_HANDLER_HPP_
  6. #define BOOST_PROCESS_POSIX_ASYNC_HANDLER_HPP_
  7. #include <boost/process/detail/posix/handler.hpp>
  8. #include <type_traits>
  9. namespace boost { namespace process { namespace detail { namespace posix {
  10. struct require_io_context {};
  11. struct async_handler : handler_base_ext, require_io_context
  12. {
  13. };
  14. template<typename T>
  15. struct is_async_handler : std::is_base_of<async_handler, T> {};
  16. template<typename T>
  17. struct is_async_handler<T&> : std::is_base_of<async_handler, T> {};
  18. template<typename T>
  19. struct is_async_handler<const T&> : std::is_base_of<async_handler, T> {};
  20. template<typename T>
  21. struct does_require_io_context : std::is_base_of<require_io_context, T> {};
  22. template<typename T>
  23. struct does_require_io_context<T&> : std::is_base_of<require_io_context, T> {};
  24. template<typename T>
  25. struct does_require_io_context<const T&> : std::is_base_of<require_io_context, T> {};
  26. }}}}
  27. #endif /* BOOST_PROCESS_WINDOWS_ASYNC_HANDLER_HPP_ */