mirror of
https://github.com/boostorg/beast.git
synced 2025-07-29 20:37:31 +02:00
Support Concepts for completion token params
This commit is contained in:
@ -3,6 +3,7 @@ Version 275:
|
||||
* Async init-fns use the executor's default token
|
||||
* Add basic_stream::rebind_executor
|
||||
* Use automatically deduced return types for all async operations
|
||||
* Support Concepts for completion token params
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -49,9 +49,13 @@ PREDEFINED = \
|
||||
BOOST_BEAST_SPLIT_COMPILATION=1 \
|
||||
"BOOST_BEAST_ASYNC_RESULT1(t)=__deduced__" \
|
||||
"BOOST_BEAST_ASYNC_RESULT2(t)=__deduced__" \
|
||||
"BOOST_BEAST_ASYNC_TPARAM1=class" \
|
||||
"BOOST_BEAST_ASYNC_TPARAM2=class" \
|
||||
"BOOST_ASIO_INITFN_RESULT_TYPE(t,a)=__deduced__" \
|
||||
"BOOST_ASIO_COMPLETION_TOKEN_FOR(sig)=class" \
|
||||
GENERATING_DOCUMENTATION \
|
||||
BOOST_BEAST_DECL
|
||||
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
|
||||
|
@ -224,7 +224,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class MutableBufferSequence,
|
||||
class ReadHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
@ -306,7 +306,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class ConstBufferSequence,
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
|
@ -477,7 +477,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class MutableBufferSequence,
|
||||
class ReadHandler>
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
async_read_some(
|
||||
MutableBufferSequence const& buffers,
|
||||
@ -555,7 +555,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class ConstBufferSequence,
|
||||
class WriteHandler>
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
async_write_some(
|
||||
ConstBufferSequence const& buffers,
|
||||
|
@ -921,7 +921,7 @@ public:
|
||||
@see async_connect
|
||||
*/
|
||||
template<
|
||||
class ConnectHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM1 ConnectHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT1(ConnectHandler)
|
||||
@ -974,15 +974,19 @@ public:
|
||||
*/
|
||||
template<
|
||||
class EndpointSequence,
|
||||
class RangeConnectHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(
|
||||
void(error_code, typename Protocol::endpoint))
|
||||
RangeConnectHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
#if ! BOOST_BEAST_DOXYGEN
|
||||
,class = typename std::enable_if<
|
||||
net::is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type
|
||||
#endif
|
||||
>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,void (error_code, typename Protocol::endpoint))
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
RangeConnectHandler,
|
||||
void(error_code, typename Protocol::endpoint))
|
||||
async_connect(
|
||||
EndpointSequence const& endpoints,
|
||||
RangeConnectHandler&& handler =
|
||||
@ -1063,15 +1067,19 @@ public:
|
||||
template<
|
||||
class EndpointSequence,
|
||||
class ConnectCondition,
|
||||
class RangeConnectHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(
|
||||
void(error_code, typename Protocol::endpoint))
|
||||
RangeConnectHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
#if ! BOOST_BEAST_DOXYGEN
|
||||
,class = typename std::enable_if<
|
||||
net::is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type
|
||||
#endif
|
||||
>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,void (error_code, typename Protocol::endpoint))
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
RangeConnectHandler,
|
||||
void(error_code, typename Protocol::endpoint))
|
||||
async_connect(
|
||||
EndpointSequence const& endpoints,
|
||||
ConnectCondition connect_condition,
|
||||
@ -1123,8 +1131,10 @@ public:
|
||||
*/
|
||||
template<
|
||||
class Iterator,
|
||||
class IteratorConnectHandler =
|
||||
net::default_completion_token_t<executor_type>>
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(
|
||||
void(error_code, Iterator))
|
||||
IteratorConnectHandler =
|
||||
net::default_completion_token_t<executor_type>>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
IteratorConnectHandler,
|
||||
void(error_code, Iterator))
|
||||
@ -1182,8 +1192,10 @@ public:
|
||||
template<
|
||||
class Iterator,
|
||||
class ConnectCondition,
|
||||
class IteratorConnectHandler =
|
||||
net::default_completion_token_t<executor_type>>
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(
|
||||
void(error_code, Iterator))
|
||||
IteratorConnectHandler =
|
||||
net::default_completion_token_t<executor_type>>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
IteratorConnectHandler,
|
||||
void(error_code, Iterator))
|
||||
@ -1306,7 +1318,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class MutableBufferSequence,
|
||||
class ReadHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
@ -1429,7 +1441,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class ConstBufferSequence,
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler =
|
||||
net::default_completion_token_t<Executor>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
|
@ -263,7 +263,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class MutableBufferSequence,
|
||||
class ReadHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
|
||||
net::default_completion_token_t<executor_type>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
async_read_some(
|
||||
@ -342,7 +342,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class ConstBufferSequence,
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler =
|
||||
net::default_completion_token_t<executor_type>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
async_write_some(
|
||||
|
@ -90,7 +90,15 @@ namespace net = boost::asio;
|
||||
|
||||
#ifndef BOOST_BEAST_ASYNC_RESULT2
|
||||
#define BOOST_BEAST_ASYNC_RESULT2(type) \
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(type, void(::boost::beast::error_code, std::size_t))
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(type, void(::boost::beast::error_code, ::std::size_t))
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_BEAST_ASYNC_TPARAM1
|
||||
#define BOOST_BEAST_ASYNC_TPARAM1 BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::beast::error_code))
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_BEAST_ASYNC_TPARAM2
|
||||
#define BOOST_BEAST_ASYNC_TPARAM2 BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::beast::error_code, ::std::size_t))
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -253,7 +253,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class MutableBufferSequence,
|
||||
class ReadHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
|
||||
net::default_completion_token_t<executor_type>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
async_read_some(
|
||||
@ -334,7 +334,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class ConstBufferSequence,
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler =
|
||||
net::default_completion_token_t<executor_type>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
async_write_some(
|
||||
|
@ -205,7 +205,7 @@ template<
|
||||
class AsyncReadStream,
|
||||
class DynamicBuffer,
|
||||
bool isRequest,
|
||||
class ReadHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type<AsyncReadStream>>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
@ -402,7 +402,7 @@ template<
|
||||
class AsyncReadStream,
|
||||
class DynamicBuffer,
|
||||
bool isRequest,
|
||||
class ReadHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type<AsyncReadStream>>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
@ -599,7 +599,7 @@ template<
|
||||
class AsyncReadStream,
|
||||
class DynamicBuffer,
|
||||
bool isRequest,
|
||||
class ReadHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type<AsyncReadStream>>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
@ -805,7 +805,7 @@ template<
|
||||
class AsyncReadStream,
|
||||
class DynamicBuffer,
|
||||
bool isRequest, class Body, class Allocator,
|
||||
class ReadHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type<AsyncReadStream>>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
|
@ -166,7 +166,7 @@ write_some(
|
||||
template<
|
||||
class AsyncWriteStream,
|
||||
bool isRequest, class Body, class Fields,
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type<AsyncWriteStream>>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
@ -296,7 +296,7 @@ write_header(
|
||||
template<
|
||||
class AsyncWriteStream,
|
||||
bool isRequest, class Body, class Fields,
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type<AsyncWriteStream>>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
@ -417,7 +417,7 @@ write(
|
||||
template<
|
||||
class AsyncWriteStream,
|
||||
bool isRequest, class Body, class Fields,
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type<AsyncWriteStream>>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
@ -642,7 +642,7 @@ write(
|
||||
template<
|
||||
class AsyncWriteStream,
|
||||
bool isRequest, class Body, class Fields,
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type<AsyncWriteStream>>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
@ -704,7 +704,7 @@ async_write(
|
||||
template<
|
||||
class AsyncWriteStream,
|
||||
bool isRequest, class Body, class Fields,
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type<AsyncWriteStream>>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
|
@ -876,7 +876,7 @@ public:
|
||||
@li <a href="https://tools.ietf.org/html/rfc7230#section-5.3.1">origin-form (RFC7230)</a>
|
||||
*/
|
||||
template<
|
||||
class HandshakeHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM1 HandshakeHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler)
|
||||
@ -962,7 +962,7 @@ public:
|
||||
@li <a href="https://tools.ietf.org/html/rfc7230#section-5.3.1">origin-form (RFC7230)</a>
|
||||
*/
|
||||
template<
|
||||
class HandshakeHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM1 HandshakeHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler)
|
||||
@ -1286,7 +1286,7 @@ public:
|
||||
@li <a href="https://tools.ietf.org/html/rfc6455#section-4.2">Websocket Opening Handshake Server Requirements (RFC6455)</a>
|
||||
*/
|
||||
template<
|
||||
class AcceptHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
|
||||
@ -1354,7 +1354,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class ConstBufferSequence,
|
||||
class AcceptHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
|
||||
@ -1419,7 +1419,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class Body, class Allocator,
|
||||
class AcceptHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
|
||||
@ -1554,7 +1554,7 @@ public:
|
||||
@li <a href="https://tools.ietf.org/html/rfc6455#section-7.1.2">Websocket Closing Handshake (RFC6455)</a>
|
||||
*/
|
||||
template<
|
||||
class CloseHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM1 CloseHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT1(CloseHandler)
|
||||
@ -1656,7 +1656,7 @@ public:
|
||||
manner equivalent to using `net::post`.
|
||||
*/
|
||||
template<
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM1 WriteHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT1(WriteHandler)
|
||||
@ -1764,7 +1764,7 @@ public:
|
||||
manner equivalent to using `net::post`.
|
||||
*/
|
||||
template<
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM1 WriteHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT1(WriteHandler)
|
||||
@ -1926,7 +1926,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class DynamicBuffer,
|
||||
class ReadHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
@ -2105,7 +2105,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class DynamicBuffer,
|
||||
class ReadHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
@ -2280,7 +2280,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class MutableBufferSequence,
|
||||
class ReadHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
@ -2403,7 +2403,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class ConstBufferSequence,
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
@ -2526,7 +2526,7 @@ public:
|
||||
*/
|
||||
template<
|
||||
class ConstBufferSequence,
|
||||
class WriteHandler =
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler =
|
||||
net::default_completion_token_t<
|
||||
executor_type>>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
|
Reference in New Issue
Block a user