null_reactor.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // detail/null_reactor.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2013 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 BOOST_ASIO_DETAIL_NULL_REACTOR_HPP
  11. #define BOOST_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 <boost/asio/detail/config.hpp>
  16. #if defined(BOOST_ASIO_WINDOWS_RUNTIME)
  17. #include <boost/asio/io_service.hpp>
  18. #include <boost/asio/detail/push_options.hpp>
  19. namespace boost {
  20. namespace asio {
  21. namespace detail {
  22. class null_reactor
  23. : public boost::asio::detail::service_base<null_reactor>
  24. {
  25. public:
  26. // Constructor.
  27. null_reactor(boost::asio::io_service& io_service)
  28. : boost::asio::detail::service_base<null_reactor>(io_service)
  29. {
  30. }
  31. // Destructor.
  32. ~null_reactor()
  33. {
  34. }
  35. // Destroy all user-defined handler objects owned by the service.
  36. void shutdown_service()
  37. {
  38. }
  39. // No-op because should never be called.
  40. void run(bool /*block*/, op_queue<operation>& /*ops*/)
  41. {
  42. }
  43. // No-op.
  44. void interrupt()
  45. {
  46. }
  47. };
  48. } // namespace detail
  49. } // namespace asio
  50. } // namespace boost
  51. #include <boost/asio/detail/pop_options.hpp>
  52. #endif // defined(BOOST_ASIO_WINDOWS_RUNTIME)
  53. #endif // BOOST_ASIO_DETAIL_NULL_REACTOR_HPP