File indexing completed on 2025-01-30 09:33:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_ASIO_THIS_CORO_HPP
0012 #define BOOST_ASIO_THIS_CORO_HPP
0013
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif
0017
0018 #include <boost/asio/detail/config.hpp>
0019 #include <boost/asio/detail/type_traits.hpp>
0020
0021 #include <boost/asio/detail/push_options.hpp>
0022
0023 namespace boost {
0024 namespace asio {
0025 namespace this_coro {
0026
0027
0028 struct executor_t
0029 {
0030 constexpr executor_t()
0031 {
0032 }
0033 };
0034
0035
0036 constexpr executor_t executor;
0037
0038
0039 struct cancellation_state_t
0040 {
0041 constexpr cancellation_state_t()
0042 {
0043 }
0044 };
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061 constexpr cancellation_state_t cancellation_state;
0062
0063 #if defined(GENERATING_DOCUMENTATION)
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084 BOOST_ASIO_NODISCARD constexpr unspecified
0085 reset_cancellation_state();
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108 template <typename Filter>
0109 BOOST_ASIO_NODISCARD constexpr unspecified
0110 reset_cancellation_state(Filter&& filter);
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135 template <typename InFilter, typename OutFilter>
0136 BOOST_ASIO_NODISCARD constexpr unspecified
0137 reset_cancellation_state(
0138 InFilter&& in_filter,
0139 OutFilter&& out_filter);
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153 BOOST_ASIO_NODISCARD constexpr unspecified
0154 throw_if_cancelled();
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167 BOOST_ASIO_NODISCARD constexpr unspecified
0168 throw_if_cancelled(bool value);
0169
0170 #else
0171
0172 struct reset_cancellation_state_0_t
0173 {
0174 constexpr reset_cancellation_state_0_t()
0175 {
0176 }
0177 };
0178
0179 BOOST_ASIO_NODISCARD inline constexpr reset_cancellation_state_0_t
0180 reset_cancellation_state()
0181 {
0182 return reset_cancellation_state_0_t();
0183 }
0184
0185 template <typename Filter>
0186 struct reset_cancellation_state_1_t
0187 {
0188 template <typename F>
0189 explicit constexpr reset_cancellation_state_1_t(
0190 F&& filt)
0191 : filter(static_cast<F&&>(filt))
0192 {
0193 }
0194
0195 Filter filter;
0196 };
0197
0198 template <typename Filter>
0199 BOOST_ASIO_NODISCARD inline constexpr reset_cancellation_state_1_t<
0200 decay_t<Filter>>
0201 reset_cancellation_state(Filter&& filter)
0202 {
0203 return reset_cancellation_state_1_t<decay_t<Filter>>(
0204 static_cast<Filter&&>(filter));
0205 }
0206
0207 template <typename InFilter, typename OutFilter>
0208 struct reset_cancellation_state_2_t
0209 {
0210 template <typename F1, typename F2>
0211 constexpr reset_cancellation_state_2_t(
0212 F1&& in_filt, F2&& out_filt)
0213 : in_filter(static_cast<F1&&>(in_filt)),
0214 out_filter(static_cast<F2&&>(out_filt))
0215 {
0216 }
0217
0218 InFilter in_filter;
0219 OutFilter out_filter;
0220 };
0221
0222 template <typename InFilter, typename OutFilter>
0223 BOOST_ASIO_NODISCARD inline constexpr
0224 reset_cancellation_state_2_t<decay_t<InFilter>, decay_t<OutFilter>>
0225 reset_cancellation_state(InFilter&& in_filter, OutFilter&& out_filter)
0226 {
0227 return reset_cancellation_state_2_t<decay_t<InFilter>, decay_t<OutFilter>>(
0228 static_cast<InFilter&&>(in_filter),
0229 static_cast<OutFilter&&>(out_filter));
0230 }
0231
0232 struct throw_if_cancelled_0_t
0233 {
0234 constexpr throw_if_cancelled_0_t()
0235 {
0236 }
0237 };
0238
0239 BOOST_ASIO_NODISCARD inline constexpr throw_if_cancelled_0_t
0240 throw_if_cancelled()
0241 {
0242 return throw_if_cancelled_0_t();
0243 }
0244
0245 struct throw_if_cancelled_1_t
0246 {
0247 explicit constexpr throw_if_cancelled_1_t(bool val)
0248 : value(val)
0249 {
0250 }
0251
0252 bool value;
0253 };
0254
0255 BOOST_ASIO_NODISCARD inline constexpr throw_if_cancelled_1_t
0256 throw_if_cancelled(bool value)
0257 {
0258 return throw_if_cancelled_1_t(value);
0259 }
0260
0261 #endif
0262
0263 }
0264 }
0265 }
0266
0267 #include <boost/asio/detail/pop_options.hpp>
0268
0269 #endif