diff --git a/doc/history.qbk b/doc/history.qbk index 52ec2c6edc..a17f6cf966 100644 --- a/doc/history.qbk +++ b/doc/history.qbk @@ -7,6 +7,92 @@ [section:history Revision History] +[heading Asio 1.27.0 / Boost 1.82 (beta)] + +* Added the ability to customise the execution of a completion handler when an + operation completes immediately. This change adds the + `associated_immediate_executor` associator trait, `bind_immediate_executor` + function, and `immediate_executor_binder` adapter. When a supported operation + completes immediately (that is, within the initiating function) the + associated immmediate executor is obtained, and the completion handler is + delivered through that executor as if by using `asio::dispatch` on that + executor. By default, the immediate executor delivers the completion handler + as if using `asio::post` via the operations I/O executors. For example, to + allow a recursive call to the completion handler of an `async_read_some` + operation, we may specify that immediate completion is delivered via a + `system_executor`:[br] + `` + my_socket.async_read_some(my_buffer, + bind_immediate_executor( + system_executor(), + [](error_code e, size_t n) + { + // ... + } + ) + ); + ``[br] + Immediate execution is currently supported for asynchronous operations on + reactor-based sockets and descriptors, and for asynchronous operations on + channels. +* Added user-defined literals for buffer types. The `_buf` literal suffix, + defined in namespace `asio::buffer_literals`, may be used to create + const_buffer objects from string, binary integer, and hexadecimal integer + literals. These buffer literals may be arbitrarily long. For example:[br] + `` + using namespace asio::buffer_literals; + + asio::const_buffer b1 = "hello"_buf; + asio::const_buffer b2 = 0xdeadbeef_buf; + asio::const_buffer b3 = 0x01234567'89abcdef'01234567'89abcdef_buf; + asio::const_buffer b4 = 0b1010101011001100_buf; + ``[br] + The memory associated with a buffer literal is valid for the lifetime of the + program. This means that the buffer can be safely used with asynchronous + operations:[br] + `` + async_write(my_socket, "hello"_buf, my_handler); + ``[br] +* Added a new protocol type `local::seq_packet_protocol` to represent `AF_UNIX` + with `SOCK_SEQPACKET`. +* Exposed `sigaction()` flags via optional argument to `signal_set::add`. When + registering a signal, it is now possible to pass flags that specify the + behaviour associated with the signal. These flags are specified as an enum + type in a new class, signal_set_base, and are passed to the underlying + `sigaction()` call. For example:[br] + `` + asio::signal_set sigs(my_io_context); + sigs.add(SIGINT, asio::signal_set::flags::restart); + ``[br] + Specifying flags other than `flags::dont_care` will fail unless `sigaction()` + is supported by the target operating system. Since signal registration is + global, conflicting flags (multiple registrations that pass differing flags + other than `flags::dont_care`) will also result in an error. +* Change `allocator_binder`, `executor_binder`, and `cancellation_slot_binder` + to support detection of unspecialised associators. +* Fixed ambiguity in `associated_cancellation_slot::get()`. +* Fixed `awaitable` handling for completion signatures containing + `std::exception_ptr`. +* Fixed `experimental::channel` `try_send` failure after a `cancel`. +* Fixed `thread_pool::join()` deadlock when the pool has no internal threads. +* Fixed pipe `release()` when using [^io_uring]. +* Fixed a data initialisation issue in the [^io_uring] backend. +* Fixed a dangling reference issue in the execution context overload of + `get_associated_executor`. +* Ensured buffered messages can still be received when an + `experimental::channel` is closed. +* Fixed the `any_completion_handler` assignment operator to work correctly. +* Constrained the constructor of the move-only class template + `any_completion_handler` to prevent accidental copying +* Suppressed spurious 'potential null dereference' warnings. +* Changed to use `uint64_t` for OpenSSL options, to match OpenSSL 3. +* Fixed `deferred` interoperability with multiple completion signatures. +* Fixed channels to support C++14, and to partially support C++11. C++11 + support is limited to channels with a single completion signature, or + channels with a void() signature (plus the error signature added by the + channel traits). +* Added `any_completion_handler` to the documentation. + [heading Asio 1.26.0 / Boost 1.81] * Fixed `spawn` and `co_spawn` implementations to dispatch cancellation diff --git a/doc/quickref.xml b/doc/quickref.xml index 6b057ee511..714adffe02 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -263,6 +263,7 @@ Class Templates any_completion_handler + any_completion_handler_allocator append_t as_tuple_t async_completion diff --git a/doc/reference.qbk b/doc/reference.qbk index fd2b746d72..bd9465ce16 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -1828,6 +1828,989 @@ Destructor. +[endsect] + +[section:any_completion_handler any_completion_handler] + +[indexterm1 boost_asio.indexterm.any_completion_handler..any_completion_handler] + + +Polymorphic wrapper for completion handlers. + + + template< + typename... Signatures> + class any_completion_handler + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.any_completion_handler.any_completion_handler [*any_completion_handler]] [constructor]] + [Construct an any_completion_handler in an empty state, without a target object. + [hr] + Construct an any_completion_handler to contain the specified target. + [hr] + Move-construct an any_completion_handler from another. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.get_allocator [*get_allocator]]] + [Get the associated allocator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.get_cancellation_slot [*get_cancellation_slot]]] + [Get the associated cancellation slot. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.operator_bool [*operator bool]]] + [Test if the polymorphic wrapper is empty. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.operator_not_ [*operator!]]] + [Test if the polymorphic wrapper is non-empty. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.operator_lp__rp_ [*operator()]]] + [Function call operator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.operator_eq_ [*operator=]]] + [Move-assign an any_completion_handler from another. + [hr] + Assignment operator that sets the polymorphic wrapper to the empty state. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.swap [*swap]]] + [Swap the content of an any_completion_handler with another. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler._any_completion_handler [*~any_completion_handler]] [destructor]] + [Destructor. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.any_completion_handler.operator_not__eq_ [*operator!=]]] + [Inequality operator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.operator_eq__eq_ [*operator==]]] + [Equality operator. ] + ] + +] + +The `any_completion_handler` class template is a polymorphic wrapper for completion handlers that propagates the associated executor, associated allocator, and associated cancellation slot through a type-erasing interface. + +When using `any_completion_handler`, specify one or more completion signatures as template parameters. These will dictate the arguments that may be passed to the handler through the polymorphic interface. + +Typical uses for `any_completion_handler` include: + + +* Separate compilation of asynchronous operation implementations. + + +* Enabling interoperability between asynchronous operations and virtual functions. + + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + +[section:any_completion_handler any_completion_handler::any_completion_handler] + +[indexterm2 boost_asio.indexterm.any_completion_handler.any_completion_handler..any_completion_handler..any_completion_handler] +Construct an `any_completion_handler` in an empty state, without a target object. + + + constexpr ``[link boost_asio.reference.any_completion_handler.any_completion_handler.overload1 any_completion_handler]``(); + `` [''''»''' [link boost_asio.reference.any_completion_handler.any_completion_handler.overload1 more...]]`` + + constexpr ``[link boost_asio.reference.any_completion_handler.any_completion_handler.overload2 any_completion_handler]``( + nullptr_t ); + `` [''''»''' [link boost_asio.reference.any_completion_handler.any_completion_handler.overload2 more...]]`` + + +Construct an `any_completion_handler` to contain the specified target. + + + template< + typename H, + typename ``[link boost_asio.reference.Handler Handler]`` = typename decay::type> + ``[link boost_asio.reference.any_completion_handler.any_completion_handler.overload3 any_completion_handler]``( + H && h, + typename constraint< !is_same< typename decay< H >::type, any_completion_handler >::value >::type = 0); + `` [''''»''' [link boost_asio.reference.any_completion_handler.any_completion_handler.overload3 more...]]`` + + +Move-construct an `any_completion_handler` from another. + + + ``[link boost_asio.reference.any_completion_handler.any_completion_handler.overload4 any_completion_handler]``( + any_completion_handler && other); + `` [''''»''' [link boost_asio.reference.any_completion_handler.any_completion_handler.overload4 more...]]`` + + +[section:overload1 any_completion_handler::any_completion_handler (1 of 4 overloads)] + + +Construct an `any_completion_handler` in an empty state, without a target object. + + + constexpr any_completion_handler(); + + + +[endsect] + + + +[section:overload2 any_completion_handler::any_completion_handler (2 of 4 overloads)] + + +Construct an `any_completion_handler` in an empty state, without a target object. + + + constexpr any_completion_handler( + nullptr_t ); + + + +[endsect] + + + +[section:overload3 any_completion_handler::any_completion_handler (3 of 4 overloads)] + + +Construct an `any_completion_handler` to contain the specified target. + + + template< + typename H, + typename ``[link boost_asio.reference.Handler Handler]`` = typename decay::type> + any_completion_handler( + H && h, + typename constraint< !is_same< typename decay< H >::type, any_completion_handler >::value >::type = 0); + + + +[endsect] + + + +[section:overload4 any_completion_handler::any_completion_handler (4 of 4 overloads)] + + +Move-construct an `any_completion_handler` from another. + + + any_completion_handler( + any_completion_handler && other); + + +After the operation, the moved-from object `other` has no target. + + +[endsect] + + +[endsect] + + +[section:get_allocator any_completion_handler::get_allocator] + +[indexterm2 boost_asio.indexterm.any_completion_handler.get_allocator..get_allocator..any_completion_handler] +Get the associated allocator. + + + allocator_type get_allocator() const; + + + +[endsect] + + + +[section:get_cancellation_slot any_completion_handler::get_cancellation_slot] + +[indexterm2 boost_asio.indexterm.any_completion_handler.get_cancellation_slot..get_cancellation_slot..any_completion_handler] +Get the associated cancellation slot. + + + cancellation_slot_type get_cancellation_slot() const; + + + +[endsect] + + + +[section:operator_bool any_completion_handler::operator bool] + +[indexterm2 boost_asio.indexterm.any_completion_handler.operator_bool..operator bool..any_completion_handler] +Test if the polymorphic wrapper is empty. + + + constexpr operator bool() const; + + + +[endsect] + + + +[section:operator_not_ any_completion_handler::operator!] + +[indexterm2 boost_asio.indexterm.any_completion_handler.operator_not_..operator!..any_completion_handler] +Test if the polymorphic wrapper is non-empty. + + + constexpr bool operator!() const; + + + +[endsect] + + +[section:operator_not__eq_ any_completion_handler::operator!=] + +[indexterm2 boost_asio.indexterm.any_completion_handler.operator_not__eq_..operator!=..any_completion_handler] +Inequality operator. + + + friend constexpr bool ``[link boost_asio.reference.any_completion_handler.operator_not__eq_.overload1 operator!=]``( + const any_completion_handler & a, + nullptr_t ); + `` [''''»''' [link boost_asio.reference.any_completion_handler.operator_not__eq_.overload1 more...]]`` + + friend constexpr bool ``[link boost_asio.reference.any_completion_handler.operator_not__eq_.overload2 operator!=]``( + nullptr_t , + const any_completion_handler & b); + `` [''''»''' [link boost_asio.reference.any_completion_handler.operator_not__eq_.overload2 more...]]`` + + +[section:overload1 any_completion_handler::operator!= (1 of 2 overloads)] + + +Inequality operator. + + + friend constexpr bool operator!=( + const any_completion_handler & a, + nullptr_t ); + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:overload2 any_completion_handler::operator!= (2 of 2 overloads)] + + +Inequality operator. + + + friend constexpr bool operator!=( + nullptr_t , + const any_completion_handler & b); + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + +[endsect] + + +[section:operator_lp__rp_ any_completion_handler::operator()] + +[indexterm2 boost_asio.indexterm.any_completion_handler.operator_lp__rp_..operator()..any_completion_handler] +Function call operator. + + + template< + typename... Args> + auto operator()( + Args &&... args); + + +Invokes target completion handler with the supplied arguments. + +This function may only be called once, as the target handler is moved from. The polymorphic wrapper is left in an empty state. + +Throws `std::bad_function_call` if the polymorphic wrapper is empty. + + +[endsect] + + +[section:operator_eq_ any_completion_handler::operator=] + +[indexterm2 boost_asio.indexterm.any_completion_handler.operator_eq_..operator=..any_completion_handler] +Move-assign an `any_completion_handler` from another. + + + any_completion_handler & ``[link boost_asio.reference.any_completion_handler.operator_eq_.overload1 operator=]``( + any_completion_handler && other); + `` [''''»''' [link boost_asio.reference.any_completion_handler.operator_eq_.overload1 more...]]`` + + +Assignment operator that sets the polymorphic wrapper to the empty state. + + + any_completion_handler & ``[link boost_asio.reference.any_completion_handler.operator_eq_.overload2 operator=]``( + nullptr_t ); + `` [''''»''' [link boost_asio.reference.any_completion_handler.operator_eq_.overload2 more...]]`` + + +[section:overload1 any_completion_handler::operator= (1 of 2 overloads)] + + +Move-assign an `any_completion_handler` from another. + + + any_completion_handler & operator=( + any_completion_handler && other); + + +After the operation, the moved-from object `other` has no target. + + +[endsect] + + + +[section:overload2 any_completion_handler::operator= (2 of 2 overloads)] + + +Assignment operator that sets the polymorphic wrapper to the empty state. + + + any_completion_handler & operator=( + nullptr_t ); + + + +[endsect] + + +[endsect] + +[section:operator_eq__eq_ any_completion_handler::operator==] + +[indexterm2 boost_asio.indexterm.any_completion_handler.operator_eq__eq_..operator==..any_completion_handler] +Equality operator. + + + friend constexpr bool ``[link boost_asio.reference.any_completion_handler.operator_eq__eq_.overload1 operator==]``( + const any_completion_handler & a, + nullptr_t ); + `` [''''»''' [link boost_asio.reference.any_completion_handler.operator_eq__eq_.overload1 more...]]`` + + friend constexpr bool ``[link boost_asio.reference.any_completion_handler.operator_eq__eq_.overload2 operator==]``( + nullptr_t , + const any_completion_handler & b); + `` [''''»''' [link boost_asio.reference.any_completion_handler.operator_eq__eq_.overload2 more...]]`` + + +[section:overload1 any_completion_handler::operator== (1 of 2 overloads)] + + +Equality operator. + + + friend constexpr bool operator==( + const any_completion_handler & a, + nullptr_t ); + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:overload2 any_completion_handler::operator== (2 of 2 overloads)] + + +Equality operator. + + + friend constexpr bool operator==( + nullptr_t , + const any_completion_handler & b); + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + +[endsect] + + +[section:swap any_completion_handler::swap] + +[indexterm2 boost_asio.indexterm.any_completion_handler.swap..swap..any_completion_handler] +Swap the content of an `any_completion_handler` with another. + + + void swap( + any_completion_handler & other); + + + +[endsect] + + + +[section:_any_completion_handler any_completion_handler::~any_completion_handler] + +[indexterm2 boost_asio.indexterm.any_completion_handler._any_completion_handler..~any_completion_handler..any_completion_handler] +Destructor. + + + ~any_completion_handler(); + + + +[endsect] + + + +[endsect] + +[section:any_completion_handler_allocator any_completion_handler_allocator] + +[indexterm1 boost_asio.indexterm.any_completion_handler_allocator..any_completion_handler_allocator] + + +An allocator type that forwards memory allocation operations through an instance of `any_completion_handler`. + + + template< + typename T, + typename... Signatures> + class any_completion_handler_allocator + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.any_completion_handler_allocator.value_type [*value_type]]] + [The type of objects that may be allocated by the allocator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.allocate [*allocate]]] + [Allocate space for n objects of the allocator's value type. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.any_completion_handler_allocator [*any_completion_handler_allocator]] [constructor]] + [Construct from another any_completion_handler_allocator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.deallocate [*deallocate]]] + [Deallocate space for n objects of the allocator's value type. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.operator_not__eq_ [*operator!=]]] + [Inequality operator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.operator_eq__eq_ [*operator==]]] + [Equality operator. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:allocate any_completion_handler_allocator::allocate] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator.allocate..allocate..any_completion_handler_allocator] +Allocate space for `n` objects of the allocator's value type. + + + T * allocate( + std::size_t n) const; + + + +[endsect] + + + +[section:any_completion_handler_allocator any_completion_handler_allocator::any_completion_handler_allocator] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator.any_completion_handler_allocator..any_completion_handler_allocator..any_completion_handler_allocator] +Construct from another `any_completion_handler_allocator`. + + + template< + typename U> + constexpr any_completion_handler_allocator( + const any_completion_handler_allocator< U, Signatures...> & a); + + + +[endsect] + + + +[section:deallocate any_completion_handler_allocator::deallocate] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator.deallocate..deallocate..any_completion_handler_allocator] +Deallocate space for `n` objects of the allocator's value type. + + + void deallocate( + T * p, + std::size_t n) const; + + + +[endsect] + + + +[section:operator_not__eq_ any_completion_handler_allocator::operator!=] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator.operator_not__eq_..operator!=..any_completion_handler_allocator] +Inequality operator. + + + constexpr bool operator!=( + const any_completion_handler_allocator & other) const; + + + +[endsect] + + + +[section:operator_eq__eq_ any_completion_handler_allocator::operator==] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator.operator_eq__eq_..operator==..any_completion_handler_allocator] +Equality operator. + + + constexpr bool operator==( + const any_completion_handler_allocator & other) const; + + + +[endsect] + + + +[section:value_type any_completion_handler_allocator::value_type] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator.value_type..value_type..any_completion_handler_allocator] +The type of objects that may be allocated by the allocator. + + + typedef T value_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[endsect] + +[section:any_completion_handler_allocator__rebind any_completion_handler_allocator::rebind] + +[indexterm1 boost_asio.indexterm.any_completion_handler_allocator__rebind..any_completion_handler_allocator::rebind] + + +Rebinds an allocator to another value type. + + + template< + typename U> + struct rebind + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.any_completion_handler_allocator__rebind.other [*other]]] + [Specifies the type of the rebound allocator. ] + + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:other any_completion_handler_allocator::rebind::other] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator__rebind.other..other..any_completion_handler_allocator::rebind] +Specifies the type of the rebound allocator. + + + typedef any_completion_handler_allocator< U, Signatures...> other; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.any_completion_handler_allocator.value_type [*value_type]]] + [The type of objects that may be allocated by the allocator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.allocate [*allocate]]] + [Allocate space for n objects of the allocator's value type. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.any_completion_handler_allocator [*any_completion_handler_allocator]] [constructor]] + [Construct from another any_completion_handler_allocator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.deallocate [*deallocate]]] + [Deallocate space for n objects of the allocator's value type. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.operator_not__eq_ [*operator!=]]] + [Inequality operator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.operator_eq__eq_ [*operator==]]] + [Equality operator. ] + ] + +] + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[endsect] + +[section:any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_ any_completion_handler_allocator< void, Signatures...>] + +[indexterm1 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_..any_completion_handler_allocator< void, Signatures\.\.\.>] + + +A protoco-allocator type that may be rebound to obtain an allocator that forwards memory allocation operations through an instance of `any_completion_handler`. + + + template< + typename... Signatures> + class any_completion_handler_allocator< void, Signatures...> + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.value_type [*value_type]]] + [void as no objects can be allocated through a proto-allocator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.any_completion_handler_allocator [*any_completion_handler_allocator]]] + [Construct from another any_completion_handler_allocator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.operator_not__eq_ [*operator!=]]] + [Inequality operator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.operator_eq__eq_ [*operator==]]] + [Equality operator. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:any_completion_handler_allocator any_completion_handler_allocator< void, Signatures...>::any_completion_handler_allocator] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.any_completion_handler_allocator..any_completion_handler_allocator..any_completion_handler_allocator< void, Signatures\.\.\.>] +Construct from another `any_completion_handler_allocator`. + + + template< + typename U> + constexpr any_completion_handler_allocator( + const any_completion_handler_allocator< U, Signatures...> & a); + + + +[endsect] + + + +[section:operator_not__eq_ any_completion_handler_allocator< void, Signatures...>::operator!=] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.operator_not__eq_..operator!=..any_completion_handler_allocator< void, Signatures\.\.\.>] +Inequality operator. + + + constexpr bool operator!=( + const any_completion_handler_allocator & other) const; + + + +[endsect] + + + +[section:operator_eq__eq_ any_completion_handler_allocator< void, Signatures...>::operator==] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.operator_eq__eq_..operator==..any_completion_handler_allocator< void, Signatures\.\.\.>] +Equality operator. + + + constexpr bool operator==( + const any_completion_handler_allocator & other) const; + + + +[endsect] + + + +[section:value_type any_completion_handler_allocator< void, Signatures...>::value_type] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.value_type..value_type..any_completion_handler_allocator< void, Signatures\.\.\.>] +`void` as no objects can be allocated through a proto-allocator. + + + typedef void value_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[endsect] + +[section:any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind any_completion_handler_allocator< void, Signatures...>::rebind] + +[indexterm1 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind..any_completion_handler_allocator< void, Signatures\.\.\.>::rebind] + + +Rebinds an allocator to another value type. + + + template< + typename U> + struct any_completion_handler_allocator< void, Signatures...>::rebind + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind.other [*other]]] + [Specifies the type of the rebound allocator. ] + + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:other any_completion_handler_allocator< void, Signatures...>::rebind::other] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind.other..other..any_completion_handler_allocator< void, Signatures\.\.\.>::rebind] +Specifies the type of the rebound allocator. + + + typedef any_completion_handler_allocator< U, Signatures...> other; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.any_completion_handler_allocator.value_type [*value_type]]] + [The type of objects that may be allocated by the allocator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.allocate [*allocate]]] + [Allocate space for n objects of the allocator's value type. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.any_completion_handler_allocator [*any_completion_handler_allocator]] [constructor]] + [Construct from another any_completion_handler_allocator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.deallocate [*deallocate]]] + [Deallocate space for n objects of the allocator's value type. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.operator_not__eq_ [*operator!=]]] + [Inequality operator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.operator_eq__eq_ [*operator==]]] + [Equality operator. ] + ] + +] + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + [endsect] [section:any_io_executor any_io_executor] @@ -4186,7 +5169,7 @@ Forwards the request to get the cancellation slot to the associator specialisati static auto ``[link boost_asio.reference.associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_.get.overload2 get]``( reference_wrapper< T > t, - const CancellationSlot & s = CancellationSlot()); + const CancellationSlot & s); `` [''''»''' [link boost_asio.reference.associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_.get.overload2 more...]]`` @@ -4213,7 +5196,7 @@ Forwards the request to get the cancellation slot to the associator specialisati static auto get( reference_wrapper< T > t, - const CancellationSlot & s = CancellationSlot()); + const CancellationSlot & s); @@ -4622,6 +5605,261 @@ Specialisations shall meet the following requirements, where `t` is a const refe +[endsect] + +[section:associated_immediate_executor associated_immediate_executor] + +[indexterm1 boost_asio.indexterm.associated_immediate_executor..associated_immediate_executor] + + +Traits type used to obtain the immediate executor associated with an object. + + + template< + typename T, + typename ``[link boost_asio.reference.Executor1 Executor]``> + struct associated_immediate_executor + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.associated_immediate_executor.type [*type]]] + [If T has a nested type immediate_executor_type,. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.associated_immediate_executor.decltype [*decltype]] [static]] + [If T has a nested type immediate_executor_type, returns t.get_immediate_executor(). Otherwise returns boost::asio::require(ex, boost::asio::execution::blocking.never). ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.associated_immediate_executor.noexcept [*noexcept]]] + [] + ] + +] + +A program may specialise this traits type if the `T` template parameter in the specialisation is a user-defined type. The template parameter `Executor` shall be a type meeting the Executor requirements. + +Specialisations shall meet the following requirements, where `t` is a const reference to an object of type `T`, and `e` is an object of type `Executor`. + + +* Provide a nested typedef `type` that identifies a type meeting the Executor requirements. + + +* Provide a noexcept static member function named `get`, callable as `get(t)` and with return type `type` or a (possibly const) reference to `type`. + + +* Provide a noexcept static member function named `get`, callable as `get(t,e)` and with return type `type` or a (possibly const) reference to `type`. + + + +[heading Requirements] + +['Header: ][^boost/asio/associated_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:decltype associated_immediate_executor::decltype] + +[indexterm2 boost_asio.indexterm.associated_immediate_executor.decltype..decltype..associated_immediate_executor] +If `T` has a nested type `immediate_executor_type`, returns `t.get_immediate_executor()`. Otherwise returns `boost::asio::require(ex, boost::asio::execution::blocking.never)`. + + + static static decltype( + auto ) const; + + + +[endsect] + + + +[section:noexcept associated_immediate_executor::noexcept] + +[indexterm2 boost_asio.indexterm.associated_immediate_executor.noexcept..noexcept..associated_immediate_executor] + + const Executor &ex noexcept; + + + +[endsect] + + + +[section:type associated_immediate_executor::type] + +[indexterm2 boost_asio.indexterm.associated_immediate_executor.type..type..associated_immediate_executor] +If `T` has a nested type `immediate_executor_type`,. + + + typedef see_below type; + + + +[heading Requirements] + +['Header: ][^boost/asio/associated_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[endsect] + +[section:associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_ associated_immediate_executor< reference_wrapper< T >, Executor >] + +[indexterm1 boost_asio.indexterm.associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_..associated_immediate_executor< reference_wrapper< T >, Executor >] + + +Specialisation of [link boost_asio.reference.associated_immediate_executor `associated_immediate_executor`] for `std::reference_wrapper`. + + + template< + typename T, + typename ``[link boost_asio.reference.Executor1 Executor]``> + struct associated_immediate_executor< reference_wrapper< T >, Executor > + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_.type [*type]]] + [Forwards type to the associator specialisation for the unwrapped type T. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_.get [*get]] [static]] + [Forwards the request to get the executor to the associator specialisation for the unwrapped type T. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/associated_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:get associated_immediate_executor< reference_wrapper< T >, Executor >::get] + +[indexterm2 boost_asio.indexterm.associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_.get..get..associated_immediate_executor< reference_wrapper< T >, Executor >] +Forwards the request to get the executor to the associator specialisation for the unwrapped type `T`. + + + static auto get( + reference_wrapper< T > t, + const Executor & ex); + + + +[endsect] + + + +[section:type associated_immediate_executor< reference_wrapper< T >, Executor >::type] + +[indexterm2 boost_asio.indexterm.associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_.type..type..associated_immediate_executor< reference_wrapper< T >, Executor >] +Forwards `type` to the associator specialisation for the unwrapped type `T`. + + + typedef associated_immediate_executor< T, Executor >::type type; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.associated_immediate_executor.type [*type]]] + [If T has a nested type immediate_executor_type,. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.associated_immediate_executor.decltype [*decltype]] [static]] + [If T has a nested type immediate_executor_type, returns t.get_immediate_executor(). Otherwise returns boost::asio::require(ex, boost::asio::execution::blocking.never). ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.associated_immediate_executor.noexcept [*noexcept]]] + [] + ] + +] + +A program may specialise this traits type if the `T` template parameter in the specialisation is a user-defined type. The template parameter `Executor` shall be a type meeting the Executor requirements. + +Specialisations shall meet the following requirements, where `t` is a const reference to an object of type `T`, and `e` is an object of type `Executor`. + + +* Provide a nested typedef `type` that identifies a type meeting the Executor requirements. + + +* Provide a noexcept static member function named `get`, callable as `get(t)` and with return type `type` or a (possibly const) reference to `type`. + + +* Provide a noexcept static member function named `get`, callable as `get(t,e)` and with return type `type` or a (possibly const) reference to `type`. + + + + +[heading Requirements] + +['Header: ][^boost/asio/associated_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + [endsect] [section:associator associator] @@ -41483,7 +42721,8 @@ Provides signal functionality. template< typename ``[link boost_asio.reference.Executor1 Executor]`` = any_io_executor> - class basic_signal_set + class basic_signal_set : + public signal_set_base [heading Types] @@ -41504,6 +42743,20 @@ Provides signal functionality. ] + [ + + [[link boost_asio.reference.basic_signal_set.flags [*flags]]] + [Enumeration representing the different types of flags that may specified when adding a signal to a set. ] + + ] + + [ + + [[link boost_asio.reference.basic_signal_set.flags_t [*flags_t]]] + [Portability typedef. ] + + ] + ] [heading Member Functions] @@ -41512,7 +42765,9 @@ Provides signal functionality. [ [[link boost_asio.reference.basic_signal_set.add [*add]]] - [Add a signal to a signal_set. ] + [Add a signal to a signal_set. + [hr] + Add a signal to a signal_set with the specified flags. ] ] [ @@ -41640,7 +42895,22 @@ Add a signal to a signal\_set. `` [''''»''' [link boost_asio.reference.basic_signal_set.add.overload2 more...]]`` -[section:overload1 basic_signal_set::add (1 of 2 overloads)] +Add a signal to a signal\_set with the specified flags. + + + void ``[link boost_asio.reference.basic_signal_set.add.overload3 add]``( + int signal_number, + flags_t f); + `` [''''»''' [link boost_asio.reference.basic_signal_set.add.overload3 more...]]`` + + void ``[link boost_asio.reference.basic_signal_set.add.overload4 add]``( + int signal_number, + flags_t f, + boost::system::error_code & ec); + `` [''''»''' [link boost_asio.reference.basic_signal_set.add.overload4 more...]]`` + + +[section:overload1 basic_signal_set::add (1 of 4 overloads)] Add a signal to a signal\_set. @@ -41679,7 +42949,7 @@ This function adds the specified signal to the set. It has no effect if the sign -[section:overload2 basic_signal_set::add (2 of 2 overloads)] +[section:overload2 basic_signal_set::add (2 of 4 overloads)] Add a signal to a signal\_set. @@ -41707,6 +42977,91 @@ This function adds the specified signal to the set. It has no effect if the sign +[endsect] + + + +[section:overload3 basic_signal_set::add (3 of 4 overloads)] + + +Add a signal to a signal\_set with the specified flags. + + + void add( + int signal_number, + flags_t f); + + +This function adds the specified signal to the set. It has no effect if the signal is already in the set. + +Flags other than flags::dont\_care require OS support for the `sigaction` call, and this function will fail with `error::operation_not_supported` if this is unavailable. + +The specified flags will conflict with a prior, active registration of the same signal, if either specified a flags value other than flags::dont\_care. In this case, the `add` will fail with `error::invalid_argument`. + + +[heading Parameters] + + +[variablelist + +[[signal_number][The signal to be added to the set.]] + +[[f][Flags to modify the behaviour of the specified signal.]] + +] + + +[heading Exceptions] + + +[variablelist + +[[boost::system::system_error][Thrown on failure. ]] + +] + + + + +[endsect] + + + +[section:overload4 basic_signal_set::add (4 of 4 overloads)] + + +Add a signal to a signal\_set with the specified flags. + + + void add( + int signal_number, + flags_t f, + boost::system::error_code & ec); + + +This function adds the specified signal to the set. It has no effect if the signal is already in the set. + +Flags other than flags::dont\_care require OS support for the `sigaction` call, and this function will fail with `error::operation_not_supported` if this is unavailable. + +The specified flags will conflict with a prior, active registration of the same signal, if either specified a flags value other than flags::dont\_care. In this case, the `add` will fail with `error::invalid_argument`. + + +[heading Parameters] + + +[variablelist + +[[signal_number][The signal to be added to the set.]] + +[[f][Flags to modify the behaviour of the specified signal.]] + +[[ec][Set to indicate what error occurred, if any. ]] + +] + + + + [endsect] @@ -42412,6 +43767,82 @@ The type of the executor associated with the object. +[section:flags basic_signal_set::flags] + + +['Inherited from signal_set_base.] + +[indexterm2 boost_asio.indexterm.basic_signal_set.flags..flags..basic_signal_set] +Enumeration representing the different types of flags that may specified when adding a signal to a set. + + enum flags + +[indexterm2 boost_asio.indexterm.basic_signal_set.flags.none..none..basic_signal_set] +[indexterm2 boost_asio.indexterm.basic_signal_set.flags.restart..restart..basic_signal_set] +[indexterm2 boost_asio.indexterm.basic_signal_set.flags.no_child_stop..no_child_stop..basic_signal_set] +[indexterm2 boost_asio.indexterm.basic_signal_set.flags.no_child_wait..no_child_wait..basic_signal_set] +[indexterm2 boost_asio.indexterm.basic_signal_set.flags.dont_care..dont_care..basic_signal_set] + +[heading Values] +[variablelist + + [ + [none] + [Bitmask representing no flags. ] + ] + + [ + [restart] + [Affects the behaviour of interruptible functions such that, if the function would have failed with error::interrupted when interrupted by the specified signal, the function shall instead be restarted and not fail with error::interrupted. ] + ] + + [ + [no_child_stop] + [Do not generate SIGCHLD when child processes stop or stopped child processes continue. ] + ] + + [ + [no_child_wait] + [Do not transform child processes into zombies when they terminate. ] + ] + + [ + [dont_care] + [Special value to indicate that the signal registration does not care which flags are set, and so will not conflict with any prior registrations of the same signal. ] + ] + +] + + + +[endsect] + + + +[section:flags_t basic_signal_set::flags_t] + + +['Inherited from signal_set_base.] + +[indexterm2 boost_asio.indexterm.basic_signal_set.flags_t..flags_t..basic_signal_set] +Portability typedef. + + + typedef flags flags_t; + + + +[heading Requirements] + +['Header: ][^boost/asio/basic_signal_set.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + [section:get_executor basic_signal_set::get_executor] [indexterm2 boost_asio.indexterm.basic_signal_set.get_executor..get_executor..basic_signal_set] @@ -42602,6 +44033,20 @@ The signal set type when rebound to the specified executor. ] + [ + + [[link boost_asio.reference.basic_signal_set.flags [*flags]]] + [Enumeration representing the different types of flags that may specified when adding a signal to a set. ] + + ] + + [ + + [[link boost_asio.reference.basic_signal_set.flags_t [*flags_t]]] + [Portability typedef. ] + + ] + ] [heading Member Functions] @@ -42610,7 +44055,9 @@ The signal set type when rebound to the specified executor. [ [[link boost_asio.reference.basic_signal_set.add [*add]]] - [Add a signal to a signal_set. ] + [Add a signal to a signal_set. + [hr] + Add a signal to a signal_set with the specified flags. ] ] [ @@ -70730,6 +72177,32 @@ Associate an object of type `T` with an execution context's executor. [endsect] + +[section:bind_immediate_executor bind_immediate_executor] + +[indexterm1 boost_asio.indexterm.bind_immediate_executor..bind_immediate_executor] + +Associate an object of type `T` with a immediate executor of type `Executor`. + + + template< + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename T> + immediate_executor_binder< typename decay< T >::type, Executor > bind_immediate_executor( + const Executor & e, + T && t); + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + [section:buffer buffer] [indexterm1 boost_asio.indexterm.buffer..buffer] @@ -72782,6 +74255,64 @@ The number of bytes copied is the lesser of: This function is implemented in terms of `memcpy`, and consequently it cannot be used to copy between overlapping memory regions. +[endsect] + + +[endsect] + +[section:buffer_literals__operator_quot__quot__buf buffer_literals::operator""_buf] + +[indexterm1 boost_asio.indexterm.buffer_literals__operator_quot__quot__buf..buffer_literals::operator""_buf] + +Literal operator for creating [link boost_asio.reference.const_buffer `const_buffer`] objects from string literals. + + const_buffer ``[link boost_asio.reference.buffer_literals__operator_quot__quot__buf.overload1 operator""_buf]``( + const char * data, + std::size_t n); + `` [''''»''' [link boost_asio.reference.buffer_literals__operator_quot__quot__buf.overload1 more...]]`` + +Literal operator for creating [link boost_asio.reference.const_buffer `const_buffer`] objects from unbounded binary or hexadecimal integer literals. + + template< + char... Chars> + const_buffer ``[link boost_asio.reference.buffer_literals__operator_quot__quot__buf.overload2 operator""_buf]``(); + `` [''''»''' [link boost_asio.reference.buffer_literals__operator_quot__quot__buf.overload2 more...]]`` + +[heading Requirements] + +['Header: ][^boost/asio/buffer.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:overload1 buffer_literals::operator""_buf (1 of 2 overloads)] + + +Literal operator for creating [link boost_asio.reference.const_buffer `const_buffer`] objects from string literals. + + + const_buffer operator""_buf( + const char * data, + std::size_t n); + + + +[endsect] + + + +[section:overload2 buffer_literals::operator""_buf (2 of 2 overloads)] + + +Literal operator for creating [link boost_asio.reference.const_buffer `const_buffer`] objects from unbounded binary or hexadecimal integer literals. + + + template< + char... Chars> + const_buffer operator""_buf(); + + + [endsect] @@ -81838,7 +83369,7 @@ Submits a completion token or function object for execution. ``[link boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link boost_asio.reference.defer.overload2 defer]``( const Executor & ex, NullaryToken && token = ``[link boost_asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + typename constraint< (execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value >::type = 0); `` [''''»''' [link boost_asio.reference.defer.overload2 more...]]`` template< @@ -81973,7 +83504,7 @@ Submits a completion token or function object for execution. ``[link boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` defer( const Executor & ex, NullaryToken && token = ``[link boost_asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + typename constraint< (execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value >::type = 0); This function submits an object for execution using the specified executor. The function object is queued for execution, and is never called from the current thread prior to returning from `defer()`. @@ -82261,6 +83792,100 @@ Initiate the asynchronous operation using the supplied completion token. +[endsect] + +[section:deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_ deferred_async_operation< deferred_signatures< Signatures...>, Initiation, InitArgs...>] + +[indexterm1 boost_asio.indexterm.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_..deferred_async_operation< deferred_signatures< Signatures\.\.\.>, Initiation, InitArgs\.\.\.>] + + +Encapsulates a deferred asynchronous operation thas has multiple completion signatures. + + + template< + typename... Signatures, + typename Initiation, + typename... InitArgs> + class deferred_async_operation< deferred_signatures< Signatures...>, Initiation, InitArgs...> + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.deferred_async_operation [*deferred_async_operation]]] + [Construct a deferred asynchronous operation from the arguments to an initiation function object. ] + ] + + [ + [[link boost_asio.reference.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.detail__index_sequence_for [*detail::index_sequence_for]]] + [] + ] + + [ + [[link boost_asio.reference.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.operator_lp__rp_ [*operator()]]] + [Initiate the asynchronous operation using the supplied completion token. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/deferred.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:deferred_async_operation deferred_async_operation< deferred_signatures< Signatures...>, Initiation, InitArgs...>::deferred_async_operation] + +[indexterm2 boost_asio.indexterm.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.deferred_async_operation..deferred_async_operation..deferred_async_operation< deferred_signatures< Signatures\.\.\.>, Initiation, InitArgs\.\.\.>] +Construct a deferred asynchronous operation from the arguments to an initiation function object. + + + template< + typename I, + typename... A> + constexpr deferred_async_operation( + deferred_init_tag , + I && initiation, + A &&... init_args); + + + +[endsect] + + + +[section:detail__index_sequence_for deferred_async_operation< deferred_signatures< Signatures...>, Initiation, InitArgs...>::detail::index_sequence_for] + +[indexterm2 boost_asio.indexterm.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.detail__index_sequence_for..detail::index_sequence_for..deferred_async_operation< deferred_signatures< Signatures\.\.\.>, Initiation, InitArgs\.\.\.>] + + auto detail::index_sequence_for(); + + + +[endsect] + + + +[section:operator_lp__rp_ deferred_async_operation< deferred_signatures< Signatures...>, Initiation, InitArgs...>::operator()] + +[indexterm2 boost_asio.indexterm.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.operator_lp__rp_..operator()..deferred_async_operation< deferred_signatures< Signatures\.\.\.>, Initiation, InitArgs\.\.\.>] +Initiate the asynchronous operation using the supplied completion token. + + + template< + typename CompletionToken> + auto operator()( + CompletionToken && token); + + + +[endsect] + + + [endsect] [section:deferred_conditional deferred_conditional] @@ -82599,11 +84224,27 @@ Defines a link between two consecutive operations in a sequence. [endsect] - [section:operator_lp__rp_ deferred_sequence::operator()] [indexterm2 boost_asio.indexterm.deferred_sequence.operator_lp__rp_..operator()..deferred_sequence] + template< + typename CompletionToken> + auto ``[link boost_asio.reference.deferred_sequence.operator_lp__rp_.overload1 operator()]``( + CompletionToken && token); + `` [''''»''' [link boost_asio.reference.deferred_sequence.operator_lp__rp_.overload1 more...]]`` + + template< + typename CompletionToken> + auto ``[link boost_asio.reference.deferred_sequence.operator_lp__rp_.overload2 operator()]``( + CompletionToken && token) const; + `` [''''»''' [link boost_asio.reference.deferred_sequence.operator_lp__rp_.overload2 more...]]`` + + +[section:overload1 deferred_sequence::operator() (1 of 2 overloads)] + + + template< typename CompletionToken> auto operator()( @@ -82615,50 +84256,43 @@ Defines a link between two consecutive operations in a sequence. -[endsect] +[section:overload2 deferred_sequence::operator() (2 of 2 overloads)] -[section:deferred_sequence__initiate deferred_sequence::initiate] -[indexterm1 boost_asio.indexterm.deferred_sequence__initiate..deferred_sequence::initiate] + template< + typename CompletionToken> + auto operator()( + CompletionToken && token) const; - struct initiate +[endsect] -[heading Member Functions] -[table - [[Name][Description]] - [ - [[link boost_asio.reference.deferred_sequence__initiate.operator_lp__rp_ [*operator()]]] - [] - ] - -] +[endsect] -[heading Requirements] -['Header: ][^boost/asio/deferred.hpp] +[endsect] -['Convenience header: ][^boost/asio.hpp] +[section:deferred_signatures deferred_signatures] +[indexterm1 boost_asio.indexterm.deferred_signatures..deferred_signatures] -[section:operator_lp__rp_ deferred_sequence::initiate::operator()] -[indexterm2 boost_asio.indexterm.deferred_sequence__initiate.operator_lp__rp_..operator()..deferred_sequence::initiate] +Helper type to wrap multiple completion signatures. + template< - typename ``[link boost_asio.reference.Handler Handler]``> - void operator()( - Handler && handler, - Head head, - Tail && tail); + typename... Signatures> + struct deferred_signatures +[heading Requirements] -[endsect] +['Header: ][^boost/asio/deferred.hpp] +['Convenience header: ][^boost/asio.hpp] [endsect] @@ -99461,7 +101095,8 @@ The main type of a resumable coroutine. template< typename Yield = void, typename Return = void, - typename ``[link boost_asio.reference.Executor1 Executor]`` = any_io_executor> + typename ``[link boost_asio.reference.Executor1 Executor]`` = any_io_executor, + typename Allocator = std::allocator> struct coro @@ -99483,6 +101118,11 @@ The main type of a resumable coroutine. ] ] + [ + [[link boost_asio.reference.experimental__coro.get_allocator [*get_allocator]]] + [Get the used allocator. ] + ] + [ [[link boost_asio.reference.experimental__coro.get_executor [*get_executor]]] [Get the used executor. ] @@ -99709,6 +101349,20 @@ Move constructor. [endsect] +[section:get_allocator experimental::coro::get_allocator] + +[indexterm2 boost_asio.indexterm.experimental__coro.get_allocator..get_allocator..experimental::coro] +Get the used allocator. + + + allocator_type get_allocator() const; + + + +[endsect] + + + [section:get_executor experimental::coro::get_executor] [indexterm2 boost_asio.indexterm.experimental__coro.get_executor..get_executor..experimental::coro] @@ -100033,6 +101687,53 @@ Whether or not the coroutine is noexcept. [endsect] +[section:experimental__is_async_operation_range experimental::is_async_operation_range] + +[indexterm1 boost_asio.indexterm.experimental__is_async_operation_range..experimental::is_async_operation_range] + + +Type trait used to determine whether a type is a range of asynchronous operations that can be used with with `make_parallel_group`. + + + template< + typename T> + struct is_async_operation_range + + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.experimental__is_async_operation_range.value [*value]] [static]] + [The value member is true if the type may be used as a range of asynchronous operations. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/experimental/parallel_group.hpp] + +['Convenience header: ]None + + +[section:value experimental::is_async_operation_range::value] + +[indexterm2 boost_asio.indexterm.experimental__is_async_operation_range.value..value..experimental::is_async_operation_range] +The value member is true if the type may be used as a range of asynchronous operations. + + + static const bool value; + + + +[endsect] + + + +[endsect] + [section:experimental__is_promise experimental::is_promise] [indexterm1 boost_asio.indexterm.experimental__is_promise..experimental::is_promise] @@ -100092,11 +101793,45 @@ Whether or not the coroutine is noexcept. [endsect] - [section:experimental__make_parallel_group experimental::make_parallel_group] [indexterm1 boost_asio.indexterm.experimental__make_parallel_group..experimental::make_parallel_group] +Create a group of operations that may be launched in parallel. + + template< + typename... Ops> + parallel_group< Ops...> ``[link boost_asio.reference.experimental__make_parallel_group.overload1 make_parallel_group]``( + Ops... ops); + `` [''''»''' [link boost_asio.reference.experimental__make_parallel_group.overload1 more...]]`` + + template< + typename Range> + ranged_parallel_group< typename std::decay< Range >::type > ``[link boost_asio.reference.experimental__make_parallel_group.overload2 make_parallel_group]``( + Range && range, + typename constraint< is_async_operation_range< typename std::decay< Range >::type >::value >::type = 0); + `` [''''»''' [link boost_asio.reference.experimental__make_parallel_group.overload2 more...]]`` + + template< + typename Allocator, + typename Range> + ranged_parallel_group< typename std::decay< Range >::type, Allocator > ``[link boost_asio.reference.experimental__make_parallel_group.overload3 make_parallel_group]``( + allocator_arg_t , + const Allocator & allocator, + Range && range, + typename constraint< is_async_operation_range< typename std::decay< Range >::type >::value >::type = 0); + `` [''''»''' [link boost_asio.reference.experimental__make_parallel_group.overload3 more...]]`` + +[heading Requirements] + +['Header: ][^boost/asio/experimental/parallel_group.hpp] + +['Convenience header: ]None + + +[section:overload1 experimental::make_parallel_group (1 of 3 overloads)] + + Create a group of operations that may be launched in parallel. @@ -100144,16 +101879,167 @@ For example: -[heading Requirements] -['Header: ][^boost/asio/experimental/parallel_group.hpp] +[endsect] + + + +[section:overload2 experimental::make_parallel_group (2 of 3 overloads)] + + +Create a group of operations that may be launched in parallel. + + + template< + typename Range> + ranged_parallel_group< typename std::decay< Range >::type > make_parallel_group( + Range && range, + typename constraint< is_async_operation_range< typename std::decay< Range >::type >::value >::type = 0); + + + +[heading Parameters] + + +[variablelist + +[[range][A range containing the operations to be launched.]] + +] + +For example: + + using op_type = decltype( + socket1.async_read_some( + boost::asio::buffer(data1), + boost::asio::deferred + ) + ); + + std::vector ops; + + ops.push_back( + socket1.async_read_some( + boost::asio::buffer(data1), + boost::asio::deferred + ) + ); + + ops.push_back( + socket2.async_read_some( + boost::asio::buffer(data2), + boost::asio::deferred + ) + ); + + boost::asio::experimental::make_parallel_group(ops).async_wait( + boost::asio::experimental::wait_for_all(), + []( + std::vector completion_order, + std::vector e, + std::vector n + ) + { + for (std::size_t i = 0; i < completion_order.size(); ++i) + { + std::size_t idx = completion_order[i]; + std::cout << "socket " << idx << " finished: "; + std::cout << e[idx] << ", " << n[idx] << "\n"; + } + } + ); + + -['Convenience header: ]None [endsect] + +[section:overload3 experimental::make_parallel_group (3 of 3 overloads)] + + +Create a group of operations that may be launched in parallel. + + + template< + typename Allocator, + typename Range> + ranged_parallel_group< typename std::decay< Range >::type, Allocator > make_parallel_group( + allocator_arg_t , + const Allocator & allocator, + Range && range, + typename constraint< is_async_operation_range< typename std::decay< Range >::type >::value >::type = 0); + + + +[heading Parameters] + + +[variablelist + +[[allocator][Specifies the allocator to be used with the result vectors.]] + +[[range][A range containing the operations to be launched.]] + +] + +For example: + + using op_type = decltype( + socket1.async_read_some( + boost::asio::buffer(data1), + boost::asio::deferred + ) + ); + + std::vector ops; + + ops.push_back( + socket1.async_read_some( + boost::asio::buffer(data1), + boost::asio::deferred + ) + ); + + ops.push_back( + socket2.async_read_some( + boost::asio::buffer(data2), + boost::asio::deferred + ) + ); + + boost::asio::experimental::make_parallel_group( + std::allocator_arg_t, + my_allocator, + ops + ).async_wait( + boost::asio::experimental::wait_for_all(), + []( + std::vector completion_order, + std::vector e, + std::vector n + ) + { + for (std::size_t i = 0; i < completion_order.size(); ++i) + { + std::size_t idx = completion_order[i]; + std::cout << "socket " << idx << " finished: "; + std::cout << e[idx] << ", " << n[idx] << "\n"; + } + } + ); + + + + + +[endsect] + + +[endsect] + [section:experimental__parallel_group experimental::parallel_group] [indexterm1 boost_asio.indexterm.experimental__parallel_group..experimental::parallel_group] @@ -100309,112 +102195,85 @@ Class template `completion_signature_of` is a trait with a member type alias `ty [indexterm1 boost_asio.indexterm.experimental__promise..experimental::promise] -The primary template is not defined. +A disposable handle for an eager operation. template< typename Signature = void(), - typename ``[link boost_asio.reference.Executor1 Executor]`` = any_io_executor> + typename ``[link boost_asio.reference.Executor1 Executor]`` = boost::asio::any_io_executor, + typename Allocator = std::allocator> struct promise -[heading Requirements] - -['Header: ][^boost/asio/experimental/promise.hpp] - -['Convenience header: ]None - - -[endsect] - -[section:experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_ experimental::promise< void(Ts...), Executor >] - -[indexterm1 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_..experimental::promise< void(Ts\.\.\.), Executor >] - - - - template< - typename... Ts, - typename ``[link boost_asio.reference.Executor1 Executor]``> - struct promise< void(Ts...), Executor > - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt___rebind_executor [*promise< void(Ts...), Executor >::rebind_executor]]] - [Rebinds the promise type to another executor. ] - - ] - -] - [heading Member Functions] [table [[Name][Description]] [ - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.async_wait [*async_wait]]] - [Wait for the promise to become ready. ] - ] - - [ - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.cancel [*cancel]]] + [[link boost_asio.reference.experimental__promise.cancel [*cancel]]] [Cancel the promise. Usually done through the destructor. ] ] [ - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.complete [*complete]]] + [[link boost_asio.reference.experimental__promise.completed [*completed]]] [Check if the promise is completed already. ] ] [ - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.get_executor [*get_executor]]] - [Get the executor of the promise. ] + [[link boost_asio.reference.experimental__promise.operator_lp__rp_ [*operator()]]] + [Wait for the promise to become ready. ] ] [ - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise [*promise]]] + [[link boost_asio.reference.experimental__promise.promise [*promise]] [constructor]] [] ] [ - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_._promise [*~promise]] [destructor]] - [] + [[link boost_asio.reference.experimental__promise._promise [*~promise]] [destructor]] + [Destruct the promise and cancel the operation. ] ] ] -[heading Requirements] +Signature The signature of the operation. -['Header: ][^boost/asio/experimental/promise.hpp] +Executor The executor to be used by the promise (taken from the operation). -['Convenience header: ]None +Allocator The allocator used for the promise. Can be set through use\_allocator. +A promise can be used to initiate an asynchronous option that can be completed later. If the promise gets destroyed before completion, the operation gets a cancel signal and the result is ignored. -[section:async_wait experimental::promise< void(Ts...), Executor >::async_wait] +A promise fulfills the requirements of async\_operation. -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.async_wait..async_wait..experimental::promise< void(Ts\.\.\.), Executor >] -Wait for the promise to become ready. +[heading Examples] + +Reading and writing from one coroutine. + + awaitable read_write_some(boost::asio::ip::tcp::socket & sock, + boost::asio::mutable_buffer read_buf, boost::asio::const_buffer to_write) + { + auto p = boost::asio::async_read(read_buf, boost::asio::use_awaitable); + co_await boost::asio::async_write_some(to_write, boost::asio::deferred); + co_await p; + } - template< - typename CompletionToken = ``[link boost_asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - auto async_wait( - CompletionToken && token = ``[link boost_asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); -[endsect] +[heading Requirements] + +['Header: ][^boost/asio/experimental/promise.hpp] + +['Convenience header: ]None -[section:cancel experimental::promise< void(Ts...), Executor >::cancel] -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.cancel..cancel..experimental::promise< void(Ts\.\.\.), Executor >] +[section:cancel experimental::promise::cancel] + +[indexterm2 boost_asio.indexterm.experimental__promise.cancel..cancel..experimental::promise] Cancel the promise. Usually done through the destructor. @@ -100427,13 +102286,13 @@ Cancel the promise. Usually done through the destructor. -[section:complete experimental::promise< void(Ts...), Executor >::complete] +[section:completed experimental::promise::completed] -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.complete..complete..experimental::promise< void(Ts\.\.\.), Executor >] +[indexterm2 boost_asio.indexterm.experimental__promise.completed..completed..experimental::promise] Check if the promise is completed already. - bool complete() const; + bool completed() const; @@ -100441,36 +102300,39 @@ Check if the promise is completed already. -[section:get_executor experimental::promise< void(Ts...), Executor >::get_executor] +[section:operator_lp__rp_ experimental::promise::operator()] -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.get_executor..get_executor..experimental::promise< void(Ts\.\.\.), Executor >] -Get the executor of the promise. +[indexterm2 boost_asio.indexterm.experimental__promise.operator_lp__rp_..operator()..experimental::promise] +Wait for the promise to become ready. - executor_type get_executor() const; + template< + typename CompletionToken> + ``[link boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` operator()( + CompletionToken && token); [endsect] -[section:promise experimental::promise< void(Ts...), Executor >::promise] +[section:promise experimental::promise::promise] -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise..promise..experimental::promise< void(Ts\.\.\.), Executor >] +[indexterm2 boost_asio.indexterm.experimental__promise.promise..promise..experimental::promise] - ``[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise.overload1 promise]``(); - `` [''''»''' [link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise.overload1 more...]]`` + ``[link boost_asio.reference.experimental__promise.promise.overload1 promise]``(); + `` [''''»''' [link boost_asio.reference.experimental__promise.promise.overload1 more...]]`` - ``[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise.overload2 promise]``( + ``[link boost_asio.reference.experimental__promise.promise.overload2 promise]``( const promise & ); - `` [''''»''' [link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise.overload2 more...]]`` + `` [''''»''' [link boost_asio.reference.experimental__promise.promise.overload2 more...]]`` - ``[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise.overload3 promise]``( + ``[link boost_asio.reference.experimental__promise.promise.overload3 promise]``( promise && ); - `` [''''»''' [link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise.overload3 more...]]`` + `` [''''»''' [link boost_asio.reference.experimental__promise.promise.overload3 more...]]`` -[section:overload1 experimental::promise< void(Ts...), Executor >::promise (1 of 3 overloads)] +[section:overload1 experimental::promise::promise (1 of 3 overloads)] @@ -100482,7 +102344,7 @@ Get the executor of the promise. -[section:overload2 experimental::promise< void(Ts...), Executor >::promise (2 of 3 overloads)] +[section:overload2 experimental::promise::promise (2 of 3 overloads)] @@ -100495,7 +102357,7 @@ Get the executor of the promise. -[section:overload3 experimental::promise< void(Ts...), Executor >::promise (3 of 3 overloads)] +[section:overload3 experimental::promise::promise (3 of 3 overloads)] @@ -100510,13 +102372,17 @@ Get the executor of the promise. [endsect] -[section:_promise experimental::promise< void(Ts...), Executor >::~promise] +[section:_promise experimental::promise::~promise] + +[indexterm2 boost_asio.indexterm.experimental__promise._promise..~promise..experimental::promise] +Destruct the promise and cancel the operation. -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_._promise..~promise..experimental::promise< void(Ts\.\.\.), Executor >] ~promise(); +It is safe to destruct a promise of a promise that didn't complete. + [endsect] @@ -100524,31 +102390,36 @@ Get the executor of the promise. [endsect] -[section:experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt___rebind_executor experimental::promise< void(Ts...), Executor >::rebind_executor] - -[indexterm1 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt___rebind_executor..experimental::promise< void(Ts\.\.\.), Executor >::rebind_executor] +[section:experimental__promise_value_type experimental::promise_value_type] +[indexterm1 boost_asio.indexterm.experimental__promise_value_type..experimental::promise_value_type] -Rebinds the promise type to another executor. template< - typename ``[link boost_asio.reference.Executor1 Executor1]``> - struct promise< void(Ts...), Executor >::rebind_executor + typename... Ts> + struct promise_value_type -[heading Types] -[table - [[Name][Description]] +[heading Requirements] - [ +['Header: ][^boost/asio/experimental/promise.hpp] - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt___rebind_executor.other [*other]]] - [The file type when rebound to the specified executor. ] - - ] +['Convenience header: ]None + + +[endsect] + +[section:experimental__promise_value_type_lt__T__gt_ experimental::promise_value_type< T >] + +[indexterm1 boost_asio.indexterm.experimental__promise_value_type_lt__T__gt_..experimental::promise_value_type< T >] + + + + template< + typename T> + struct promise_value_type< T > -] [heading Requirements] @@ -100557,15 +102428,17 @@ Rebinds the promise type to another executor. ['Convenience header: ]None -[section:other experimental::promise< void(Ts...), Executor >::rebind_executor::other] +[endsect] -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt___rebind_executor.other..other..experimental::promise< void(Ts\.\.\.), Executor >::rebind_executor] -The file type when rebound to the specified executor. +[section:experimental__promise_value_type_lt__gt_ experimental::promise_value_type<>] +[indexterm1 boost_asio.indexterm.experimental__promise_value_type_lt__gt_..experimental::promise_value_type<>] - typedef promise< void(Ts...), Executor1 > other; + template<> + struct promise_value_type<> + [heading Requirements] @@ -100576,67 +102449,141 @@ The file type when rebound to the specified executor. [endsect] +[section:experimental__ranged_parallel_group experimental::ranged_parallel_group] +[indexterm1 boost_asio.indexterm.experimental__ranged_parallel_group..experimental::ranged_parallel_group] -[endsect] -[section:experimental__promise_value_type experimental::promise_value_type] +A range-based group of asynchronous operations that may be launched in parallel. -[indexterm1 boost_asio.indexterm.experimental__promise_value_type..experimental::promise_value_type] + template< + typename Range, + typename Allocator = std::allocator> + class ranged_parallel_group - template< - typename... Ts> - struct promise_value_type +[heading Types] +[table + [[Name][Description]] + [ + + [[link boost_asio.reference.experimental__ranged_parallel_group.signature [*signature]]] + [The completion signature for the group of operations. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.experimental__ranged_parallel_group.async_wait [*async_wait]]] + [Initiate an asynchronous wait for the group of operations. ] + ] + + [ + [[link boost_asio.reference.experimental__ranged_parallel_group.ranged_parallel_group [*ranged_parallel_group]] [constructor]] + [Constructor. ] + ] + +] + +See the documentation for [link boost_asio.reference.experimental__make_parallel_group `experimental::make_parallel_group`] for a usage example. [heading Requirements] -['Header: ][^boost/asio/experimental/promise.hpp] +['Header: ][^boost/asio/experimental/parallel_group.hpp] ['Convenience header: ]None -[endsect] +[section:async_wait experimental::ranged_parallel_group::async_wait] -[section:experimental__promise_value_type_lt__T__gt_ experimental::promise_value_type< T >] +[indexterm2 boost_asio.indexterm.experimental__ranged_parallel_group.async_wait..async_wait..experimental::ranged_parallel_group] +Initiate an asynchronous wait for the group of operations. -[indexterm1 boost_asio.indexterm.experimental__promise_value_type_lt__T__gt_..experimental::promise_value_type< T >] + template< + typename CancellationCondition, + typename CompletionToken> + ``[link boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( + CancellationCondition cancellation_condition, + CompletionToken && token); - template< - typename T> - struct promise_value_type< T > +Launches the group and asynchronously waits for completion. -[heading Requirements] +[heading Parameters] + + +[variablelist + +[[cancellation_condition][A function object, called on completion of an operation within the group, that is used to determine whether to cancel the remaining operations. The function object is passed the arguments of the completed operation's handler. To trigger cancellation of the remaining operations, it must return a [link boost_asio.reference.cancellation_type `cancellation_type`] value other than `boost::asio::cancellation_type::none`.]] + +[[token][A [link boost_asio.overview.model.completion_tokens completion token] whose signature is comprised of a `std::vector` indicating the completion order of the operations, followed by a vector for each of the completion signature's arguments.]] + +] + +The library provides the following `cancellation_condition` types: + + +* [link boost_asio.reference.experimental__wait_for_all `experimental::wait_for_all`] + +* [link boost_asio.reference.experimental__wait_for_one `experimental::wait_for_one`] + +* [link boost_asio.reference.experimental__wait_for_one_error `experimental::wait_for_one_error`] + +* [link boost_asio.reference.experimental__wait_for_one_success `experimental::wait_for_one_success`] -['Header: ][^boost/asio/experimental/promise.hpp] -['Convenience header: ]None [endsect] -[section:experimental__promise_value_type_lt__gt_ experimental::promise_value_type<>] -[indexterm1 boost_asio.indexterm.experimental__promise_value_type_lt__gt_..experimental::promise_value_type<>] +[section:ranged_parallel_group experimental::ranged_parallel_group::ranged_parallel_group] +[indexterm2 boost_asio.indexterm.experimental__ranged_parallel_group.ranged_parallel_group..ranged_parallel_group..experimental::ranged_parallel_group] +Constructor. + + + ranged_parallel_group( + Range range, + const Allocator & allocator = Allocator()); + + + +[endsect] + + + +[section:signature experimental::ranged_parallel_group::signature] + +[indexterm2 boost_asio.indexterm.experimental__ranged_parallel_group.signature..signature..experimental::ranged_parallel_group] +The completion signature for the group of operations. + + + typedef detail::ranged_parallel_group_signature< typename completion_signature_of< typename std::decay< decltype(*std::declval< typename Range::iterator >))>::type >::type, Allocator >::type signature; - template<> - struct promise_value_type<> [heading Requirements] -['Header: ][^boost/asio/experimental/promise.hpp] +['Header: ][^boost/asio/experimental/parallel_group.hpp] ['Convenience header: ]None +[endsect] + + + [endsect] @@ -100667,11 +102614,11 @@ See the documentation for boost::asio::use\_coro\_t for a usage example. [indexterm1 boost_asio.indexterm.experimental__use_coro_t..experimental::use_coro_t] -A [link boost_asio.overview.model.completion_tokens completion token] that represents the currently executing resumable coroutine. +A [link boost_asio.overview.model.completion_tokens completion token] that creates another coro for the task completion. template< - typename ``[link boost_asio.reference.Executor1 Executor]`` = any_io_executor> + typename Allocator = std::allocator> struct use_coro_t @@ -100679,6 +102626,13 @@ A [link boost_asio.overview.model.completion_tokens completion token] that repre [table [[Name][Description]] + [ + + [[link boost_asio.reference.experimental__use_coro_t.allocator_type [*allocator_type]]] + [The allocator type. The allocator is used when constructing the std::promise object for a given asynchronous operation. ] + + ] + [ [[link boost_asio.reference.experimental__use_coro_t__executor_with_default [*executor_with_default]]] @@ -100697,6 +102651,16 @@ A [link boost_asio.overview.model.completion_tokens completion token] that repre [Function helper to adapt an I/O object to use use_coro_t as its default completion token type. ] ] + [ + [[link boost_asio.reference.experimental__use_coro_t.get_allocator [*get_allocator]]] + [Obtain allocator. ] + ] + + [ + [[link boost_asio.reference.experimental__use_coro_t.rebind [*rebind]]] + [Specify an alternate allocator. ] + ] + [ [[link boost_asio.reference.experimental__use_coro_t.use_coro_t [*use_coro_t]] [constructor]] [Default constructor. @@ -100719,7 +102683,9 @@ The `use_coro_t` class, with its value `use_coro`, is used to represent an opera -When used with co\_await, the initiating function (`async_read_some` in the above example) suspends the current coroutine. The coroutine is resumed when the asynchronous operation completes, and the result of the operation is returned. +When used with co\_await, the initiating function (`async_read_some` in the above example) suspends the current coroutine. The coroutine is resumed when the asynchronous operation completes, and the result of the operation is returned. + +Note that this token is not the most efficient (use `boost::asio::deferred` for that) but does provide type erasure, as it will always return a `coro`. [heading Requirements] @@ -100728,6 +102694,27 @@ When used with co\_await, the initiating function (`async_read_some` in the abov ['Convenience header: ]None +[section:allocator_type experimental::use_coro_t::allocator_type] + +[indexterm2 boost_asio.indexterm.experimental__use_coro_t.allocator_type..allocator_type..experimental::use_coro_t] +The allocator type. The allocator is used when constructing the `std::promise` object for a given asynchronous operation. + + + typedef Allocator allocator_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/experimental/use_coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + [section:as_default_on experimental::use_coro_t::as_default_on] [indexterm2 boost_asio.indexterm.experimental__use_coro_t.as_default_on..as_default_on..experimental::use_coro_t] @@ -100741,6 +102728,37 @@ Function helper to adapt an I/O object to use `use_coro_t` as its default comple +[endsect] + + + +[section:get_allocator experimental::use_coro_t::get_allocator] + +[indexterm2 boost_asio.indexterm.experimental__use_coro_t.get_allocator..get_allocator..experimental::use_coro_t] +Obtain allocator. + + + allocator_type get_allocator() const; + + + +[endsect] + + + +[section:rebind experimental::use_coro_t::rebind] + +[indexterm2 boost_asio.indexterm.experimental__use_coro_t.rebind..rebind..experimental::use_coro_t] +Specify an alternate allocator. + + + template< + typename OtherAllocator> + use_coro_t< OtherAllocator > rebind( + const OtherAllocator & allocator) const; + + + [endsect] @@ -100856,6 +102874,13 @@ Specify `use_coro_t` as the default completion token type. [table [[Name][Description]] + [ + + [[link boost_asio.reference.experimental__use_coro_t.allocator_type [*allocator_type]]] + [The allocator type. The allocator is used when constructing the std::promise object for a given asynchronous operation. ] + + ] + [ [[link boost_asio.reference.experimental__use_coro_t__executor_with_default [*executor_with_default]]] @@ -100874,6 +102899,16 @@ Specify `use_coro_t` as the default completion token type. [Function helper to adapt an I/O object to use use_coro_t as its default completion token type. ] ] + [ + [[link boost_asio.reference.experimental__use_coro_t.get_allocator [*get_allocator]]] + [Obtain allocator. ] + ] + + [ + [[link boost_asio.reference.experimental__use_coro_t.rebind [*rebind]]] + [Specify an alternate allocator. ] + ] + [ [[link boost_asio.reference.experimental__use_coro_t.use_coro_t [*use_coro_t]] [constructor]] [Default constructor. @@ -100896,7 +102931,9 @@ The `use_coro_t` class, with its value `use_coro`, is used to represent an opera -When used with co\_await, the initiating function (`async_read_some` in the above example) suspends the current coroutine. The coroutine is resumed when the asynchronous operation completes, and the result of the operation is returned. +When used with co\_await, the initiating function (`async_read_some` in the above example) suspends the current coroutine. The coroutine is resumed when the asynchronous operation completes, and the result of the operation is returned. + +Note that this token is not the most efficient (use `boost::asio::deferred` for that) but does provide type erasure, as it will always return a `coro`. [heading Requirements] @@ -100941,7 +102978,7 @@ Construct the adapted executor from the inner executor type. [heading Requirements] -['Header: ][^boost/asio/experimental/promise.hpp] +['Header: ][^boost/asio/experimental/use_promise.hpp] ['Convenience header: ]None @@ -100956,17 +102993,355 @@ Construct the adapted executor from the inner executor type. template< - typename ``[link boost_asio.reference.Executor1 Executor]`` = any_io_executor> + typename Allocator = std::allocator> struct use_promise_t +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.experimental__use_promise_t.allocator_type [*allocator_type]]] + [The allocator type. The allocator is used when constructing the promise object for a given asynchronous operation. ] + + ] + + [ + + [[link boost_asio.reference.experimental__use_promise_t__executor_with_default [*executor_with_default]]] + [Adapts an executor to add the use_promise_t completion token as the default. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.experimental__use_promise_t.as_default_on [*as_default_on]] [static]] + [Function helper to adapt an I/O object to use use_promise_t as its default completion token type. ] + ] + + [ + [[link boost_asio.reference.experimental__use_promise_t.get_allocator [*get_allocator]]] + [Obtain allocator. ] + ] + + [ + [[link boost_asio.reference.experimental__use_promise_t.rebind [*rebind]]] + [Specify an alternate allocator. ] + ] + + [ + [[link boost_asio.reference.experimental__use_promise_t.use_promise_t [*use_promise_t]] [constructor]] + [Construct using default-constructed allocator. + [hr] + Construct using specified allocator. ] + ] + +] + [heading Requirements] -['Header: ][^boost/asio/experimental/promise.hpp] +['Header: ][^boost/asio/experimental/use_promise.hpp] + +['Convenience header: ]None + + +[section:allocator_type experimental::use_promise_t::allocator_type] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t.allocator_type..allocator_type..experimental::use_promise_t] +The allocator type. The allocator is used when constructing the `promise` object for a given asynchronous operation. + + + typedef Allocator allocator_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/experimental/use_promise.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:as_default_on experimental::use_promise_t::as_default_on] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t.as_default_on..as_default_on..experimental::use_promise_t] +Function helper to adapt an I/O object to use `use_promise_t` as its default completion token type. + + + template< + typename T> + static decay< T >::type::template rebind_executor< executor_with_default< typename decay< T >::type::executor_type > >::other as_default_on( + T && object); + + + +[endsect] + + + +[section:get_allocator experimental::use_promise_t::get_allocator] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t.get_allocator..get_allocator..experimental::use_promise_t] +Obtain allocator. + + + allocator_type get_allocator() const; + + + +[endsect] + + + +[section:rebind experimental::use_promise_t::rebind] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t.rebind..rebind..experimental::use_promise_t] +Specify an alternate allocator. + + + template< + typename OtherAllocator> + use_promise_t< OtherAllocator > rebind( + const OtherAllocator & allocator) const; + + + +[endsect] + + +[section:use_promise_t experimental::use_promise_t::use_promise_t] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t.use_promise_t..use_promise_t..experimental::use_promise_t] +Construct using default-constructed allocator. + + + constexpr ``[link boost_asio.reference.experimental__use_promise_t.use_promise_t.overload1 use_promise_t]``(); + `` [''''»''' [link boost_asio.reference.experimental__use_promise_t.use_promise_t.overload1 more...]]`` + + +Construct using specified allocator. + + + explicit ``[link boost_asio.reference.experimental__use_promise_t.use_promise_t.overload2 use_promise_t]``( + const Allocator & allocator); + `` [''''»''' [link boost_asio.reference.experimental__use_promise_t.use_promise_t.overload2 more...]]`` + + +[section:overload1 experimental::use_promise_t::use_promise_t (1 of 2 overloads)] + + +Construct using default-constructed allocator. + + + constexpr use_promise_t(); + + + +[endsect] + + + +[section:overload2 experimental::use_promise_t::use_promise_t (2 of 2 overloads)] + + +Construct using specified allocator. + + + use_promise_t( + const Allocator & allocator); + + + +[endsect] + + +[endsect] + + +[endsect] + +[section:experimental__use_promise_t__executor_with_default experimental::use_promise_t::executor_with_default] + +[indexterm1 boost_asio.indexterm.experimental__use_promise_t__executor_with_default..experimental::use_promise_t::executor_with_default] + + +Adapts an executor to add the `use_promise_t` completion token as the default. + + + template< + typename ``[link boost_asio.reference.Executor1 InnerExecutor]``> + struct executor_with_default + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.experimental__use_promise_t__executor_with_default.default_completion_token_type [*default_completion_token_type]]] + [Specify use_promise_t as the default completion token type. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.experimental__use_promise_t__executor_with_default.executor_with_default [*executor_with_default]] [constructor]] + [Construct the adapted executor from the inner executor type. + [hr] + Convert the specified executor to the inner executor type, then use that to construct the adapted executor. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/experimental/use_promise.hpp] + +['Convenience header: ]None + + +[section:default_completion_token_type experimental::use_promise_t::executor_with_default::default_completion_token_type] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t__executor_with_default.default_completion_token_type..default_completion_token_type..experimental::use_promise_t::executor_with_default] +Specify `use_promise_t` as the default completion token type. + + + typedef use_promise_t< Allocator > default_completion_token_type; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.experimental__use_promise_t.allocator_type [*allocator_type]]] + [The allocator type. The allocator is used when constructing the promise object for a given asynchronous operation. ] + + ] + + [ + + [[link boost_asio.reference.experimental__use_promise_t__executor_with_default [*executor_with_default]]] + [Adapts an executor to add the use_promise_t completion token as the default. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.experimental__use_promise_t.as_default_on [*as_default_on]] [static]] + [Function helper to adapt an I/O object to use use_promise_t as its default completion token type. ] + ] + + [ + [[link boost_asio.reference.experimental__use_promise_t.get_allocator [*get_allocator]]] + [Obtain allocator. ] + ] + + [ + [[link boost_asio.reference.experimental__use_promise_t.rebind [*rebind]]] + [Specify an alternate allocator. ] + ] + + [ + [[link boost_asio.reference.experimental__use_promise_t.use_promise_t [*use_promise_t]] [constructor]] + [Construct using default-constructed allocator. + [hr] + Construct using specified allocator. ] + ] + +] + + +[heading Requirements] + +['Header: ][^boost/asio/experimental/use_promise.hpp] ['Convenience header: ]None +[endsect] + + +[section:executor_with_default experimental::use_promise_t::executor_with_default::executor_with_default] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t__executor_with_default.executor_with_default..executor_with_default..experimental::use_promise_t::executor_with_default] +Construct the adapted executor from the inner executor type. + + + ``[link boost_asio.reference.experimental__use_promise_t__executor_with_default.executor_with_default.overload1 executor_with_default]``( + const InnerExecutor & ex); + `` [''''»''' [link boost_asio.reference.experimental__use_promise_t__executor_with_default.executor_with_default.overload1 more...]]`` + + +Convert the specified executor to the inner executor type, then use that to construct the adapted executor. + + + template< + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + ``[link boost_asio.reference.experimental__use_promise_t__executor_with_default.executor_with_default.overload2 executor_with_default]``( + const OtherExecutor & ex, + typename constraint< is_convertible< OtherExecutor, InnerExecutor >::value >::type = 0); + `` [''''»''' [link boost_asio.reference.experimental__use_promise_t__executor_with_default.executor_with_default.overload2 more...]]`` + + +[section:overload1 experimental::use_promise_t::executor_with_default::executor_with_default (1 of 2 overloads)] + + +Construct the adapted executor from the inner executor type. + + + executor_with_default( + const InnerExecutor & ex); + + + +[endsect] + + + +[section:overload2 experimental::use_promise_t::executor_with_default::executor_with_default (2 of 2 overloads)] + + +Convert the specified executor to the inner executor type, then use that to construct the adapted executor. + + + template< + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + executor_with_default( + const OtherExecutor & ex, + typename constraint< is_convertible< OtherExecutor, InnerExecutor >::value >::type = 0); + + + +[endsect] + + +[endsect] + + [endsect] [section:experimental__wait_for_all experimental::wait_for_all] @@ -105784,7 +108159,7 @@ Helper function to obtain an object's associated executor. template< typename T, typename ExecutionContext> - auto ``[link boost_asio.reference.get_associated_executor.overload3 get_associated_executor]``( + associated_executor< T, typename ExecutionContext::executor_type >::type ``[link boost_asio.reference.get_associated_executor.overload3 get_associated_executor]``( const T & t, ExecutionContext & ctx, typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); @@ -105857,7 +108232,7 @@ Helper function to obtain an object's associated executor. template< typename T, typename ExecutionContext> - auto get_associated_executor( + associated_executor< T, typename ExecutionContext::executor_type >::type get_associated_executor( const T & t, ExecutionContext & ctx, typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); @@ -105871,6 +108246,92 @@ Helper function to obtain an object's associated executor. +[endsect] + + +[endsect] + +[section:get_associated_immediate_executor get_associated_immediate_executor] + +[indexterm1 boost_asio.indexterm.get_associated_immediate_executor..get_associated_immediate_executor] + +Helper function to obtain an object's associated executor. + + template< + typename T, + typename ``[link boost_asio.reference.Executor1 Executor]``> + auto ``[link boost_asio.reference.get_associated_immediate_executor.overload1 get_associated_immediate_executor]``( + const T & t, + const Executor & ex, + typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + `` [''''»''' [link boost_asio.reference.get_associated_immediate_executor.overload1 more...]]`` + + template< + typename T, + typename ExecutionContext> + associated_immediate_executor< T, typename ExecutionContext::executor_type >::type ``[link boost_asio.reference.get_associated_immediate_executor.overload2 get_associated_immediate_executor]``( + const T & t, + ExecutionContext & ctx, + typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + `` [''''»''' [link boost_asio.reference.get_associated_immediate_executor.overload2 more...]]`` + +[heading Requirements] + +['Header: ][^boost/asio/associated_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:overload1 get_associated_immediate_executor (1 of 2 overloads)] + + +Helper function to obtain an object's associated executor. + + + template< + typename T, + typename ``[link boost_asio.reference.Executor1 Executor]``> + auto get_associated_immediate_executor( + const T & t, + const Executor & ex, + typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + + + +[heading Return Value] + +`associated_immediate_executor::get(t, ex)` + + + + +[endsect] + + + +[section:overload2 get_associated_immediate_executor (2 of 2 overloads)] + + +Helper function to obtain an object's associated executor. + + + template< + typename T, + typename ExecutionContext> + associated_immediate_executor< T, typename ExecutionContext::executor_type >::type get_associated_immediate_executor( + const T & t, + ExecutionContext & ctx, + typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + + + +[heading Return Value] + +`associated_immediate_executorget(t, ctx.get_executor())` + + + + [endsect] @@ -106134,6 +108595,675 @@ This typedef uses the C++11 `` standard library facility, if available. [endsect] +[section:immediate_executor_binder immediate_executor_binder] + +[indexterm1 boost_asio.indexterm.immediate_executor_binder..immediate_executor_binder] + + +A call wrapper type to bind a immediate executor of type `Executor` to an object of type `T`. + + + template< + typename T, + typename ``[link boost_asio.reference.Executor1 Executor]``> + class immediate_executor_binder + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.immediate_executor_binder.argument_type [*argument_type]]] + [The type of the function's argument. ] + + ] + + [ + + [[link boost_asio.reference.immediate_executor_binder.first_argument_type [*first_argument_type]]] + [The type of the function's first argument. ] + + ] + + [ + + [[link boost_asio.reference.immediate_executor_binder.immediate_executor_type [*immediate_executor_type]]] + [The type of the associated immediate executor. ] + + ] + + [ + + [[link boost_asio.reference.immediate_executor_binder.result_type [*result_type]]] + [The return type if a function. ] + + ] + + [ + + [[link boost_asio.reference.immediate_executor_binder.second_argument_type [*second_argument_type]]] + [The type of the function's second argument. ] + + ] + + [ + + [[link boost_asio.reference.immediate_executor_binder.target_type [*target_type]]] + [The type of the target object. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.immediate_executor_binder.get [*get]]] + [Obtain a reference to the target object. ] + ] + + [ + [[link boost_asio.reference.immediate_executor_binder.get_immediate_executor [*get_immediate_executor]]] + [Obtain the associated immediate executor. ] + ] + + [ + [[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder [*immediate_executor_binder]] [constructor]] + [Construct a immediate executor wrapper for the specified object. + [hr] + Copy constructor. + [hr] + Construct a copy, but specify a different immediate executor. + [hr] + Construct a copy of a different immediate executor wrapper type. + [hr] + Construct a copy of a different immediate executor wrapper type, but specify a different immediate executor. + [hr] + Move constructor. + [hr] + Move construct the target object, but specify a different immediate executor. + [hr] + Move construct from a different immediate executor wrapper type. + [hr] + Move construct from a different immediate executor wrapper type, but specify a different immediate executor. ] + ] + + [ + [[link boost_asio.reference.immediate_executor_binder.operator_lp__rp_ [*operator()]]] + [] + ] + + [ + [[link boost_asio.reference.immediate_executor_binder._immediate_executor_binder [*~immediate_executor_binder]] [destructor]] + [Destructor. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:argument_type immediate_executor_binder::argument_type] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.argument_type..argument_type..immediate_executor_binder] +The type of the function's argument. + + + typedef see_below argument_type; + + + +The type of `argument_type` is based on the type `T` of the wrapper's target object: + + +* if `T` is a pointer to a function type accepting a single argument, `argument_type` is a synonym for the return type of `T`; + + +* if `T` is a class type with a member type `argument_type`, then `argument_type` is a synonym for `T::argument_type`; + + +* otherwise `argument_type` is not defined. + + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:first_argument_type immediate_executor_binder::first_argument_type] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.first_argument_type..first_argument_type..immediate_executor_binder] +The type of the function's first argument. + + + typedef see_below first_argument_type; + + + +The type of `first_argument_type` is based on the type `T` of the wrapper's target object: + + +* if `T` is a pointer to a function type accepting two arguments, `first_argument_type` is a synonym for the return type of `T`; + + +* if `T` is a class type with a member type `first_argument_type`, then `first_argument_type` is a synonym for `T::first_argument_type`; + + +* otherwise `first_argument_type` is not defined. + + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + +[section:get immediate_executor_binder::get] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.get..get..immediate_executor_binder] +Obtain a reference to the target object. + + + target_type & ``[link boost_asio.reference.immediate_executor_binder.get.overload1 get]``(); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.get.overload1 more...]]`` + + const target_type & ``[link boost_asio.reference.immediate_executor_binder.get.overload2 get]``() const; + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.get.overload2 more...]]`` + + +[section:overload1 immediate_executor_binder::get (1 of 2 overloads)] + + +Obtain a reference to the target object. + + + target_type & get(); + + + +[endsect] + + + +[section:overload2 immediate_executor_binder::get (2 of 2 overloads)] + + +Obtain a reference to the target object. + + + const target_type & get() const; + + + +[endsect] + + +[endsect] + + +[section:get_immediate_executor immediate_executor_binder::get_immediate_executor] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.get_immediate_executor..get_immediate_executor..immediate_executor_binder] +Obtain the associated immediate executor. + + + immediate_executor_type get_immediate_executor() const; + + + +[endsect] + + +[section:immediate_executor_binder immediate_executor_binder::immediate_executor_binder] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.immediate_executor_binder..immediate_executor_binder..immediate_executor_binder] +Construct a immediate executor wrapper for the specified object. + + + template< + typename U> + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload1 immediate_executor_binder]``( + const immediate_executor_type & e, + U && u); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload1 more...]]`` + + +Copy constructor. + + + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload2 immediate_executor_binder]``( + const immediate_executor_binder & other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload2 more...]]`` + + +Construct a copy, but specify a different immediate executor. + + + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload3 immediate_executor_binder]``( + const immediate_executor_type & e, + const immediate_executor_binder & other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload3 more...]]`` + + +Construct a copy of a different immediate executor wrapper type. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload4 immediate_executor_binder]``( + const immediate_executor_binder< U, OtherExecutor > & other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload4 more...]]`` + + +Construct a copy of a different immediate executor wrapper type, but specify a different immediate executor. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload5 immediate_executor_binder]``( + const immediate_executor_type & e, + const immediate_executor_binder< U, OtherExecutor > & other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload5 more...]]`` + + +Move constructor. + + + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload6 immediate_executor_binder]``( + immediate_executor_binder && other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload6 more...]]`` + + +Move construct the target object, but specify a different immediate executor. + + + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload7 immediate_executor_binder]``( + const immediate_executor_type & e, + immediate_executor_binder && other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload7 more...]]`` + + +Move construct from a different immediate executor wrapper type. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload8 immediate_executor_binder]``( + immediate_executor_binder< U, OtherExecutor > && other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload8 more...]]`` + + +Move construct from a different immediate executor wrapper type, but specify a different immediate executor. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload9 immediate_executor_binder]``( + const immediate_executor_type & e, + immediate_executor_binder< U, OtherExecutor > && other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload9 more...]]`` + + +[section:overload1 immediate_executor_binder::immediate_executor_binder (1 of 9 overloads)] + + +Construct a immediate executor wrapper for the specified object. + + + template< + typename U> + immediate_executor_binder( + const immediate_executor_type & e, + U && u); + + +This constructor is only valid if the type `T` is constructible from type `U`. + + +[endsect] + + + +[section:overload2 immediate_executor_binder::immediate_executor_binder (2 of 9 overloads)] + + +Copy constructor. + + + immediate_executor_binder( + const immediate_executor_binder & other); + + + +[endsect] + + + +[section:overload3 immediate_executor_binder::immediate_executor_binder (3 of 9 overloads)] + + +Construct a copy, but specify a different immediate executor. + + + immediate_executor_binder( + const immediate_executor_type & e, + const immediate_executor_binder & other); + + + +[endsect] + + + +[section:overload4 immediate_executor_binder::immediate_executor_binder (4 of 9 overloads)] + + +Construct a copy of a different immediate executor wrapper type. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + immediate_executor_binder( + const immediate_executor_binder< U, OtherExecutor > & other); + + +This constructor is only valid if the `Executor` type is constructible from type `OtherExecutor`, and the type `T` is constructible from type `U`. + + +[endsect] + + + +[section:overload5 immediate_executor_binder::immediate_executor_binder (5 of 9 overloads)] + + +Construct a copy of a different immediate executor wrapper type, but specify a different immediate executor. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + immediate_executor_binder( + const immediate_executor_type & e, + const immediate_executor_binder< U, OtherExecutor > & other); + + +This constructor is only valid if the type `T` is constructible from type `U`. + + +[endsect] + + + +[section:overload6 immediate_executor_binder::immediate_executor_binder (6 of 9 overloads)] + + +Move constructor. + + + immediate_executor_binder( + immediate_executor_binder && other); + + + +[endsect] + + + +[section:overload7 immediate_executor_binder::immediate_executor_binder (7 of 9 overloads)] + + +Move construct the target object, but specify a different immediate executor. + + + immediate_executor_binder( + const immediate_executor_type & e, + immediate_executor_binder && other); + + + +[endsect] + + + +[section:overload8 immediate_executor_binder::immediate_executor_binder (8 of 9 overloads)] + + +Move construct from a different immediate executor wrapper type. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + immediate_executor_binder( + immediate_executor_binder< U, OtherExecutor > && other); + + + +[endsect] + + + +[section:overload9 immediate_executor_binder::immediate_executor_binder (9 of 9 overloads)] + + +Move construct from a different immediate executor wrapper type, but specify a different immediate executor. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + immediate_executor_binder( + const immediate_executor_type & e, + immediate_executor_binder< U, OtherExecutor > && other); + + + +[endsect] + + +[endsect] + + +[section:immediate_executor_type immediate_executor_binder::immediate_executor_type] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.immediate_executor_type..immediate_executor_type..immediate_executor_binder] +The type of the associated immediate executor. + + + typedef Executor immediate_executor_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + +[section:operator_lp__rp_ immediate_executor_binder::operator()] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.operator_lp__rp_..operator()..immediate_executor_binder] + + template< + typename... Args> + auto ``[link boost_asio.reference.immediate_executor_binder.operator_lp__rp_.overload1 operator()]``( + Args && ...); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.operator_lp__rp_.overload1 more...]]`` + + template< + typename... Args> + auto ``[link boost_asio.reference.immediate_executor_binder.operator_lp__rp_.overload2 operator()]``( + Args && ...) const; + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.operator_lp__rp_.overload2 more...]]`` + + +[section:overload1 immediate_executor_binder::operator() (1 of 2 overloads)] + + + + template< + typename... Args> + auto operator()( + Args && ...); + + + +[endsect] + + + +[section:overload2 immediate_executor_binder::operator() (2 of 2 overloads)] + + + + template< + typename... Args> + auto operator()( + Args && ...) const; + + + +[endsect] + + +[endsect] + + +[section:result_type immediate_executor_binder::result_type] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.result_type..result_type..immediate_executor_binder] +The return type if a function. + + + typedef see_below result_type; + + + +The type of `result_type` is based on the type `T` of the wrapper's target object: + + +* if `T` is a pointer to function type, `result_type` is a synonym for the return type of `T`; + + +* if `T` is a class type with a member type `result_type`, then `result_type` is a synonym for `T::result_type`; + + +* otherwise `result_type` is not defined. + + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:second_argument_type immediate_executor_binder::second_argument_type] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.second_argument_type..second_argument_type..immediate_executor_binder] +The type of the function's second argument. + + + typedef see_below second_argument_type; + + + +The type of `second_argument_type` is based on the type `T` of the wrapper's target object: + + +* if `T` is a pointer to a function type accepting two arguments, `second_argument_type` is a synonym for the return type of `T`; + + +* if `T` is a class type with a member type `first_argument_type`, then `second_argument_type` is a synonym for `T::second_argument_type`; + + +* otherwise `second_argument_type` is not defined. + + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:target_type immediate_executor_binder::target_type] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.target_type..target_type..immediate_executor_binder] +The type of the target object. + + + typedef T target_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:_immediate_executor_binder immediate_executor_binder::~immediate_executor_binder] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder._immediate_executor_binder..~immediate_executor_binder..immediate_executor_binder] +Destructor. + + + ~immediate_executor_binder(); + + + +[endsect] + + + +[endsect] + [section:invalid_service_owner invalid_service_owner] [indexterm1 boost_asio.indexterm.invalid_service_owner..invalid_service_owner] @@ -129558,7 +132688,1085 @@ The [link boost_asio.reference.local__basic_endpoint `local::basic_endpoint`] cl [heading Requirements] -['Header: ][^boost/asio/local/datagram_protocol.hpp] +['Header: ][^boost/asio/local/datagram_protocol.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:family local::datagram_protocol::family] + +[indexterm2 boost_asio.indexterm.local__datagram_protocol.family..family..local::datagram_protocol] +Obtain an identifier for the protocol family. + + + int family() const; + + + +[endsect] + + + +[section:protocol local::datagram_protocol::protocol] + +[indexterm2 boost_asio.indexterm.local__datagram_protocol.protocol..protocol..local::datagram_protocol] +Obtain an identifier for the protocol. + + + int protocol() const; + + + +[endsect] + + + +[section:socket local::datagram_protocol::socket] + +[indexterm2 boost_asio.indexterm.local__datagram_protocol.socket..socket..local::datagram_protocol] +The UNIX domain socket type. + + + typedef basic_datagram_socket< datagram_protocol > socket; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.basic_datagram_socket__rebind_executor [*rebind_executor]]] + [Rebinds the socket type to another executor. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]] + [Socket option to permit sending of broadcast messages. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.bytes_readable [*bytes_readable]]] + [IO control command to get the amount of data that can be read without blocking. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.debug [*debug]]] + [Socket option to enable socket-level debugging. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.do_not_route [*do_not_route]]] + [Socket option to prevent routing, use local interfaces only. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.enable_connection_aborted [*enable_connection_aborted]]] + [Socket option to report aborted connections on accept. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.endpoint_type [*endpoint_type]]] + [The endpoint type. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.keep_alive [*keep_alive]]] + [Socket option to send keep-alives. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.linger [*linger]]] + [Socket option to specify whether the socket lingers on close if unsent data is present. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.lowest_layer_type [*lowest_layer_type]]] + [A basic_socket is always the lowest layer. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.message_flags [*message_flags]]] + [Bitmask type for flags that can be passed to send and receive operations. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.native_handle_type [*native_handle_type]]] + [The native representation of a socket. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.out_of_band_inline [*out_of_band_inline]]] + [Socket option for putting received out-of-band data inline. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]] + [The protocol type. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.receive_buffer_size [*receive_buffer_size]]] + [Socket option for the receive buffer size of a socket. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.receive_low_watermark [*receive_low_watermark]]] + [Socket option for the receive low watermark. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.reuse_address [*reuse_address]]] + [Socket option to allow the socket to be bound to an address that is already in use. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]] + [Socket option for the send buffer size of a socket. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]] + [Socket option for the send low watermark. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]] + [Different ways a socket may be shutdown. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.basic_datagram_socket.assign [*assign]]] + [Assign an existing native socket to the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.async_connect [*async_connect]]] + [Start an asynchronous connect. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.async_receive [*async_receive]]] + [Start an asynchronous receive on a connected socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.async_receive_from [*async_receive_from]]] + [Start an asynchronous receive. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.async_send [*async_send]]] + [Start an asynchronous send on a connected socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.async_send_to [*async_send_to]]] + [Start an asynchronous send. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.async_wait [*async_wait]]] + [Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.at_mark [*at_mark]]] + [Determine whether the socket is at the out-of-band data mark. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.available [*available]]] + [Determine the number of bytes available for reading. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.basic_datagram_socket [*basic_datagram_socket]] [constructor]] + [Construct a basic_datagram_socket without opening it. + [hr] + Construct and open a basic_datagram_socket. + [hr] + Construct a basic_datagram_socket, opening it and binding it to the given local endpoint. + [hr] + Construct a basic_datagram_socket on an existing native socket. + [hr] + Move-construct a basic_datagram_socket from another. + [hr] + Move-construct a basic_datagram_socket from a socket of another protocol type. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.bind [*bind]]] + [Bind the socket to the given local endpoint. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.cancel [*cancel]]] + [Cancel all asynchronous operations associated with the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.close [*close]]] + [Close the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.connect [*connect]]] + [Connect the socket to the specified endpoint. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.get_option [*get_option]]] + [Get an option from the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.io_control [*io_control]]] + [Perform an IO control command on the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.is_open [*is_open]]] + [Determine whether the socket is open. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.local_endpoint [*local_endpoint]]] + [Get the local endpoint of the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.lowest_layer [*lowest_layer]]] + [Get a reference to the lowest layer. + [hr] + Get a const reference to the lowest layer. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.native_handle [*native_handle]]] + [Get the native socket representation. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.native_non_blocking [*native_non_blocking]]] + [Gets the non-blocking mode of the native socket implementation. + [hr] + Sets the non-blocking mode of the native socket implementation. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.non_blocking [*non_blocking]]] + [Gets the non-blocking mode of the socket. + [hr] + Sets the non-blocking mode of the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.open [*open]]] + [Open the socket using the specified protocol. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.operator_eq_ [*operator=]]] + [Move-assign a basic_datagram_socket from another. + [hr] + Move-assign a basic_datagram_socket from a socket of another protocol type. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.receive [*receive]]] + [Receive some data on a connected socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.receive_from [*receive_from]]] + [Receive a datagram with the endpoint of the sender. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.release [*release]]] + [Release ownership of the underlying native socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.remote_endpoint [*remote_endpoint]]] + [Get the remote endpoint of the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.send [*send]]] + [Send some data on a connected socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.send_to [*send_to]]] + [Send a datagram to the specified endpoint. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.set_option [*set_option]]] + [Set an option on the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.shutdown [*shutdown]]] + [Disable sends or receives on the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket._basic_datagram_socket [*~basic_datagram_socket]] [destructor]] + [Destroys the socket. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.basic_datagram_socket.max_connections [*max_connections]] [static]] + [(Deprecated: Use max_listen_connections.) The maximum length of the queue of pending incoming connections. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.max_listen_connections [*max_listen_connections]] [static]] + [The maximum length of the queue of pending incoming connections. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.message_do_not_route [*message_do_not_route]] [static]] + [Specify that the data should not be subject to routing. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.message_end_of_record [*message_end_of_record]] [static]] + [Specifies that the data marks the end of a record. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.message_out_of_band [*message_out_of_band]] [static]] + [Process out-of-band data. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.message_peek [*message_peek]] [static]] + [Peek at incoming data without removing it from the input queue. ] + ] + +] + +The [link boost_asio.reference.basic_datagram_socket `basic_datagram_socket`] class template provides asynchronous and blocking datagram-oriented socket functionality. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + +Synchronous `send`, `send_to`, `receive`, `receive_from`, `connect`, and `shutdown` operations are thread safe with respect to each other, if the underlying operating system calls are also thread safe. This means that it is permitted to perform concurrent calls to these synchronous operations on a single socket object. Other synchronous operations, such as `open` or `close`, are not thread safe. + + +[heading Requirements] + +['Header: ][^boost/asio/local/datagram_protocol.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:type local::datagram_protocol::type] + +[indexterm2 boost_asio.indexterm.local__datagram_protocol.type..type..local::datagram_protocol] +Obtain an identifier for the type of the protocol. + + + int type() const; + + + +[endsect] + + + +[endsect] + +[section:local__seq_packet_protocol local::seq_packet_protocol] + +[indexterm1 boost_asio.indexterm.local__seq_packet_protocol..local::seq_packet_protocol] + + +Encapsulates the flags needed for seq\_packet UNIX sockets. + + + class seq_packet_protocol + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.local__seq_packet_protocol.acceptor [*acceptor]]] + [The UNIX domain acceptor type. ] + + ] + + [ + + [[link boost_asio.reference.local__seq_packet_protocol.endpoint [*endpoint]]] + [The type of a UNIX domain endpoint. ] + + ] + + [ + + [[link boost_asio.reference.local__seq_packet_protocol.socket [*socket]]] + [The UNIX domain socket type. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.local__seq_packet_protocol.family [*family]]] + [Obtain an identifier for the protocol family. ] + ] + + [ + [[link boost_asio.reference.local__seq_packet_protocol.protocol [*protocol]]] + [Obtain an identifier for the protocol. ] + ] + + [ + [[link boost_asio.reference.local__seq_packet_protocol.type [*type]]] + [Obtain an identifier for the type of the protocol. ] + ] + +] + +The [link boost_asio.reference.local__seq_packet_protocol `local::seq_packet_protocol`] class contains flags necessary for sequenced packet UNIX domain sockets. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Safe. + + + + +[heading Requirements] + +['Header: ][^boost/asio/local/seq_packet_protocol.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:acceptor local::seq_packet_protocol::acceptor] + +[indexterm2 boost_asio.indexterm.local__seq_packet_protocol.acceptor..acceptor..local::seq_packet_protocol] +The UNIX domain acceptor type. + + + typedef basic_socket_acceptor< seq_packet_protocol > acceptor; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.basic_socket_acceptor__rebind_executor [*rebind_executor]]] + [Rebinds the acceptor type to another executor. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]] + [Socket option to permit sending of broadcast messages. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.bytes_readable [*bytes_readable]]] + [IO control command to get the amount of data that can be read without blocking. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.debug [*debug]]] + [Socket option to enable socket-level debugging. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.do_not_route [*do_not_route]]] + [Socket option to prevent routing, use local interfaces only. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.enable_connection_aborted [*enable_connection_aborted]]] + [Socket option to report aborted connections on accept. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.endpoint_type [*endpoint_type]]] + [The endpoint type. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.keep_alive [*keep_alive]]] + [Socket option to send keep-alives. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]] + [Socket option to specify whether the socket lingers on close if unsent data is present. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.message_flags [*message_flags]]] + [Bitmask type for flags that can be passed to send and receive operations. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.native_handle_type [*native_handle_type]]] + [The native representation of an acceptor. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.out_of_band_inline [*out_of_band_inline]]] + [Socket option for putting received out-of-band data inline. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]] + [The protocol type. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]] + [Socket option for the receive buffer size of a socket. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]] + [Socket option for the receive low watermark. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.reuse_address [*reuse_address]]] + [Socket option to allow the socket to be bound to an address that is already in use. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.send_buffer_size [*send_buffer_size]]] + [Socket option for the send buffer size of a socket. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]] + [Socket option for the send low watermark. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]] + [Different ways a socket may be shutdown. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.wait_type [*wait_type]]] + [Wait types. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]] + [Accept a new connection. + [hr] + Accept a new connection and obtain the endpoint of the peer. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.assign [*assign]]] + [Assigns an existing native acceptor to the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.async_accept [*async_accept]]] + [Start an asynchronous accept. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.async_wait [*async_wait]]] + [Asynchronously wait for the acceptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor [*basic_socket_acceptor]] [constructor]] + [Construct an acceptor without opening it. + [hr] + Construct an open acceptor. + [hr] + Construct an acceptor opened on the given endpoint. + [hr] + Construct a basic_socket_acceptor on an existing native acceptor. + [hr] + Move-construct a basic_socket_acceptor from another. + [hr] + Move-construct a basic_socket_acceptor from an acceptor of another protocol type. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.bind [*bind]]] + [Bind the acceptor to the given local endpoint. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.cancel [*cancel]]] + [Cancel all asynchronous operations associated with the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.close [*close]]] + [Close the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.get_option [*get_option]]] + [Get an option from the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.io_control [*io_control]]] + [Perform an IO control command on the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.is_open [*is_open]]] + [Determine whether the acceptor is open. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.listen [*listen]]] + [Place the acceptor into the state where it will listen for new connections. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.local_endpoint [*local_endpoint]]] + [Get the local endpoint of the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.native_handle [*native_handle]]] + [Get the native acceptor representation. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.native_non_blocking [*native_non_blocking]]] + [Gets the non-blocking mode of the native acceptor implementation. + [hr] + Sets the non-blocking mode of the native acceptor implementation. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.non_blocking [*non_blocking]]] + [Gets the non-blocking mode of the acceptor. + [hr] + Sets the non-blocking mode of the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.open [*open]]] + [Open the acceptor using the specified protocol. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.operator_eq_ [*operator=]]] + [Move-assign a basic_socket_acceptor from another. + [hr] + Move-assign a basic_socket_acceptor from an acceptor of another protocol type. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.release [*release]]] + [Release ownership of the underlying native acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.set_option [*set_option]]] + [Set an option on the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.wait [*wait]]] + [Wait for the acceptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor._basic_socket_acceptor [*~basic_socket_acceptor]] [destructor]] + [Destroys the acceptor. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]] [static]] + [(Deprecated: Use max_listen_connections.) The maximum length of the queue of pending incoming connections. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.max_listen_connections [*max_listen_connections]] [static]] + [The maximum length of the queue of pending incoming connections. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.message_do_not_route [*message_do_not_route]] [static]] + [Specify that the data should not be subject to routing. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.message_end_of_record [*message_end_of_record]] [static]] + [Specifies that the data marks the end of a record. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]] [static]] + [Process out-of-band data. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]] [static]] + [Peek at incoming data without removing it from the input queue. ] + ] + +] + +The [link boost_asio.reference.basic_socket_acceptor `basic_socket_acceptor`] class template is used for accepting new socket connections. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + +Synchronous `accept` operations are thread safe, if the underlying operating system calls are also thread safe. This means that it is permitted to perform concurrent calls to synchronous `accept` operations on a single socket object. Other synchronous operations, such as `open` or `close`, are not thread safe. + + +[heading Example] + +Opening a socket acceptor with the SO\_REUSEADDR option enabled: + + boost::asio::ip::tcp::acceptor acceptor(my_context); + boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port); + acceptor.open(endpoint.protocol()); + acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); + acceptor.bind(endpoint); + acceptor.listen(); + + + + + + + +[heading Requirements] + +['Header: ][^boost/asio/local/seq_packet_protocol.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:endpoint local::seq_packet_protocol::endpoint] + +[indexterm2 boost_asio.indexterm.local__seq_packet_protocol.endpoint..endpoint..local::seq_packet_protocol] +The type of a UNIX domain endpoint. + + + typedef basic_endpoint< seq_packet_protocol > endpoint; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.local__basic_endpoint.data_type [*data_type]]] + [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ] + + ] + + [ + + [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]] + [The protocol type associated with the endpoint. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]] [constructor]] + [Default constructor. + [hr] + Construct an endpoint using the specified path name. + [hr] + Copy constructor. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.capacity [*capacity]]] + [Get the capacity of the endpoint in the native type. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.data [*data]]] + [Get the underlying endpoint in the native type. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]] + [Assign from another endpoint. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.path [*path]]] + [Get the path associated with the endpoint. + [hr] + Set the path associated with the endpoint. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.protocol [*protocol]]] + [The protocol associated with the endpoint. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.resize [*resize]]] + [Set the underlying size of the endpoint in the native type. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.size [*size]]] + [Get the underlying size of the endpoint in the native type. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_not__eq_ [*operator!=]]] + [Compare two endpoints for inequality. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_lt_ [*operator<]]] + [Compare endpoints for ordering. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_lt__eq_ [*operator<=]]] + [Compare endpoints for ordering. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_eq__eq_ [*operator==]]] + [Compare two endpoints for equality. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_gt_ [*operator>]]] + [Compare endpoints for ordering. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_gt__eq_ [*operator>=]]] + [Compare endpoints for ordering. ] + ] + +] + +[heading Related Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]] + [Output an endpoint as a string. ] + ] + +] + +The [link boost_asio.reference.local__basic_endpoint `local::basic_endpoint`] class template describes an endpoint that may be associated with a particular UNIX socket. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + + +[heading Requirements] + +['Header: ][^boost/asio/local/seq_packet_protocol.hpp] ['Convenience header: ][^boost/asio.hpp] @@ -129567,9 +133775,9 @@ The [link boost_asio.reference.local__basic_endpoint `local::basic_endpoint`] cl -[section:family local::datagram_protocol::family] +[section:family local::seq_packet_protocol::family] -[indexterm2 boost_asio.indexterm.local__datagram_protocol.family..family..local::datagram_protocol] +[indexterm2 boost_asio.indexterm.local__seq_packet_protocol.family..family..local::seq_packet_protocol] Obtain an identifier for the protocol family. @@ -129581,9 +133789,9 @@ Obtain an identifier for the protocol family. -[section:protocol local::datagram_protocol::protocol] +[section:protocol local::seq_packet_protocol::protocol] -[indexterm2 boost_asio.indexterm.local__datagram_protocol.protocol..protocol..local::datagram_protocol] +[indexterm2 boost_asio.indexterm.local__seq_packet_protocol.protocol..protocol..local::seq_packet_protocol] Obtain an identifier for the protocol. @@ -129595,13 +133803,13 @@ Obtain an identifier for the protocol. -[section:socket local::datagram_protocol::socket] +[section:socket local::seq_packet_protocol::socket] -[indexterm2 boost_asio.indexterm.local__datagram_protocol.socket..socket..local::datagram_protocol] +[indexterm2 boost_asio.indexterm.local__seq_packet_protocol.socket..socket..local::seq_packet_protocol] The UNIX domain socket type. - typedef basic_datagram_socket< datagram_protocol > socket; + typedef basic_seq_packet_socket< seq_packet_protocol > socket; [heading Types] @@ -129610,154 +133818,154 @@ The UNIX domain socket type. [ - [[link boost_asio.reference.basic_datagram_socket__rebind_executor [*rebind_executor]]] + [[link boost_asio.reference.basic_seq_packet_socket__rebind_executor [*rebind_executor]]] [Rebinds the socket type to another executor. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]] + [[link boost_asio.reference.basic_seq_packet_socket.broadcast [*broadcast]]] [Socket option to permit sending of broadcast messages. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.bytes_readable [*bytes_readable]]] + [[link boost_asio.reference.basic_seq_packet_socket.bytes_readable [*bytes_readable]]] [IO control command to get the amount of data that can be read without blocking. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.debug [*debug]]] + [[link boost_asio.reference.basic_seq_packet_socket.debug [*debug]]] [Socket option to enable socket-level debugging. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.do_not_route [*do_not_route]]] + [[link boost_asio.reference.basic_seq_packet_socket.do_not_route [*do_not_route]]] [Socket option to prevent routing, use local interfaces only. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.enable_connection_aborted [*enable_connection_aborted]]] + [[link boost_asio.reference.basic_seq_packet_socket.enable_connection_aborted [*enable_connection_aborted]]] [Socket option to report aborted connections on accept. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.endpoint_type [*endpoint_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.endpoint_type [*endpoint_type]]] [The endpoint type. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.executor_type [*executor_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.executor_type [*executor_type]]] [The type of the executor associated with the object. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.keep_alive [*keep_alive]]] + [[link boost_asio.reference.basic_seq_packet_socket.keep_alive [*keep_alive]]] [Socket option to send keep-alives. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.linger [*linger]]] + [[link boost_asio.reference.basic_seq_packet_socket.linger [*linger]]] [Socket option to specify whether the socket lingers on close if unsent data is present. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.lowest_layer_type [*lowest_layer_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.lowest_layer_type [*lowest_layer_type]]] [A basic_socket is always the lowest layer. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.message_flags [*message_flags]]] + [[link boost_asio.reference.basic_seq_packet_socket.message_flags [*message_flags]]] [Bitmask type for flags that can be passed to send and receive operations. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.native_handle_type [*native_handle_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.native_handle_type [*native_handle_type]]] [The native representation of a socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.out_of_band_inline [*out_of_band_inline]]] + [[link boost_asio.reference.basic_seq_packet_socket.out_of_band_inline [*out_of_band_inline]]] [Socket option for putting received out-of-band data inline. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.protocol_type [*protocol_type]]] [The protocol type. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.receive_buffer_size [*receive_buffer_size]]] + [[link boost_asio.reference.basic_seq_packet_socket.receive_buffer_size [*receive_buffer_size]]] [Socket option for the receive buffer size of a socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.receive_low_watermark [*receive_low_watermark]]] + [[link boost_asio.reference.basic_seq_packet_socket.receive_low_watermark [*receive_low_watermark]]] [Socket option for the receive low watermark. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.reuse_address [*reuse_address]]] + [[link boost_asio.reference.basic_seq_packet_socket.reuse_address [*reuse_address]]] [Socket option to allow the socket to be bound to an address that is already in use. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]] + [[link boost_asio.reference.basic_seq_packet_socket.send_buffer_size [*send_buffer_size]]] [Socket option for the send buffer size of a socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]] + [[link boost_asio.reference.basic_seq_packet_socket.send_low_watermark [*send_low_watermark]]] [Socket option for the send low watermark. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.shutdown_type [*shutdown_type]]] [Different ways a socket may be shutdown. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.wait_type [*wait_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.wait_type [*wait_type]]] [Wait types. ] ] @@ -129769,195 +133977,177 @@ The UNIX domain socket type. [[Name][Description]] [ - [[link boost_asio.reference.basic_datagram_socket.assign [*assign]]] + [[link boost_asio.reference.basic_seq_packet_socket.assign [*assign]]] [Assign an existing native socket to the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.async_connect [*async_connect]]] + [[link boost_asio.reference.basic_seq_packet_socket.async_connect [*async_connect]]] [Start an asynchronous connect. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.async_receive [*async_receive]]] - [Start an asynchronous receive on a connected socket. ] - ] - - [ - [[link boost_asio.reference.basic_datagram_socket.async_receive_from [*async_receive_from]]] + [[link boost_asio.reference.basic_seq_packet_socket.async_receive [*async_receive]]] [Start an asynchronous receive. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.async_send [*async_send]]] - [Start an asynchronous send on a connected socket. ] - ] - - [ - [[link boost_asio.reference.basic_datagram_socket.async_send_to [*async_send_to]]] + [[link boost_asio.reference.basic_seq_packet_socket.async_send [*async_send]]] [Start an asynchronous send. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.async_wait [*async_wait]]] + [[link boost_asio.reference.basic_seq_packet_socket.async_wait [*async_wait]]] [Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.at_mark [*at_mark]]] + [[link boost_asio.reference.basic_seq_packet_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.available [*available]]] + [[link boost_asio.reference.basic_seq_packet_socket.available [*available]]] [Determine the number of bytes available for reading. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.basic_datagram_socket [*basic_datagram_socket]] [constructor]] - [Construct a basic_datagram_socket without opening it. + [[link boost_asio.reference.basic_seq_packet_socket.basic_seq_packet_socket [*basic_seq_packet_socket]] [constructor]] + [Construct a basic_seq_packet_socket without opening it. [hr] - Construct and open a basic_datagram_socket. + Construct and open a basic_seq_packet_socket. [hr] - Construct a basic_datagram_socket, opening it and binding it to the given local endpoint. + Construct a basic_seq_packet_socket, opening it and binding it to the given local endpoint. [hr] - Construct a basic_datagram_socket on an existing native socket. + Construct a basic_seq_packet_socket on an existing native socket. [hr] - Move-construct a basic_datagram_socket from another. + Move-construct a basic_seq_packet_socket from another. [hr] - Move-construct a basic_datagram_socket from a socket of another protocol type. ] + Move-construct a basic_seq_packet_socket from a socket of another protocol type. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.bind [*bind]]] + [[link boost_asio.reference.basic_seq_packet_socket.bind [*bind]]] [Bind the socket to the given local endpoint. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.cancel [*cancel]]] + [[link boost_asio.reference.basic_seq_packet_socket.cancel [*cancel]]] [Cancel all asynchronous operations associated with the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.close [*close]]] + [[link boost_asio.reference.basic_seq_packet_socket.close [*close]]] [Close the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.connect [*connect]]] + [[link boost_asio.reference.basic_seq_packet_socket.connect [*connect]]] [Connect the socket to the specified endpoint. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.get_executor [*get_executor]]] + [[link boost_asio.reference.basic_seq_packet_socket.get_executor [*get_executor]]] [Get the executor associated with the object. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.get_option [*get_option]]] + [[link boost_asio.reference.basic_seq_packet_socket.get_option [*get_option]]] [Get an option from the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.io_control [*io_control]]] + [[link boost_asio.reference.basic_seq_packet_socket.io_control [*io_control]]] [Perform an IO control command on the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.is_open [*is_open]]] + [[link boost_asio.reference.basic_seq_packet_socket.is_open [*is_open]]] [Determine whether the socket is open. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.local_endpoint [*local_endpoint]]] + [[link boost_asio.reference.basic_seq_packet_socket.local_endpoint [*local_endpoint]]] [Get the local endpoint of the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.lowest_layer [*lowest_layer]]] + [[link boost_asio.reference.basic_seq_packet_socket.lowest_layer [*lowest_layer]]] [Get a reference to the lowest layer. [hr] Get a const reference to the lowest layer. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.native_handle [*native_handle]]] + [[link boost_asio.reference.basic_seq_packet_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.native_non_blocking [*native_non_blocking]]] + [[link boost_asio.reference.basic_seq_packet_socket.native_non_blocking [*native_non_blocking]]] [Gets the non-blocking mode of the native socket implementation. [hr] Sets the non-blocking mode of the native socket implementation. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.non_blocking [*non_blocking]]] + [[link boost_asio.reference.basic_seq_packet_socket.non_blocking [*non_blocking]]] [Gets the non-blocking mode of the socket. [hr] Sets the non-blocking mode of the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.open [*open]]] + [[link boost_asio.reference.basic_seq_packet_socket.open [*open]]] [Open the socket using the specified protocol. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.operator_eq_ [*operator=]]] - [Move-assign a basic_datagram_socket from another. + [[link boost_asio.reference.basic_seq_packet_socket.operator_eq_ [*operator=]]] + [Move-assign a basic_seq_packet_socket from another. [hr] - Move-assign a basic_datagram_socket from a socket of another protocol type. ] - ] - - [ - [[link boost_asio.reference.basic_datagram_socket.receive [*receive]]] - [Receive some data on a connected socket. ] + Move-assign a basic_seq_packet_socket from a socket of another protocol type. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.receive_from [*receive_from]]] - [Receive a datagram with the endpoint of the sender. ] + [[link boost_asio.reference.basic_seq_packet_socket.receive [*receive]]] + [Receive some data on the socket. + [hr] + Receive some data on a connected socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.release [*release]]] + [[link boost_asio.reference.basic_seq_packet_socket.release [*release]]] [Release ownership of the underlying native socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.remote_endpoint [*remote_endpoint]]] + [[link boost_asio.reference.basic_seq_packet_socket.remote_endpoint [*remote_endpoint]]] [Get the remote endpoint of the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.send [*send]]] - [Send some data on a connected socket. ] - ] - - [ - [[link boost_asio.reference.basic_datagram_socket.send_to [*send_to]]] - [Send a datagram to the specified endpoint. ] + [[link boost_asio.reference.basic_seq_packet_socket.send [*send]]] + [Send some data on the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.set_option [*set_option]]] + [[link boost_asio.reference.basic_seq_packet_socket.set_option [*set_option]]] [Set an option on the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.shutdown [*shutdown]]] + [[link boost_asio.reference.basic_seq_packet_socket.shutdown [*shutdown]]] [Disable sends or receives on the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.wait [*wait]]] + [[link boost_asio.reference.basic_seq_packet_socket.wait [*wait]]] [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] ] [ - [[link boost_asio.reference.basic_datagram_socket._basic_datagram_socket [*~basic_datagram_socket]] [destructor]] + [[link boost_asio.reference.basic_seq_packet_socket._basic_seq_packet_socket [*~basic_seq_packet_socket]] [destructor]] [Destroys the socket. ] ] @@ -129968,38 +134158,38 @@ The UNIX domain socket type. [[Name][Description]] [ - [[link boost_asio.reference.basic_datagram_socket.max_connections [*max_connections]] [static]] + [[link boost_asio.reference.basic_seq_packet_socket.max_connections [*max_connections]] [static]] [(Deprecated: Use max_listen_connections.) The maximum length of the queue of pending incoming connections. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.max_listen_connections [*max_listen_connections]] [static]] + [[link boost_asio.reference.basic_seq_packet_socket.max_listen_connections [*max_listen_connections]] [static]] [The maximum length of the queue of pending incoming connections. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.message_do_not_route [*message_do_not_route]] [static]] + [[link boost_asio.reference.basic_seq_packet_socket.message_do_not_route [*message_do_not_route]] [static]] [Specify that the data should not be subject to routing. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.message_end_of_record [*message_end_of_record]] [static]] + [[link boost_asio.reference.basic_seq_packet_socket.message_end_of_record [*message_end_of_record]] [static]] [Specifies that the data marks the end of a record. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.message_out_of_band [*message_out_of_band]] [static]] + [[link boost_asio.reference.basic_seq_packet_socket.message_out_of_band [*message_out_of_band]] [static]] [Process out-of-band data. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.message_peek [*message_peek]] [static]] + [[link boost_asio.reference.basic_seq_packet_socket.message_peek [*message_peek]] [static]] [Peek at incoming data without removing it from the input queue. ] ] ] -The [link boost_asio.reference.basic_datagram_socket `basic_datagram_socket`] class template provides asynchronous and blocking datagram-oriented socket functionality. +The [link boost_asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`] class template provides asynchronous and blocking sequenced packet socket functionality. [heading Thread Safety] @@ -130008,12 +134198,12 @@ The [link boost_asio.reference.basic_datagram_socket `basic_datagram_socket`] cl ['Shared] ['objects:] Unsafe. -Synchronous `send`, `send_to`, `receive`, `receive_from`, `connect`, and `shutdown` operations are thread safe with respect to each other, if the underlying operating system calls are also thread safe. This means that it is permitted to perform concurrent calls to these synchronous operations on a single socket object. Other synchronous operations, such as `open` or `close`, are not thread safe. +Synchronous `send`, `receive`, `connect`, and `shutdown` operations are thread safe with respect to each other, if the underlying operating system calls are also thread safe. This means that it is permitted to perform concurrent calls to these synchronous operations on a single socket object. Other synchronous operations, such as `open` or `close`, are not thread safe. [heading Requirements] -['Header: ][^boost/asio/local/datagram_protocol.hpp] +['Header: ][^boost/asio/local/seq_packet_protocol.hpp] ['Convenience header: ][^boost/asio.hpp] @@ -130022,9 +134212,9 @@ Synchronous `send`, `send_to`, `receive`, `receive_from`, `connect`, and `shutdo -[section:type local::datagram_protocol::type] +[section:type local::seq_packet_protocol::type] -[indexterm2 boost_asio.indexterm.local__datagram_protocol.type..type..local::datagram_protocol] +[indexterm2 boost_asio.indexterm.local__seq_packet_protocol.type..type..local::seq_packet_protocol] Obtain an identifier for the type of the protocol. @@ -138060,7 +142250,7 @@ Submits a completion token or function object for execution. ``[link boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link boost_asio.reference.post.overload2 post]``( const Executor & ex, NullaryToken && token = ``[link boost_asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + typename constraint< (execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value >::type = 0); `` [''''»''' [link boost_asio.reference.post.overload2 more...]]`` template< @@ -138195,7 +142385,7 @@ Submits a completion token or function object for execution. ``[link boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` post( const Executor & ex, NullaryToken && token = ``[link boost_asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + typename constraint< (execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value >::type = 0); This function submits an object for execution using the specified executor. The function object is queued for execution, and is never called from the current thread prior to returning from `post()`. @@ -145590,6 +149780,20 @@ Typedef for the typical usage of a signal set. ] + [ + + [[link boost_asio.reference.basic_signal_set.flags [*flags]]] + [Enumeration representing the different types of flags that may specified when adding a signal to a set. ] + + ] + + [ + + [[link boost_asio.reference.basic_signal_set.flags_t [*flags_t]]] + [Portability typedef. ] + + ] + ] [heading Member Functions] @@ -145598,7 +149802,9 @@ Typedef for the typical usage of a signal set. [ [[link boost_asio.reference.basic_signal_set.add [*add]]] - [Add a signal to a signal_set. ] + [Add a signal to a signal_set. + [hr] + Add a signal to a signal_set with the specified flags. ] ] [ @@ -145715,6 +149921,141 @@ POSIX allows signals to be blocked using functions such as `sigprocmask()` and ` [endsect] +[section:signal_set_base signal_set_base] + +[indexterm1 boost_asio.indexterm.signal_set_base..signal_set_base] + + +The [link boost_asio.reference.signal_set_base `signal_set_base`] class is used as a base for the [link boost_asio.reference.basic_signal_set `basic_signal_set`] class templates so that we have a common place to define the flags enum. + + + class signal_set_base + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.signal_set_base.flags [*flags]]] + [Enumeration representing the different types of flags that may specified when adding a signal to a set. ] + + ] + + [ + + [[link boost_asio.reference.signal_set_base.flags_t [*flags_t]]] + [Portability typedef. ] + + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.signal_set_base._signal_set_base [*~signal_set_base]] [destructor]] + [Protected destructor to prevent deletion through this type. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/signal_set_base.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:flags signal_set_base::flags] + +[indexterm2 boost_asio.indexterm.signal_set_base.flags..flags..signal_set_base] +Enumeration representing the different types of flags that may specified when adding a signal to a set. + + enum flags + +[indexterm2 boost_asio.indexterm.signal_set_base.flags.none..none..signal_set_base] +[indexterm2 boost_asio.indexterm.signal_set_base.flags.restart..restart..signal_set_base] +[indexterm2 boost_asio.indexterm.signal_set_base.flags.no_child_stop..no_child_stop..signal_set_base] +[indexterm2 boost_asio.indexterm.signal_set_base.flags.no_child_wait..no_child_wait..signal_set_base] +[indexterm2 boost_asio.indexterm.signal_set_base.flags.dont_care..dont_care..signal_set_base] + +[heading Values] +[variablelist + + [ + [none] + [Bitmask representing no flags. ] + ] + + [ + [restart] + [Affects the behaviour of interruptible functions such that, if the function would have failed with error::interrupted when interrupted by the specified signal, the function shall instead be restarted and not fail with error::interrupted. ] + ] + + [ + [no_child_stop] + [Do not generate SIGCHLD when child processes stop or stopped child processes continue. ] + ] + + [ + [no_child_wait] + [Do not transform child processes into zombies when they terminate. ] + ] + + [ + [dont_care] + [Special value to indicate that the signal registration does not care which flags are set, and so will not conflict with any prior registrations of the same signal. ] + ] + +] + + + +[endsect] + + + +[section:flags_t signal_set_base::flags_t] + +[indexterm2 boost_asio.indexterm.signal_set_base.flags_t..flags_t..signal_set_base] +Portability typedef. + + + typedef flags flags_t; + + + +[heading Requirements] + +['Header: ][^boost/asio/signal_set_base.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:_signal_set_base signal_set_base::~signal_set_base] + +[indexterm2 boost_asio.indexterm.signal_set_base._signal_set_base..~signal_set_base..signal_set_base] +Protected destructor to prevent deletion through this type. + + + ~signal_set_base(); + + + +[endsect] + + + +[endsect] + [section:socket_base socket_base] [indexterm1 boost_asio.indexterm.socket_base..socket_base] @@ -148331,7 +152672,7 @@ Following the move, the following operations only are valid for the moved-from o Implement various bug workarounds. - static const long default_workarounds = implementation_defined; + static const uint64_t default_workarounds = implementation_defined; @@ -148674,7 +153015,7 @@ The native handle type of the SSL context. Disable compression. Compression is disabled by default. - static const long no_compression = implementation_defined; + static const uint64_t no_compression = implementation_defined; @@ -148688,7 +153029,7 @@ Disable compression. Compression is disabled by default. Disable SSL v2. - static const long no_sslv2 = implementation_defined; + static const uint64_t no_sslv2 = implementation_defined; @@ -148702,7 +153043,7 @@ Disable SSL v2. Disable SSL v3. - static const long no_sslv3 = implementation_defined; + static const uint64_t no_sslv3 = implementation_defined; @@ -148716,7 +153057,7 @@ Disable SSL v3. Disable TLS v1. - static const long no_tlsv1 = implementation_defined; + static const uint64_t no_tlsv1 = implementation_defined; @@ -148730,7 +153071,7 @@ Disable TLS v1. Disable TLS v1.1. - static const long no_tlsv1_1 = implementation_defined; + static const uint64_t no_tlsv1_1 = implementation_defined; @@ -148744,7 +153085,7 @@ Disable TLS v1.1. Disable TLS v1.2. - static const long no_tlsv1_2 = implementation_defined; + static const uint64_t no_tlsv1_2 = implementation_defined; @@ -148758,7 +153099,7 @@ Disable TLS v1.2. Disable TLS v1.3. - static const long no_tlsv1_3 = implementation_defined; + static const uint64_t no_tlsv1_3 = implementation_defined; @@ -148811,7 +153152,7 @@ Following the move, the following operations only are valid for the moved-from o Bitmask type for SSL options. - typedef long options; + typedef uint64_t options; @@ -149479,7 +153820,7 @@ Calls `SSL_CTX_set_verify`. Always create a new key when using tmp\_dh parameters. - static const long single_dh_use = implementation_defined; + static const uint64_t single_dh_use = implementation_defined; @@ -150651,7 +154992,7 @@ The [link boost_asio.reference.ssl__context_base `ssl::context_base`] class is u Implement various bug workarounds. - static const long default_workarounds = implementation_defined; + static const uint64_t default_workarounds = implementation_defined; @@ -150859,7 +155200,7 @@ Different methods supported by a context. Disable compression. Compression is disabled by default. - static const long no_compression = implementation_defined; + static const uint64_t no_compression = implementation_defined; @@ -150873,7 +155214,7 @@ Disable compression. Compression is disabled by default. Disable SSL v2. - static const long no_sslv2 = implementation_defined; + static const uint64_t no_sslv2 = implementation_defined; @@ -150887,7 +155228,7 @@ Disable SSL v2. Disable SSL v3. - static const long no_sslv3 = implementation_defined; + static const uint64_t no_sslv3 = implementation_defined; @@ -150901,7 +155242,7 @@ Disable SSL v3. Disable TLS v1. - static const long no_tlsv1 = implementation_defined; + static const uint64_t no_tlsv1 = implementation_defined; @@ -150915,7 +155256,7 @@ Disable TLS v1. Disable TLS v1.1. - static const long no_tlsv1_1 = implementation_defined; + static const uint64_t no_tlsv1_1 = implementation_defined; @@ -150929,7 +155270,7 @@ Disable TLS v1.1. Disable TLS v1.2. - static const long no_tlsv1_2 = implementation_defined; + static const uint64_t no_tlsv1_2 = implementation_defined; @@ -150943,7 +155284,7 @@ Disable TLS v1.2. Disable TLS v1.3. - static const long no_tlsv1_3 = implementation_defined; + static const uint64_t no_tlsv1_3 = implementation_defined; @@ -150957,7 +155298,7 @@ Disable TLS v1.3. Bitmask type for SSL options. - typedef long options; + typedef uint64_t options; @@ -151009,7 +155350,7 @@ Purpose of PEM password. Always create a new key when using tmp\_dh parameters. - static const long single_dh_use = implementation_defined; + static const uint64_t single_dh_use = implementation_defined; diff --git a/doc/reference.xsl b/doc/reference.xsl index c1199f6d24..0cf65dcfd1 100644 --- a/doc/reference.xsl +++ b/doc/reference.xsl @@ -133,7 +133,8 @@ not(contains(compoundname, 'context_impl')) and not(contains(compoundname, 'initiate_')) and not(contains(compoundname, '_adapter')) and - not(contains(compoundname, '_is_deprecated'))"> + not(contains(compoundname, '_is_deprecated')) or + contains(compoundname, 'asio::any_completion_handler')"> @@ -366,6 +367,12 @@ select="concat(substring-before($name, ','), '_comma_', substring-after($name, ','))"/> + + + + + + + + diff --git a/include/boost/asio.hpp b/include/boost/asio.hpp index 0140f6bc72..1d78a75877 100644 --- a/include/boost/asio.hpp +++ b/include/boost/asio.hpp @@ -181,6 +181,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/asio/any_completion_handler.hpp b/include/boost/asio/any_completion_handler.hpp index f5ee378bb2..ae73387ebd 100644 --- a/include/boost/asio/any_completion_handler.hpp +++ b/include/boost/asio/any_completion_handler.hpp @@ -416,6 +416,8 @@ any_completion_handler_fn_table_instance::value; template class any_completion_handler; +/// An allocator type that forwards memory allocation operations through an +/// instance of @c any_completion_handler. template class any_completion_handler_allocator { @@ -437,14 +439,18 @@ class any_completion_handler_allocator } public: + /// The type of objects that may be allocated by the allocator. typedef T value_type; + /// Rebinds an allocator to another value type. template struct rebind { + /// Specifies the type of the rebound allocator. typedef any_completion_handler_allocator other; }; + /// Construct from another @c any_completion_handler_allocator. template constexpr any_completion_handler_allocator( const any_completion_handler_allocator& a) @@ -454,18 +460,21 @@ class any_completion_handler_allocator { } + /// Equality operator. constexpr bool operator==( const any_completion_handler_allocator& other) const BOOST_ASIO_NOEXCEPT { return fn_table_ == other.fn_table_ && impl_ == other.impl_; } + /// Inequality operator. constexpr bool operator!=( const any_completion_handler_allocator& other) const BOOST_ASIO_NOEXCEPT { return fn_table_ != other.fn_table_ || impl_ != other.impl_; } + /// Allocate space for @c n objects of the allocator's value type. T* allocate(std::size_t n) const { return static_cast( @@ -473,12 +482,16 @@ class any_completion_handler_allocator impl_, sizeof(T) * n, alignof(T))); } + /// Deallocate space for @c n objects of the allocator's value type. void deallocate(T* p, std::size_t n) const { fn_table_->deallocate(impl_, p, sizeof(T) * n, alignof(T)); } }; +/// A protoco-allocator type that may be rebound to obtain an allocator that +/// forwards memory allocation operations through an instance of +/// @c any_completion_handler. template class any_completion_handler_allocator { @@ -500,14 +513,18 @@ class any_completion_handler_allocator } public: + /// @c void as no objects can be allocated through a proto-allocator. typedef void value_type; + /// Rebinds an allocator to another value type. template struct rebind { + /// Specifies the type of the rebound allocator. typedef any_completion_handler_allocator other; }; + /// Construct from another @c any_completion_handler_allocator. template constexpr any_completion_handler_allocator( const any_completion_handler_allocator& a) @@ -517,12 +534,14 @@ class any_completion_handler_allocator { } + /// Equality operator. constexpr bool operator==( const any_completion_handler_allocator& other) const BOOST_ASIO_NOEXCEPT { return fn_table_ == other.fn_table_ && impl_ == other.impl_; } + /// Inequality operator. constexpr bool operator!=( const any_completion_handler_allocator& other) const BOOST_ASIO_NOEXCEPT { @@ -530,9 +549,27 @@ class any_completion_handler_allocator } }; +/// Polymorphic wrapper for completion handlers. +/** + * The @c any_completion_handler class template is a polymorphic wrapper for + * completion handlers that propagates the associated executor, associated + * allocator, and associated cancellation slot through a type-erasing interface. + * + * When using @c any_completion_handler, specify one or more completion + * signatures as template parameters. These will dictate the arguments that may + * be passed to the handler through the polymorphic interface. + * + * Typical uses for @c any_completion_handler include: + * + * @li Separate compilation of asynchronous operation implementations. + * + * @li Enabling interoperability between asynchronous operations and virtual + * functions. + */ template class any_completion_handler { +#if !defined(GENERATING_DOCUMENTATION) private: template friend class any_completion_handler_allocator; @@ -542,25 +579,37 @@ class any_completion_handler const detail::any_completion_handler_fn_table* fn_table_; detail::any_completion_handler_impl_base* impl_; +#endif // !defined(GENERATING_DOCUMENTATION) public: + /// The associated allocator type. using allocator_type = any_completion_handler_allocator; + + /// The associated cancellation slot type. using cancellation_slot_type = cancellation_slot; + /// Construct an @c any_completion_handler in an empty state, without a target + /// object. constexpr any_completion_handler() : fn_table_(nullptr), impl_(nullptr) { } + /// Construct an @c any_completion_handler in an empty state, without a target + /// object. constexpr any_completion_handler(nullptr_t) : fn_table_(nullptr), impl_(nullptr) { } + /// Construct an @c any_completion_handler to contain the specified target. template ::type> - any_completion_handler(H&& h) + any_completion_handler(H&& h, + typename constraint< + !is_same::type, any_completion_handler>::value + >::type = 0) : fn_table_( &detail::any_completion_handler_fn_table_instance< Handler, Signatures...>::value), @@ -569,6 +618,10 @@ class any_completion_handler { } + /// Move-construct an @c any_completion_handler from another. + /** + * After the operation, the moved-from object @c other has no target. + */ any_completion_handler(any_completion_handler&& other) BOOST_ASIO_NOEXCEPT : fn_table_(other.fn_table_), impl_(other.impl_) @@ -577,51 +630,72 @@ class any_completion_handler other.impl_ = nullptr; } + /// Move-assign an @c any_completion_handler from another. + /** + * After the operation, the moved-from object @c other has no target. + */ any_completion_handler& operator=( any_completion_handler&& other) BOOST_ASIO_NOEXCEPT { - any_completion_handler(other).swap(*this); + any_completion_handler( + BOOST_ASIO_MOVE_CAST(any_completion_handler)(other)).swap(*this); return *this; } + /// Assignment operator that sets the polymorphic wrapper to the empty state. any_completion_handler& operator=(nullptr_t) BOOST_ASIO_NOEXCEPT { any_completion_handler().swap(*this); return *this; } + /// Destructor. ~any_completion_handler() { if (impl_) fn_table_->destroy(impl_); } + /// Test if the polymorphic wrapper is empty. constexpr explicit operator bool() const BOOST_ASIO_NOEXCEPT { return impl_ != nullptr; } + /// Test if the polymorphic wrapper is non-empty. constexpr bool operator!() const BOOST_ASIO_NOEXCEPT { return impl_ == nullptr; } + /// Swap the content of an @c any_completion_handler with another. void swap(any_completion_handler& other) BOOST_ASIO_NOEXCEPT { std::swap(fn_table_, other.fn_table_); std::swap(impl_, other.impl_); } + /// Get the associated allocator. allocator_type get_allocator() const BOOST_ASIO_NOEXCEPT { return allocator_type(0, *this); } + /// Get the associated cancellation slot. cancellation_slot_type get_cancellation_slot() const BOOST_ASIO_NOEXCEPT { return impl_->get_cancellation_slot(); } + /// Function call operator. + /** + * Invokes target completion handler with the supplied arguments. + * + * This function may only be called once, as the target handler is moved from. + * The polymorphic wrapper is left in an empty state. + * + * Throws @c std::bad_function_call if the polymorphic wrapper is empty. + */ template auto operator()(Args&&... args) -> decltype(fn_table_->call(impl_, BOOST_ASIO_MOVE_CAST(Args)(args)...)) @@ -635,24 +709,28 @@ class any_completion_handler boost::asio::detail::throw_exception(ex); } + /// Equality operator. friend constexpr bool operator==( const any_completion_handler& a, nullptr_t) BOOST_ASIO_NOEXCEPT { return a.impl_ == nullptr; } + /// Equality operator. friend constexpr bool operator==( nullptr_t, const any_completion_handler& b) BOOST_ASIO_NOEXCEPT { return nullptr == b.impl_; } + /// Inequality operator. friend constexpr bool operator!=( const any_completion_handler& a, nullptr_t) BOOST_ASIO_NOEXCEPT { return a.impl_ != nullptr; } + /// Inequality operator. friend constexpr bool operator!=( nullptr_t, const any_completion_handler& b) BOOST_ASIO_NOEXCEPT { diff --git a/include/boost/asio/associated_executor.hpp b/include/boost/asio/associated_executor.hpp index 8533e521de..4ffc80f9a6 100644 --- a/include/boost/asio/associated_executor.hpp +++ b/include/boost/asio/associated_executor.hpp @@ -173,7 +173,8 @@ get_associated_executor(const T& t, const Executor& ex, * ExecutionContext::executor_type>::get(t, ctx.get_executor()) */ template -BOOST_ASIO_NODISCARD inline typename ExecutionContext::executor_type +BOOST_ASIO_NODISCARD inline typename associated_executor::type get_associated_executor(const T& t, ExecutionContext& ctx, typename constraint::value>::type = 0) BOOST_ASIO_NOEXCEPT diff --git a/include/boost/asio/associated_immediate_executor.hpp b/include/boost/asio/associated_immediate_executor.hpp index 295744e00d..d73d395f75 100644 --- a/include/boost/asio/associated_immediate_executor.hpp +++ b/include/boost/asio/associated_immediate_executor.hpp @@ -222,15 +222,11 @@ get_associated_immediate_executor(const T& t, const Executor& ex, * ExecutionContext::executor_type>::get(t, ctx.get_executor()) */ template -BOOST_ASIO_NODISCARD inline BOOST_ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_immediate_executor::type) +BOOST_ASIO_NODISCARD inline typename associated_immediate_executor::type get_associated_immediate_executor(const T& t, ExecutionContext& ctx, typename constraint::value>::type = 0) BOOST_ASIO_NOEXCEPT - BOOST_ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_immediate_executor::get(t, ctx.get_executor()))) { return associated_immediate_executor::get(t, ctx.get_executor()); diff --git a/include/boost/asio/async_result.hpp b/include/boost/asio/async_result.hpp index 53143d15fd..b23bf4a77a 100644 --- a/include/boost/asio/async_result.hpp +++ b/include/boost/asio/async_result.hpp @@ -1399,6 +1399,42 @@ namespace detail { struct completion_signature_probe {}; +#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) + +template +struct completion_signature_probe_result +{ + template