/
usr
/
include
/
boost
/
asio
/
/usr/include/boost/asio
mkdir
upload
Name
Size
Mode
Actions
detail/
-
0755
rm
execution/
-
0755
rm
generic/
-
0755
rm
impl/
-
0755
rm
ip/
-
0755
rm
local/
-
0755
rm
posix/
-
0755
rm
ssl/
-
0755
rm
traits/
-
0755
rm
ts/
-
0755
rm
windows/
-
0755
rm
any_io_executor.hpp
2625
0644
edit
dl
rm
associated_allocator.hpp
3791
0644
edit
dl
rm
associated_executor.hpp
5057
0644
edit
dl
rm
async_result.hpp
19423
0644
edit
dl
rm
awaitable.hpp
3270
0644
edit
dl
rm
basic_datagram_socket.hpp
47521
0644
edit
dl
rm
basic_deadline_timer.hpp
24158
0644
edit
dl
rm
basic_io_object.hpp
8096
0644
edit
dl
rm
basic_raw_socket.hpp
46996
0644
edit
dl
rm
basic_seq_packet_socket.hpp
29184
0644
edit
dl
rm
basic_serial_port.hpp
31912
0644
edit
dl
rm
basic_signal_set.hpp
19876
0644
edit
dl
rm
basic_socket.hpp
65516
0644
edit
dl
rm
basic_socket_acceptor.hpp
88062
0644
edit
dl
rm
basic_socket_iostream.hpp
13298
0644
edit
dl
rm
basic_socket_streambuf.hpp
21713
0644
edit
dl
rm
basic_streambuf.hpp
13714
0644
edit
dl
rm
basic_streambuf_fwd.hpp
920
0644
edit
dl
rm
basic_stream_socket.hpp
41520
0644
edit
dl
rm
basic_waitable_timer.hpp
28528
0644
edit
dl
rm
bind_executor.hpp
16510
0644
edit
dl
rm
buffer.hpp
83254
0644
edit
dl
rm
buffered_read_stream.hpp
8424
0644
edit
dl
rm
buffered_read_stream_fwd.hpp
699
0644
edit
dl
rm
buffered_stream.hpp
9074
0644
edit
dl
rm
buffered_stream_fwd.hpp
669
0644
edit
dl
rm
buffered_write_stream.hpp
8042
0644
edit
dl
rm
buffered_write_stream_fwd.hpp
705
0644
edit
dl
rm
buffers_iterator.hpp
14049
0644
edit
dl
rm
completion_condition.hpp
5500
0644
edit
dl
rm
compose.hpp
4596
0644
edit
dl
rm
connect.hpp
43157
0644
edit
dl
rm
coroutine.hpp
9897
0644
edit
dl
rm
co_spawn.hpp
14509
0644
edit
dl
rm
deadline_timer.hpp
1138
0644
edit
dl
rm
defer.hpp
5070
0644
edit
dl
rm
detached.hpp
3517
0644
edit
dl
rm
dispatch.hpp
4537
0644
edit
dl
rm
error.hpp
10351
0644
edit
dl
rm
execution.hpp
1871
0644
edit
dl
rm
execution_context.hpp
14341
0644
edit
dl
rm
executor.hpp
10467
0644
edit
dl
rm
executor_work_guard.hpp
8039
0644
edit
dl
rm
handler_alloc_hook.hpp
3471
0644
edit
dl
rm
handler_continuation_hook.hpp
1474
0644
edit
dl
rm
handler_invoke_hook.hpp
3744
0644
edit
dl
rm
high_resolution_timer.hpp
1394
0644
edit
dl
rm
io_context.hpp
55226
0644
edit
dl
rm
io_context_strand.hpp
13706
0644
edit
dl
rm
io_service.hpp
861
0644
edit
dl
rm
io_service_strand.hpp
575
0644
edit
dl
rm
is_applicable_property.hpp
1605
0644
edit
dl
rm
is_executor.hpp
1306
0644
edit
dl
rm
is_read_buffered.hpp
1646
0644
edit
dl
rm
is_write_buffered.hpp
1667
0644
edit
dl
rm
multiple_exceptions.hpp
1631
0644
edit
dl
rm
packaged_task.hpp
3358
0644
edit
dl
rm
placeholders.hpp
4146
0644
edit
dl
rm
post.hpp
4760
0644
edit
dl
rm
prefer.hpp
18821
0644
edit
dl
rm
query.hpp
8323
0644
edit
dl
rm
read.hpp
53894
0644
edit
dl
rm
read_at.hpp
27766
0644
edit
dl
rm
read_until.hpp
119477
0644
edit
dl
rm
redirect_error.hpp
1938
0644
edit
dl
rm
require.hpp
14926
0644
edit
dl
rm
require_concept.hpp
9218
0644
edit
dl
rm
serial_port.hpp
1010
0644
edit
dl
rm
serial_port_base.hpp
4975
0644
edit
dl
rm
signal_set.hpp
748
0644
edit
dl
rm
socket_base.hpp
15939
0644
edit
dl
rm
spawn.hpp
11793
0644
edit
dl
rm
ssl.hpp
848
0644
edit
dl
rm
static_thread_pool.hpp
826
0644
edit
dl
rm
steady_timer.hpp
1306
0644
edit
dl
rm
strand.hpp
17193
0644
edit
dl
rm
streambuf.hpp
826
0644
edit
dl
rm
system_context.hpp
2649
0644
edit
dl
rm
system_executor.hpp
22529
0644
edit
dl
rm
system_timer.hpp
1306
0644
edit
dl
rm
this_coro.hpp
1149
0644
edit
dl
rm
thread_pool.hpp
37567
0644
edit
dl
rm
time_traits.hpp
2281
0644
edit
dl
rm
unyield.hpp
381
0644
edit
dl
rm
uses_executor.hpp
2348
0644
edit
dl
rm
use_awaitable.hpp
5821
0644
edit
dl
rm
use_future.hpp
4820
0644
edit
dl
rm
version.hpp
686
0644
edit
dl
rm
wait_traits.hpp
1451
0644
edit
dl
rm
write.hpp
52959
0644
edit
dl
rm
write_at.hpp
29514
0644
edit
dl
rm
yield.hpp
482
0644
edit
dl
rm
Edit:
/usr/include/boost/asio/bind_executor.hpp
(16510B)
// // bind_executor.hpp // ~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2020 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) // #ifndef BOOST_ASIO_BIND_EXECUTOR_HPP #define BOOST_ASIO_BIND_EXECUTOR_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include <boost/asio/detail/config.hpp> #include <boost/asio/detail/type_traits.hpp> #include <boost/asio/detail/variadic_templates.hpp> #include <boost/asio/associated_executor.hpp> #include <boost/asio/associated_allocator.hpp> #include <boost/asio/async_result.hpp> #include <boost/asio/execution/executor.hpp> #include <boost/asio/execution_context.hpp> #include <boost/asio/is_executor.hpp> #include <boost/asio/uses_executor.hpp> #include <boost/asio/detail/push_options.hpp> namespace boost { namespace asio { namespace detail { // Helper to automatically define nested typedef result_type. template <typename T, typename = void> struct executor_binder_result_type { protected: typedef void result_type_or_void; }; template <typename T> struct executor_binder_result_type<T, typename void_type<typename T::result_type>::type> { typedef typename T::result_type result_type; protected: typedef result_type result_type_or_void; }; template <typename R> struct executor_binder_result_type<R(*)()> { typedef R result_type; protected: typedef result_type result_type_or_void; }; template <typename R> struct executor_binder_result_type<R(&)()> { typedef R result_type; protected: typedef result_type result_type_or_void; }; template <typename R, typename A1> struct executor_binder_result_type<R(*)(A1)> { typedef R result_type; protected: typedef result_type result_type_or_void; }; template <typename R, typename A1> struct executor_binder_result_type<R(&)(A1)> { typedef R result_type; protected: typedef result_type result_type_or_void; }; template <typename R, typename A1, typename A2> struct executor_binder_result_type<R(*)(A1, A2)> { typedef R result_type; protected: typedef result_type result_type_or_void; }; template <typename R, typename A1, typename A2> struct executor_binder_result_type<R(&)(A1, A2)> { typedef R result_type; protected: typedef result_type result_type_or_void; }; // Helper to automatically define nested typedef argument_type. template <typename T, typename = void> struct executor_binder_argument_type {}; template <typename T> struct executor_binder_argument_type<T, typename void_type<typename T::argument_type>::type> { typedef typename T::argument_type argument_type; }; template <typename R, typename A1> struct executor_binder_argument_type<R(*)(A1)> { typedef A1 argument_type; }; template <typename R, typename A1> struct executor_binder_argument_type<R(&)(A1)> { typedef A1 argument_type; }; // Helper to automatically define nested typedefs first_argument_type and // second_argument_type. template <typename T, typename = void> struct executor_binder_argument_types {}; template <typename T> struct executor_binder_argument_types<T, typename void_type<typename T::first_argument_type>::type> { typedef typename T::first_argument_type first_argument_type; typedef typename T::second_argument_type second_argument_type; }; template <typename R, typename A1, typename A2> struct executor_binder_argument_type<R(*)(A1, A2)> { typedef A1 first_argument_type; typedef A2 second_argument_type; }; template <typename R, typename A1, typename A2> struct executor_binder_argument_type<R(&)(A1, A2)> { typedef A1 first_argument_type; typedef A2 second_argument_type; }; // Helper to perform uses_executor construction of the target type, if // required. template <typename T, typename Executor, bool UsesExecutor> class executor_binder_base; template <typename T, typename Executor> class executor_binder_base<T, Executor, true> { protected: template <typename E, typename U> executor_binder_base(BOOST_ASIO_MOVE_ARG(E) e, BOOST_ASIO_MOVE_ARG(U) u) : executor_(BOOST_ASIO_MOVE_CAST(E)(e)), target_(executor_arg_t(), executor_, BOOST_ASIO_MOVE_CAST(U)(u)) { } Executor executor_; T target_; }; template <typename T, typename Executor> class executor_binder_base<T, Executor, false> { protected: template <typename E, typename U> executor_binder_base(BOOST_ASIO_MOVE_ARG(E) e, BOOST_ASIO_MOVE_ARG(U) u) : executor_(BOOST_ASIO_MOVE_CAST(E)(e)), target_(BOOST_ASIO_MOVE_CAST(U)(u)) { } Executor executor_; T target_; }; // Helper to enable SFINAE on zero-argument operator() below. template <typename T, typename = void> struct executor_binder_result_of0 { typedef void type; }; template <typename T> struct executor_binder_result_of0<T, typename void_type<typename result_of<T()>::type>::type> { typedef typename result_of<T()>::type type; }; } // namespace detail /// A call wrapper type to bind an executor of type @c Executor to an object of /// type @c T. template <typename T, typename Executor> class executor_binder #if !defined(GENERATING_DOCUMENTATION) : public detail::executor_binder_result_type<T>, public detail::executor_binder_argument_type<T>, public detail::executor_binder_argument_types<T>, private detail::executor_binder_base< T, Executor, uses_executor<T, Executor>::value> #endif // !defined(GENERATING_DOCUMENTATION) { public: /// The type of the target object. typedef T target_type; /// The type of the associated executor. typedef Executor executor_type; #if defined(GENERATING_DOCUMENTATION) /// The return type if a function. /** * The type of @c result_type is based on the type @c T of the wrapper's * target object: * * @li if @c T is a pointer to function type, @c result_type is a synonym for * the return type of @c T; * * @li if @c T is a class type with a member type @c result_type, then @c * result_type is a synonym for @c T::result_type; * * @li otherwise @c result_type is not defined. */ typedef see_below result_type; /// The type of the function's argument. /** * The type of @c argument_type is based on the type @c T of the wrapper's * target object: * * @li if @c T is a pointer to a function type accepting a single argument, * @c argument_type is a synonym for the return type of @c T; * * @li if @c T is a class type with a member type @c argument_type, then @c * argument_type is a synonym for @c T::argument_type; * * @li otherwise @c argument_type is not defined. */ typedef see_below argument_type; /// The type of the function's first argument. /** * The type of @c first_argument_type is based on the type @c T of the * wrapper's target object: * * @li if @c T is a pointer to a function type accepting two arguments, @c * first_argument_type is a synonym for the return type of @c T; * * @li if @c T is a class type with a member type @c first_argument_type, * then @c first_argument_type is a synonym for @c T::first_argument_type; * * @li otherwise @c first_argument_type is not defined. */ typedef see_below first_argument_type; /// The type of the function's second argument. /** * The type of @c second_argument_type is based on the type @c T of the * wrapper's target object: * * @li if @c T is a pointer to a function type accepting two arguments, @c * second_argument_type is a synonym for the return type of @c T; * * @li if @c T is a class type with a member type @c first_argument_type, * then @c second_argument_type is a synonym for @c T::second_argument_type; * * @li otherwise @c second_argument_type is not defined. */ typedef see_below second_argument_type; #endif // defined(GENERATING_DOCUMENTATION) /// Construct an executor wrapper for the specified object. /** * This constructor is only valid if the type @c T is constructible from type * @c U. */ template <typename U> executor_binder(executor_arg_t, const executor_type& e, BOOST_ASIO_MOVE_ARG(U) u) : base_type(e, BOOST_ASIO_MOVE_CAST(U)(u)) { } /// Copy constructor. executor_binder(const executor_binder& other) : base_type(other.get_executor(), other.get()) { } /// Construct a copy, but specify a different executor. executor_binder(executor_arg_t, const executor_type& e, const executor_binder& other) : base_type(e, other.get()) { } /// Construct a copy of a different executor wrapper type. /** * This constructor is only valid if the @c Executor type is constructible * from type @c OtherExecutor, and the type @c T is constructible from type * @c U. */ template <typename U, typename OtherExecutor> executor_binder(const executor_binder<U, OtherExecutor>& other) : base_type(other.get_executor(), other.get()) { } /// Construct a copy of a different executor wrapper type, but specify a /// different executor. /** * This constructor is only valid if the type @c T is constructible from type * @c U. */ template <typename U, typename OtherExecutor> executor_binder(executor_arg_t, const executor_type& e, const executor_binder<U, OtherExecutor>& other) : base_type(e, other.get()) { } #if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move constructor. executor_binder(executor_binder&& other) : base_type(BOOST_ASIO_MOVE_CAST(executor_type)(other.get_executor()), BOOST_ASIO_MOVE_CAST(T)(other.get())) { } /// Move construct the target object, but specify a different executor. executor_binder(executor_arg_t, const executor_type& e, executor_binder&& other) : base_type(e, BOOST_ASIO_MOVE_CAST(T)(other.get())) { } /// Move construct from a different executor wrapper type. template <typename U, typename OtherExecutor> executor_binder(executor_binder<U, OtherExecutor>&& other) : base_type(BOOST_ASIO_MOVE_CAST(OtherExecutor)(other.get_executor()), BOOST_ASIO_MOVE_CAST(U)(other.get())) { } /// Move construct from a different executor wrapper type, but specify a /// different executor. template <typename U, typename OtherExecutor> executor_binder(executor_arg_t, const executor_type& e, executor_binder<U, OtherExecutor>&& other) : base_type(e, BOOST_ASIO_MOVE_CAST(U)(other.get())) { } #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Destructor. ~executor_binder() { } /// Obtain a reference to the target object. target_type& get() BOOST_ASIO_NOEXCEPT { return this->target_; } /// Obtain a reference to the target object. const target_type& get() const BOOST_ASIO_NOEXCEPT { return this->target_; } /// Obtain the associated executor. executor_type get_executor() const BOOST_ASIO_NOEXCEPT { return this->executor_; } #if defined(GENERATING_DOCUMENTATION) template <typename... Args> auto operator()(Args&& ...); template <typename... Args> auto operator()(Args&& ...) const; #elif defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) /// Forwarding function call operator. template <typename... Args> typename result_of<T(Args...)>::type operator()( BOOST_ASIO_MOVE_ARG(Args)... args) { return this->target_(BOOST_ASIO_MOVE_CAST(Args)(args)...); } /// Forwarding function call operator. template <typename... Args> typename result_of<T(Args...)>::type operator()( BOOST_ASIO_MOVE_ARG(Args)... args) const { return this->target_(BOOST_ASIO_MOVE_CAST(Args)(args)...); } #elif defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER) typename detail::executor_binder_result_of0<T>::type operator()() { return this->target_(); } typename detail::executor_binder_result_of0<T>::type operator()() const { return this->target_(); } #define BOOST_ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF(n) \ template <BOOST_ASIO_VARIADIC_TPARAMS(n)> \ typename result_of<T(BOOST_ASIO_VARIADIC_TARGS(n))>::type operator()( \ BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \ { \ return this->target_(BOOST_ASIO_VARIADIC_MOVE_ARGS(n)); \ } \ \ template <BOOST_ASIO_VARIADIC_TPARAMS(n)> \ typename result_of<T(BOOST_ASIO_VARIADIC_TARGS(n))>::type operator()( \ BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) const \ { \ return this->target_(BOOST_ASIO_VARIADIC_MOVE_ARGS(n)); \ } \ /**/ BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF) #undef BOOST_ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF #else // defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER) typedef typename detail::executor_binder_result_type<T>::result_type_or_void result_type_or_void; result_type_or_void operator()() { return this->target_(); } result_type_or_void operator()() const { return this->target_(); } #define BOOST_ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF(n) \ template <BOOST_ASIO_VARIADIC_TPARAMS(n)> \ result_type_or_void operator()( \ BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \ { \ return this->target_(BOOST_ASIO_VARIADIC_MOVE_ARGS(n)); \ } \ \ template <BOOST_ASIO_VARIADIC_TPARAMS(n)> \ result_type_or_void operator()( \ BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) const \ { \ return this->target_(BOOST_ASIO_VARIADIC_MOVE_ARGS(n)); \ } \ /**/ BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF) #undef BOOST_ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF #endif // defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER) private: typedef detail::executor_binder_base<T, Executor, uses_executor<T, Executor>::value> base_type; }; /// Associate an object of type @c T with an executor of type @c Executor. template <typename Executor, typename T> inline executor_binder<typename decay<T>::type, Executor> bind_executor(const Executor& ex, BOOST_ASIO_MOVE_ARG(T) t, typename enable_if< is_executor<Executor>::value || execution::is_executor<Executor>::value >::type* = 0) { return executor_binder<typename decay<T>::type, Executor>( executor_arg_t(), ex, BOOST_ASIO_MOVE_CAST(T)(t)); } /// Associate an object of type @c T with an execution context's executor. template <typename ExecutionContext, typename T> inline executor_binder<typename decay<T>::type, typename ExecutionContext::executor_type> bind_executor(ExecutionContext& ctx, BOOST_ASIO_MOVE_ARG(T) t, typename enable_if<is_convertible< ExecutionContext&, execution_context&>::value>::type* = 0) { return executor_binder<typename decay<T>::type, typename ExecutionContext::executor_type>( executor_arg_t(), ctx.get_executor(), BOOST_ASIO_MOVE_CAST(T)(t)); } #if !defined(GENERATING_DOCUMENTATION) template <typename T, typename Executor> struct uses_executor<executor_binder<T, Executor>, Executor> : true_type {}; template <typename T, typename Executor, typename Signature> class async_result<executor_binder<T, Executor>, Signature> { public: typedef executor_binder< typename async_result<T, Signature>::completion_handler_type, Executor> completion_handler_type; typedef typename async_result<T, Signature>::return_type return_type; explicit async_result(executor_binder<T, Executor>& b) : target_(b.get()) { } return_type get() { return target_.get(); } private: async_result(const async_result&) BOOST_ASIO_DELETED; async_result& operator=(const async_result&) BOOST_ASIO_DELETED; async_result<T, Signature> target_; }; template <typename T, typename Executor, typename Allocator> struct associated_allocator<executor_binder<T, Executor>, Allocator> { typedef typename associated_allocator<T, Allocator>::type type; static type get(const executor_binder<T, Executor>& b, const Allocator& a = Allocator()) BOOST_ASIO_NOEXCEPT { return associated_allocator<T, Allocator>::get(b.get(), a); } }; template <typename T, typename Executor, typename Executor1> struct associated_executor<executor_binder<T, Executor>, Executor1> { typedef Executor type; static type get(const executor_binder<T, Executor>& b, const Executor1& = Executor1()) BOOST_ASIO_NOEXCEPT { return b.get_executor(); } }; #endif // !defined(GENERATING_DOCUMENTATION) } // namespace asio } // namespace boost #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_BIND_EXECUTOR_HPP
Save
cmd:
run