null_reactor.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // detail/null_reactor.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef ASIO_DETAIL_NULL_REACTOR_HPP
  11. #define ASIO_DETAIL_NULL_REACTOR_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #if defined(ASIO_WINDOWS_RUNTIME)
  17. #include "asio/io_service.hpp"
  18. #include "asio/detail/push_options.hpp"
  19. namespace asio {
  20. namespace detail {
  21. class null_reactor
  22. : public asio::detail::service_base<null_reactor>
  23. {
  24. public:
  25. // Constructor.
  26. null_reactor(asio::io_service& io_service)
  27. : asio::detail::service_base<null_reactor>(io_service)
  28. {
  29. }
  30. // Destructor.
  31. ~null_reactor()
  32. {
  33. }
  34. // Destroy all user-defined handler objects owned by the service.
  35. void shutdown_service()
  36. {
  37. }
  38. // No-op because should never be called.
  39. void run(bool /*block*/, op_queue<operation>& /*ops*/)
  40. {
  41. }
  42. // No-op.
  43. void interrupt()
  44. {
  45. }
  46. };
  47. } // namespace detail
  48. } // namespace asio
  49. #include "asio/detail/pop_options.hpp"
  50. #endif // defined(ASIO_WINDOWS_RUNTIME)
  51. #endif // ASIO_DETAIL_NULL_REACTOR_HPP