Skip to content

Commit 955bc8b

Browse files
committedSep 22, 2021
deps: add asio to deps
1 parent ed55257 commit 955bc8b

File tree

561 files changed

+143849
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

561 files changed

+143849
-0
lines changed
 

‎include/asio.hpp

+182
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
//
2+
// asio.hpp
3+
// ~~~~~~~~
4+
//
5+
// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6+
//
7+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
8+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9+
//
10+
11+
#ifndef ASIO_HPP
12+
#define ASIO_HPP
13+
14+
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15+
# pragma once
16+
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17+
18+
#include "asio/associated_allocator.hpp"
19+
#include "asio/associated_executor.hpp"
20+
#include "asio/async_result.hpp"
21+
#include "asio/awaitable.hpp"
22+
#include "asio/basic_datagram_socket.hpp"
23+
#include "asio/basic_deadline_timer.hpp"
24+
#include "asio/basic_io_object.hpp"
25+
#include "asio/basic_raw_socket.hpp"
26+
#include "asio/basic_seq_packet_socket.hpp"
27+
#include "asio/basic_serial_port.hpp"
28+
#include "asio/basic_signal_set.hpp"
29+
#include "asio/basic_socket.hpp"
30+
#include "asio/basic_socket_acceptor.hpp"
31+
#include "asio/basic_socket_iostream.hpp"
32+
#include "asio/basic_socket_streambuf.hpp"
33+
#include "asio/basic_stream_socket.hpp"
34+
#include "asio/basic_streambuf.hpp"
35+
#include "asio/basic_waitable_timer.hpp"
36+
#include "asio/bind_executor.hpp"
37+
#include "asio/buffer.hpp"
38+
#include "asio/buffered_read_stream_fwd.hpp"
39+
#include "asio/buffered_read_stream.hpp"
40+
#include "asio/buffered_stream_fwd.hpp"
41+
#include "asio/buffered_stream.hpp"
42+
#include "asio/buffered_write_stream_fwd.hpp"
43+
#include "asio/buffered_write_stream.hpp"
44+
#include "asio/buffers_iterator.hpp"
45+
#include "asio/co_spawn.hpp"
46+
#include "asio/completion_condition.hpp"
47+
#include "asio/compose.hpp"
48+
#include "asio/connect.hpp"
49+
#include "asio/coroutine.hpp"
50+
#include "asio/deadline_timer.hpp"
51+
#include "asio/defer.hpp"
52+
#include "asio/detached.hpp"
53+
#include "asio/dispatch.hpp"
54+
#include "asio/error.hpp"
55+
#include "asio/error_code.hpp"
56+
#include "asio/execution.hpp"
57+
#include "asio/execution/allocator.hpp"
58+
#include "asio/execution/any_executor.hpp"
59+
#include "asio/execution/blocking.hpp"
60+
#include "asio/execution/blocking_adaptation.hpp"
61+
#include "asio/execution/bulk_execute.hpp"
62+
#include "asio/execution/bulk_guarantee.hpp"
63+
#include "asio/execution/connect.hpp"
64+
#include "asio/execution/context.hpp"
65+
#include "asio/execution/context_as.hpp"
66+
#include "asio/execution/execute.hpp"
67+
#include "asio/execution/executor.hpp"
68+
#include "asio/execution/invocable_archetype.hpp"
69+
#include "asio/execution/mapping.hpp"
70+
#include "asio/execution/occupancy.hpp"
71+
#include "asio/execution/operation_state.hpp"
72+
#include "asio/execution/outstanding_work.hpp"
73+
#include "asio/execution/prefer_only.hpp"
74+
#include "asio/execution/receiver.hpp"
75+
#include "asio/execution/receiver_invocation_error.hpp"
76+
#include "asio/execution/relationship.hpp"
77+
#include "asio/execution/schedule.hpp"
78+
#include "asio/execution/scheduler.hpp"
79+
#include "asio/execution/sender.hpp"
80+
#include "asio/execution/set_done.hpp"
81+
#include "asio/execution/set_error.hpp"
82+
#include "asio/execution/set_value.hpp"
83+
#include "asio/execution/start.hpp"
84+
#include "asio/execution_context.hpp"
85+
#include "asio/executor.hpp"
86+
#include "asio/executor_work_guard.hpp"
87+
#include "asio/generic/basic_endpoint.hpp"
88+
#include "asio/generic/datagram_protocol.hpp"
89+
#include "asio/generic/raw_protocol.hpp"
90+
#include "asio/generic/seq_packet_protocol.hpp"
91+
#include "asio/generic/stream_protocol.hpp"
92+
#include "asio/handler_alloc_hook.hpp"
93+
#include "asio/handler_continuation_hook.hpp"
94+
#include "asio/handler_invoke_hook.hpp"
95+
#include "asio/high_resolution_timer.hpp"
96+
#include "asio/io_context.hpp"
97+
#include "asio/io_context_strand.hpp"
98+
#include "asio/io_service.hpp"
99+
#include "asio/io_service_strand.hpp"
100+
#include "asio/ip/address.hpp"
101+
#include "asio/ip/address_v4.hpp"
102+
#include "asio/ip/address_v4_iterator.hpp"
103+
#include "asio/ip/address_v4_range.hpp"
104+
#include "asio/ip/address_v6.hpp"
105+
#include "asio/ip/address_v6_iterator.hpp"
106+
#include "asio/ip/address_v6_range.hpp"
107+
#include "asio/ip/network_v4.hpp"
108+
#include "asio/ip/network_v6.hpp"
109+
#include "asio/ip/bad_address_cast.hpp"
110+
#include "asio/ip/basic_endpoint.hpp"
111+
#include "asio/ip/basic_resolver.hpp"
112+
#include "asio/ip/basic_resolver_entry.hpp"
113+
#include "asio/ip/basic_resolver_iterator.hpp"
114+
#include "asio/ip/basic_resolver_query.hpp"
115+
#include "asio/ip/host_name.hpp"
116+
#include "asio/ip/icmp.hpp"
117+
#include "asio/ip/multicast.hpp"
118+
#include "asio/ip/resolver_base.hpp"
119+
#include "asio/ip/resolver_query_base.hpp"
120+
#include "asio/ip/tcp.hpp"
121+
#include "asio/ip/udp.hpp"
122+
#include "asio/ip/unicast.hpp"
123+
#include "asio/ip/v6_only.hpp"
124+
#include "asio/is_applicable_property.hpp"
125+
#include "asio/is_executor.hpp"
126+
#include "asio/is_read_buffered.hpp"
127+
#include "asio/is_write_buffered.hpp"
128+
#include "asio/local/basic_endpoint.hpp"
129+
#include "asio/local/connect_pair.hpp"
130+
#include "asio/local/datagram_protocol.hpp"
131+
#include "asio/local/stream_protocol.hpp"
132+
#include "asio/multiple_exceptions.hpp"
133+
#include "asio/packaged_task.hpp"
134+
#include "asio/placeholders.hpp"
135+
#include "asio/posix/basic_descriptor.hpp"
136+
#include "asio/posix/basic_stream_descriptor.hpp"
137+
#include "asio/posix/descriptor.hpp"
138+
#include "asio/posix/descriptor_base.hpp"
139+
#include "asio/posix/stream_descriptor.hpp"
140+
#include "asio/post.hpp"
141+
#include "asio/prefer.hpp"
142+
#include "asio/query.hpp"
143+
#include "asio/read.hpp"
144+
#include "asio/read_at.hpp"
145+
#include "asio/read_until.hpp"
146+
#include "asio/redirect_error.hpp"
147+
#include "asio/require.hpp"
148+
#include "asio/require_concept.hpp"
149+
#include "asio/serial_port.hpp"
150+
#include "asio/serial_port_base.hpp"
151+
#include "asio/signal_set.hpp"
152+
#include "asio/socket_base.hpp"
153+
#include "asio/static_thread_pool.hpp"
154+
#include "asio/steady_timer.hpp"
155+
#include "asio/strand.hpp"
156+
#include "asio/streambuf.hpp"
157+
#include "asio/system_context.hpp"
158+
#include "asio/system_error.hpp"
159+
#include "asio/system_executor.hpp"
160+
#include "asio/system_timer.hpp"
161+
#include "asio/this_coro.hpp"
162+
#include "asio/thread.hpp"
163+
#include "asio/thread_pool.hpp"
164+
#include "asio/time_traits.hpp"
165+
#include "asio/use_awaitable.hpp"
166+
#include "asio/use_future.hpp"
167+
#include "asio/uses_executor.hpp"
168+
#include "asio/version.hpp"
169+
#include "asio/wait_traits.hpp"
170+
#include "asio/windows/basic_object_handle.hpp"
171+
#include "asio/windows/basic_overlapped_handle.hpp"
172+
#include "asio/windows/basic_random_access_handle.hpp"
173+
#include "asio/windows/basic_stream_handle.hpp"
174+
#include "asio/windows/object_handle.hpp"
175+
#include "asio/windows/overlapped_handle.hpp"
176+
#include "asio/windows/overlapped_ptr.hpp"
177+
#include "asio/windows/random_access_handle.hpp"
178+
#include "asio/windows/stream_handle.hpp"
179+
#include "asio/write.hpp"
180+
#include "asio/write_at.hpp"
181+
182+
#endif // ASIO_HPP

‎include/asio/any_io_executor.hpp

+300
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,300 @@
1+
//
2+
// any_io_executor.hpp
3+
// ~~~~~~~~~~~~~~~~~~~
4+
//
5+
// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6+
//
7+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
8+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9+
//
10+
11+
#ifndef ASIO_ANY_IO_EXECUTOR_HPP
12+
#define ASIO_ANY_IO_EXECUTOR_HPP
13+
14+
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15+
# pragma once
16+
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17+
18+
#include "asio/detail/config.hpp"
19+
#if defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
20+
# include "asio/executor.hpp"
21+
#else // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
22+
# include "asio/execution.hpp"
23+
# include "asio/execution_context.hpp"
24+
#endif // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
25+
26+
#include "asio/detail/push_options.hpp"
27+
28+
namespace asio {
29+
30+
#if defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
31+
32+
typedef executor any_io_executor;
33+
34+
#else // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
35+
36+
/// Polymorphic executor type for use with I/O objects.
37+
/**
38+
* The @c any_io_executor type is a polymorphic executor that supports the set
39+
* of properties required by I/O objects. It is defined as the
40+
* execution::any_executor class template parameterised as follows:
41+
* @code execution::any_executor<
42+
* execution::context_as_t<execution_context&>,
43+
* execution::blocking_t::never_t,
44+
* execution::prefer_only<execution::blocking_t::possibly_t>,
45+
* execution::prefer_only<execution::outstanding_work_t::tracked_t>,
46+
* execution::prefer_only<execution::outstanding_work_t::untracked_t>,
47+
* execution::prefer_only<execution::relationship_t::fork_t>,
48+
* execution::prefer_only<execution::relationship_t::continuation_t>
49+
* > @endcode
50+
*/
51+
class any_io_executor :
52+
#if defined(GENERATING_DOCUMENTATION)
53+
public execution::any_executor<...>
54+
#else // defined(GENERATING_DOCUMENTATION)
55+
public execution::any_executor<
56+
execution::context_as_t<execution_context&>,
57+
execution::blocking_t::never_t,
58+
execution::prefer_only<execution::blocking_t::possibly_t>,
59+
execution::prefer_only<execution::outstanding_work_t::tracked_t>,
60+
execution::prefer_only<execution::outstanding_work_t::untracked_t>,
61+
execution::prefer_only<execution::relationship_t::fork_t>,
62+
execution::prefer_only<execution::relationship_t::continuation_t>
63+
>
64+
#endif // defined(GENERATING_DOCUMENTATION)
65+
{
66+
public:
67+
#if !defined(GENERATING_DOCUMENTATION)
68+
typedef execution::any_executor<
69+
execution::context_as_t<execution_context&>,
70+
execution::blocking_t::never_t,
71+
execution::prefer_only<execution::blocking_t::possibly_t>,
72+
execution::prefer_only<execution::outstanding_work_t::tracked_t>,
73+
execution::prefer_only<execution::outstanding_work_t::untracked_t>,
74+
execution::prefer_only<execution::relationship_t::fork_t>,
75+
execution::prefer_only<execution::relationship_t::continuation_t>
76+
> base_type;
77+
78+
typedef void supportable_properties_type(
79+
execution::context_as_t<execution_context&>,
80+
execution::blocking_t::never_t,
81+
execution::prefer_only<execution::blocking_t::possibly_t>,
82+
execution::prefer_only<execution::outstanding_work_t::tracked_t>,
83+
execution::prefer_only<execution::outstanding_work_t::untracked_t>,
84+
execution::prefer_only<execution::relationship_t::fork_t>,
85+
execution::prefer_only<execution::relationship_t::continuation_t>
86+
);
87+
#endif // !defined(GENERATING_DOCUMENTATION)
88+
89+
/// Default constructor.
90+
any_io_executor() ASIO_NOEXCEPT
91+
: base_type()
92+
{
93+
}
94+
95+
/// Construct in an empty state. Equivalent effects to default constructor.
96+
any_io_executor(nullptr_t) ASIO_NOEXCEPT
97+
: base_type(nullptr_t())
98+
{
99+
}
100+
101+
/// Copy constructor.
102+
any_io_executor(const any_io_executor& e) ASIO_NOEXCEPT
103+
: base_type(static_cast<const base_type&>(e))
104+
{
105+
}
106+
107+
#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
108+
/// Move constructor.
109+
any_io_executor(any_io_executor&& e) ASIO_NOEXCEPT
110+
: base_type(static_cast<base_type&&>(e))
111+
{
112+
}
113+
#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
114+
115+
/// Construct to point to the same target as another any_executor.
116+
#if defined(GENERATING_DOCUMENTATION)
117+
template <class... OtherSupportableProperties>
118+
any_io_executor(execution::any_executor<OtherSupportableProperties...> e);
119+
#else // defined(GENERATING_DOCUMENTATION)
120+
template <typename OtherAnyExecutor>
121+
any_io_executor(OtherAnyExecutor e,
122+
typename constraint<
123+
conditional<
124+
!is_same<OtherAnyExecutor, any_io_executor>::value
125+
&& is_base_of<execution::detail::any_executor_base,
126+
OtherAnyExecutor>::value,
127+
typename execution::detail::supportable_properties<
128+
0, supportable_properties_type>::template
129+
is_valid_target<OtherAnyExecutor>,
130+
false_type
131+
>::type::value
132+
>::type = 0)
133+
: base_type(ASIO_MOVE_CAST(OtherAnyExecutor)(e))
134+
{
135+
}
136+
#endif // defined(GENERATING_DOCUMENTATION)
137+
138+
/// Construct a polymorphic wrapper for the specified executor.
139+
#if defined(GENERATING_DOCUMENTATION)
140+
template <ASIO_EXECUTION_EXECUTOR Executor>
141+
any_io_executor(Executor e);
142+
#else // defined(GENERATING_DOCUMENTATION)
143+
template <ASIO_EXECUTION_EXECUTOR Executor>
144+
any_io_executor(Executor e,
145+
typename constraint<
146+
conditional<
147+
!is_same<Executor, any_io_executor>::value
148+
&& !is_base_of<execution::detail::any_executor_base,
149+
Executor>::value,
150+
execution::detail::is_valid_target_executor<
151+
Executor, supportable_properties_type>,
152+
false_type
153+
>::type::value
154+
>::type = 0)
155+
: base_type(ASIO_MOVE_CAST(Executor)(e))
156+
{
157+
}
158+
#endif // defined(GENERATING_DOCUMENTATION)
159+
160+
/// Assignment operator.
161+
any_io_executor& operator=(const any_io_executor& e) ASIO_NOEXCEPT
162+
{
163+
base_type::operator=(static_cast<const base_type&>(e));
164+
return *this;
165+
}
166+
167+
#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
168+
/// Move assignment operator.
169+
any_io_executor& operator=(any_io_executor&& e) ASIO_NOEXCEPT
170+
{
171+
base_type::operator=(static_cast<base_type&&>(e));
172+
return *this;
173+
}
174+
#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
175+
176+
/// Assignment operator that sets the polymorphic wrapper to the empty state.
177+
any_io_executor& operator=(nullptr_t)
178+
{
179+
base_type::operator=(nullptr_t());
180+
return *this;
181+
}
182+
183+
/// Destructor.
184+
~any_io_executor()
185+
{
186+
}
187+
188+
/// Swap targets with another polymorphic wrapper.
189+
void swap(any_io_executor& other) ASIO_NOEXCEPT
190+
{
191+
static_cast<base_type&>(*this).swap(static_cast<base_type&>(other));
192+
}
193+
194+
/// Obtain a polymorphic wrapper with the specified property.
195+
/**
196+
* Do not call this function directly. It is intended for use with the
197+
* asio::require and asio::prefer customisation points.
198+
*
199+
* For example:
200+
* @code any_io_executor ex = ...;
201+
* auto ex2 = asio::require(ex, execution::blocking.possibly); @endcode
202+
*/
203+
template <typename Property>
204+
any_io_executor require(const Property& p,
205+
typename constraint<
206+
traits::require_member<const base_type&, const Property&>::is_valid
207+
>::type = 0) const
208+
{
209+
return static_cast<const base_type&>(*this).require(p);
210+
}
211+
212+
/// Obtain a polymorphic wrapper with the specified property.
213+
/**
214+
* Do not call this function directly. It is intended for use with the
215+
* asio::prefer customisation point.
216+
*
217+
* For example:
218+
* @code any_io_executor ex = ...;
219+
* auto ex2 = asio::prefer(ex, execution::blocking.possibly); @endcode
220+
*/
221+
template <typename Property>
222+
any_io_executor prefer(const Property& p,
223+
typename constraint<
224+
traits::prefer_member<const base_type&, const Property&>::is_valid
225+
>::type = 0) const
226+
{
227+
return static_cast<const base_type&>(*this).prefer(p);
228+
}
229+
};
230+
231+
#if !defined(GENERATING_DOCUMENTATION)
232+
233+
namespace traits {
234+
235+
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
236+
237+
template <>
238+
struct equality_comparable<any_io_executor>
239+
{
240+
static const bool is_valid = true;
241+
static const bool is_noexcept = true;
242+
};
243+
244+
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
245+
246+
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
247+
248+
template <typename F>
249+
struct execute_member<any_io_executor, F>
250+
{
251+
static const bool is_valid = true;
252+
static const bool is_noexcept = false;
253+
typedef void result_type;
254+
};
255+
256+
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
257+
258+
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
259+
260+
template <typename Prop>
261+
struct query_member<any_io_executor, Prop> :
262+
query_member<any_io_executor::base_type, Prop>
263+
{
264+
};
265+
266+
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
267+
268+
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
269+
270+
template <typename Prop>
271+
struct require_member<any_io_executor, Prop> :
272+
require_member<any_io_executor::base_type, Prop>
273+
{
274+
typedef any_io_executor result_type;
275+
};
276+
277+
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
278+
279+
#if !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
280+
281+
template <typename Prop>
282+
struct prefer_member<any_io_executor, Prop> :
283+
prefer_member<any_io_executor::base_type, Prop>
284+
{
285+
typedef any_io_executor result_type;
286+
};
287+
288+
#endif // !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
289+
290+
} // namespace traits
291+
292+
#endif // !defined(GENERATING_DOCUMENTATION)
293+
294+
#endif // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
295+
296+
} // namespace asio
297+
298+
#include "asio/detail/pop_options.hpp"
299+
300+
#endif // ASIO_ANY_IO_EXECUTOR_HPP

0 commit comments

Comments
 (0)
Please sign in to comment.