File indexing completed on 2025-01-18 09:29:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_ASIO_SYSTEM_CONTEXT_HPP
0012 #define BOOST_ASIO_SYSTEM_CONTEXT_HPP
0013
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif
0017
0018 #include <boost/asio/detail/config.hpp>
0019 #include <boost/asio/detail/scheduler.hpp>
0020 #include <boost/asio/detail/thread_group.hpp>
0021 #include <boost/asio/execution.hpp>
0022 #include <boost/asio/execution_context.hpp>
0023
0024 #include <boost/asio/detail/push_options.hpp>
0025
0026 namespace boost {
0027 namespace asio {
0028
0029 template <typename Blocking, typename Relationship, typename Allocator>
0030 class basic_system_executor;
0031
0032
0033 class system_context : public execution_context
0034 {
0035 public:
0036
0037 typedef basic_system_executor<
0038 execution::blocking_t::possibly_t,
0039 execution::relationship_t::fork_t,
0040 std::allocator<void>
0041 > executor_type;
0042
0043
0044 BOOST_ASIO_DECL ~system_context();
0045
0046
0047 executor_type get_executor() noexcept;
0048
0049
0050 BOOST_ASIO_DECL void stop();
0051
0052
0053 BOOST_ASIO_DECL bool stopped() const noexcept;
0054
0055
0056 BOOST_ASIO_DECL void join();
0057
0058 #if defined(GENERATING_DOCUMENTATION)
0059 private:
0060 #endif
0061
0062 BOOST_ASIO_DECL system_context();
0063
0064 private:
0065 template <typename, typename, typename> friend class basic_system_executor;
0066
0067 struct thread_function;
0068
0069
0070 BOOST_ASIO_DECL detail::scheduler& add_scheduler(detail::scheduler* s);
0071
0072
0073 detail::scheduler& scheduler_;
0074
0075
0076 detail::thread_group threads_;
0077
0078
0079 std::size_t num_threads_;
0080 };
0081
0082 }
0083 }
0084
0085 #include <boost/asio/detail/pop_options.hpp>
0086
0087 #include <boost/asio/impl/system_context.hpp>
0088 #if defined(BOOST_ASIO_HEADER_ONLY)
0089 # include <boost/asio/impl/system_context.ipp>
0090 #endif
0091
0092 #endif