summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/asio/strand.hpp')
-rw-r--r--3rdParty/Boost/src/boost/asio/strand.hpp38
1 files changed, 16 insertions, 22 deletions
diff --git a/3rdParty/Boost/src/boost/asio/strand.hpp b/3rdParty/Boost/src/boost/asio/strand.hpp
index 2928167..6a1033f 100644
--- a/3rdParty/Boost/src/boost/asio/strand.hpp
+++ b/3rdParty/Boost/src/boost/asio/strand.hpp
@@ -2,7 +2,7 @@
// strand.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)
@@ -16,6 +16,7 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/handler_type_requirements.hpp>
#include <boost/asio/detail/strand_service.hpp>
#include <boost/asio/detail/wrapped_handler.hpp>
#include <boost/asio/io_service.hpp>
@@ -104,21 +105,6 @@ public:
*/
~strand()
{
- service_.destroy(impl_);
- }
-
- /// (Deprecated: use get_io_service().) Get the io_service associated with
- /// the strand.
- /**
- * This function may be used to obtain the io_service object that the strand
- * uses to dispatch handlers for asynchronous operations.
- *
- * @return A reference to the io_service object that the strand will use to
- * dispatch handlers. Ownership is not transferred to the caller.
- */
- boost::asio::io_service& io_service()
- {
- return service_.get_io_service();
}
/// Get the io_service associated with the strand.
@@ -153,10 +139,14 @@ public:
* handler object as required. The function signature of the handler must be:
* @code void handler(); @endcode
*/
- template <typename Handler>
- void dispatch(Handler handler)
+ template <typename CompletionHandler>
+ void dispatch(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler)
{
- service_.dispatch(impl_, 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;
+
+ service_.dispatch(impl_, BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler));
}
/// Request the strand to invoke the given handler and return
@@ -175,10 +165,14 @@ public:
* handler object as required. The function signature of the handler must be:
* @code void handler(); @endcode
*/
- template <typename Handler>
- void post(Handler handler)
+ template <typename CompletionHandler>
+ void post(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler)
{
- service_.post(impl_, 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;
+
+ service_.post(impl_, BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler));
}
/// Create a new handler that automatically dispatches the wrapped handler