123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- #ifndef BOOST_ASIO_SIGNAL_SET_SERVICE_HPP
- #define BOOST_ASIO_SIGNAL_SET_SERVICE_HPP
- #if defined(_MSC_VER) && (_MSC_VER >= 1200)
- # pragma once
- #endif
- #include <boost/asio/detail/config.hpp>
- #include <boost/asio/async_result.hpp>
- #include <boost/asio/detail/signal_set_service.hpp>
- #include <boost/asio/error.hpp>
- #include <boost/asio/io_service.hpp>
- #include <boost/asio/detail/push_options.hpp>
- namespace boost {
- namespace asio {
- class signal_set_service
- #if defined(GENERATING_DOCUMENTATION)
- : public boost::asio::io_service::service
- #else
- : public boost::asio::detail::service_base<signal_set_service>
- #endif
- {
- public:
- #if defined(GENERATING_DOCUMENTATION)
-
- static boost::asio::io_service::id id;
- #endif
- public:
-
- #if defined(GENERATING_DOCUMENTATION)
- typedef implementation_defined implementation_type;
- #else
- typedef detail::signal_set_service::implementation_type implementation_type;
- #endif
-
- explicit signal_set_service(boost::asio::io_service& io_service)
- : boost::asio::detail::service_base<signal_set_service>(io_service),
- service_impl_(io_service)
- {
- }
-
- void construct(implementation_type& impl)
- {
- service_impl_.construct(impl);
- }
-
- void destroy(implementation_type& impl)
- {
- service_impl_.destroy(impl);
- }
-
- boost::system::error_code add(implementation_type& impl,
- int signal_number, boost::system::error_code& ec)
- {
- return service_impl_.add(impl, signal_number, ec);
- }
-
- boost::system::error_code remove(implementation_type& impl,
- int signal_number, boost::system::error_code& ec)
- {
- return service_impl_.remove(impl, signal_number, ec);
- }
-
- boost::system::error_code clear(implementation_type& impl,
- boost::system::error_code& ec)
- {
- return service_impl_.clear(impl, ec);
- }
-
- boost::system::error_code cancel(implementation_type& impl,
- boost::system::error_code& ec)
- {
- return service_impl_.cancel(impl, ec);
- }
-
- template <typename SignalHandler>
- BOOST_ASIO_INITFN_RESULT_TYPE(SignalHandler,
- void (boost::system::error_code, int))
- async_wait(implementation_type& impl,
- BOOST_ASIO_MOVE_ARG(SignalHandler) handler)
- {
- detail::async_result_init<
- SignalHandler, void (boost::system::error_code, int)> init(
- BOOST_ASIO_MOVE_CAST(SignalHandler)(handler));
- service_impl_.async_wait(impl, init.handler);
- return init.result.get();
- }
- private:
-
- void shutdown_service()
- {
- service_impl_.shutdown_service();
- }
-
- void fork_service(boost::asio::io_service::fork_event event)
- {
- service_impl_.fork_service(event);
- }
-
- detail::signal_set_service service_impl_;
- };
- }
- }
- #include <boost/asio/detail/pop_options.hpp>
- #endif
|