diff options
Diffstat (limited to '3rdParty/Boost/src/boost/asio/impl/io_service.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/impl/io_service.hpp | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/3rdParty/Boost/src/boost/asio/impl/io_service.hpp b/3rdParty/Boost/src/boost/asio/impl/io_service.hpp index 152f983..510de0e 100644 --- a/3rdParty/Boost/src/boost/asio/impl/io_service.hpp +++ b/3rdParty/Boost/src/boost/asio/impl/io_service.hpp @@ -2,7 +2,7 @@ // impl/io_service.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -15,6 +15,7 @@ # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) +#include <boost/asio/detail/handler_type_requirements.hpp> #include <boost/asio/detail/service_registry.hpp> #include <boost/asio/detail/push_options.hpp> @@ -32,6 +33,13 @@ inline Service& use_service(io_service& ios) return ios.service_registry_->template use_service<Service>(); } +template <> +inline detail::io_service_impl& use_service<detail::io_service_impl>( + io_service& ios) +{ + return ios.impl_; +} + template <typename Service> inline void add_service(io_service& ios, Service* svc) { @@ -68,16 +76,25 @@ inline bool has_service(io_service& ios) namespace boost { namespace asio { -template <typename Handler> -inline void io_service::dispatch(Handler handler) +template <typename CompletionHandler> +inline void io_service::dispatch( + BOOST_ASIO_MOVE_ARG(CompletionHandler) handler) { - impl_.dispatch(handler); + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a CompletionHandler. + BOOST_ASIO_COMPLETION_HANDLER_CHECK(CompletionHandler, handler) type_check; + + impl_.dispatch(BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler)); } -template <typename Handler> -inline void io_service::post(Handler handler) +template <typename CompletionHandler> +inline void io_service::post(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler) { - impl_.post(handler); + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a CompletionHandler. + BOOST_ASIO_COMPLETION_HANDLER_CHECK(CompletionHandler, handler) type_check; + + impl_.post(BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler)); } template <typename Handler> @@ -92,35 +109,25 @@ io_service::wrap(Handler handler) } inline io_service::work::work(boost::asio::io_service& io_service) - : io_service_(io_service) + : io_service_impl_(io_service.impl_) { - io_service_.impl_.work_started(); + io_service_impl_.work_started(); } inline io_service::work::work(const work& other) - : io_service_(other.io_service_) + : io_service_impl_(other.io_service_impl_) { - io_service_.impl_.work_started(); + io_service_impl_.work_started(); } inline io_service::work::~work() { - io_service_.impl_.work_finished(); -} - -inline boost::asio::io_service& io_service::work::io_service() -{ - return io_service_; + io_service_impl_.work_finished(); } inline boost::asio::io_service& io_service::work::get_io_service() { - return io_service_; -} - -inline boost::asio::io_service& io_service::service::io_service() -{ - return owner_; + return io_service_impl_.get_io_service(); } inline boost::asio::io_service& io_service::service::get_io_service() |