diff --git a/doc/docca/include/docca/doxygen.xsl b/doc/docca/include/docca/doxygen.xsl index 19e1fd3d..7a428789 100644 --- a/doc/docca/include/docca/doxygen.xsl +++ b/doc/docca/include/docca/doxygen.xsl @@ -203,6 +203,7 @@ + - - - - - - + + + - + + @@ -360,15 +359,16 @@ ] + - - + ``` - - + ``` + [role red error.programlisting] + @@ -408,19 +409,18 @@ + ` ` - ` ` - @@ -483,7 +483,9 @@ [[` `][ - + + + ]] @@ -963,8 +965,8 @@ ``` - + [heading Description] @@ -1250,8 +1252,15 @@ [ - [[link - . + [[link + + + + + . + + + [* ]]] [ @@ -1572,7 +1581,9 @@ - ``` using + ``` + + using = @@ -1583,7 +1594,8 @@ - ; ``` + ; + ``` @@ -1701,7 +1713,7 @@ - + template< @@ -1712,31 +1724,45 @@ + - - - - - - - - - - - + + + class - - + [role red error.class-detail-template.1] + + + + + + + + + + + [role red error.class-detail-template.2] + + + + + + + + + + = + , @@ -1909,11 +1935,15 @@ + + [heading Description] + + diff --git a/doc/qbk/main.qbk b/doc/qbk/main.qbk index e0774a33..7298d6dd 100644 --- a/doc/qbk/main.qbk +++ b/doc/qbk/main.qbk @@ -37,6 +37,10 @@ [def __Asio__ [@boost:/libs/asio/index.html Boost.Asio]] [def __async_initfn__ [@boost:/doc/html/boost_asio/reference/asynchronous_operations.html initiating function]] +[/ C++ Named Requirements ] + +[def __Allocator__ [@https://en.cppreference.com/w/cpp/named_req/Allocator ['Allocator]]] + [/ Networking Identifiers ] [def __asio_handler_allocate__ [@boost:/doc/html/boost_asio/reference/asio_handler_allocate.html `asio_handler_allocate`]] @@ -70,6 +74,8 @@ [def __ConstBufferSequence__ [@boost:/doc/html/boost_asio/reference/ConstBufferSequence.html ['ConstBufferSequence]]] [def __EndpointSequence__ [@boost:/doc/html/boost_asio/reference/EndpointSequence.html ['EndpointSequence]]] [def __Executor__ [@boost:/doc/html/boost_asio/reference/Executor1.html ['Executor]]] +[def __Executor1__ [@boost:/doc/html/boost_asio/reference/Executor1.html ['Executor1]]] +[def __Executor2__ [@boost:/doc/html/boost_asio/reference/Executor1.html ['Executor2]]] [def __ExecutionContext__ [@boost:/doc/html/boost_asio/reference/ExecutionContext.html ['ExecutionContext]]] [def __Handler__ [@boost:/doc/html/boost_asio/reference/Handler.html ['Handler]]] [def __IteratorConnectHandler__ [@boost:/doc/html/boost_asio/reference/IteratorConnectHandler.html ['IteratorConnectHandler]]] diff --git a/doc/qbk/quickref.xml b/doc/qbk/quickref.xml index f15bba79..e79f1cd5 100644 --- a/doc/qbk/quickref.xml +++ b/doc/qbk/quickref.xml @@ -30,22 +30,19 @@ file_posix file_stdio file_win32 - flat_buffer - flat_static_buffer - flat_static_buffer_base flat_stream  handler_ptr iequal iless rate_policy_access  saved_handler  + simple_rate_policy  Classes (2 of 2) span - simple_rate_policy  static_string stable_async_base  string_param @@ -129,17 +126,20 @@ Classes - basic_flat_buffer - basic_multi_buffer - buffered_read_stream - buffers_adaptor - buffers_cat_view - buffers_prefix_view - buffers_suffix - dynamic_buffer_ref_wrapper  - multi_buffer - static_buffer - static_buffer_base + basic_flat_buffer + basic_multi_buffer + buffered_read_stream + buffers_adaptor + buffers_cat_view + buffers_prefix_view + buffers_suffix + dynamic_buffer_ref_wrapper  + flat_buffer + flat_static_buffer + flat_static_buffer_base + multi_buffer + static_buffer + static_buffer_base Functions diff --git a/doc/source.dox b/doc/source.dox index d43103fc..0566da84 100644 --- a/doc/source.dox +++ b/doc/source.dox @@ -1,6 +1,8 @@ #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- +#INPUT = $(LIB_DIR)/include/boost/beast/_experimental/http/icy_stream.hpp + INPUT = \ $(LIB_DIR)/include/boost/beast/ \ $(LIB_DIR)/include/boost/beast/_experimental/http \ @@ -11,6 +13,7 @@ INPUT = \ $(LIB_DIR)/include/boost/beast/websocket \ $(LIB_DIR)/include/boost/beast/zlib +ALIASES += esafe="@par Exception Safety" INPUT_ENCODING = UTF-8 FILE_PATTERNS = @@ -79,7 +82,6 @@ MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 4 -ALIASES = TCL_SUBST = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO diff --git a/doc/xsl/class_detail.xsl b/doc/xsl/class_detail.xsl index 3c51b725..63a91f00 100644 --- a/doc/xsl/class_detail.xsl +++ b/doc/xsl/class_detail.xsl @@ -1,87 +1,36 @@ - - class __AsyncStream__ - - - class __AsyncReadStream__ - - - class __AsyncWriteStream__ - - - class __Body__ - - - class __BufferSequence__ - - - - __BufferSequence__ - - - class __CompletionCondition__ - - - class __CompletionHandler__ - - - class __ConnectCondition__ - - - class __ConnectHandler__ - - - class __ConstBufferSequence__ - - - class __DynamicBuffer__ - - - class __EndpointSequence__ - - - class __ExecutionContext__ - - - class __Executor__ - - - class __Fields__ - - - class __Handler__ - - - class __IteratorConnectHandler__ - - - class __MutableBufferSequence__ - - - class __Protocol__ - - - class __RangeConnectHandler__ - - - class __RatePolicy__ - - - class __ReadHandler__ - - - class __Stream__ - - - class __SyncStream__ - - - class __SyncReadStream__ - - - class __SyncWriteStream__ - - - class __WriteHandler__ - + __Allocator__ + __AsyncStream__ + __AsyncReadStream__ + __AsyncWriteStream__ + __Body__ + __BufferSequence__ + __BufferSequence__ + __CompletionCondition__ + __CompletionHandler__ + __CompletionToken__ + __ConnectCondition__ + __ConnectHandler__ + __ConstBufferSequence__ + __DynamicBuffer__ + __EndpointSequence__ + __ExecutionContext__ + __Executor__ + __Executor__ + __Executor1__ + __Executor2__ + __Fields__ + __Handler__ + __Handler__ + __IteratorConnectHandler__ + __MutableBufferSequence__ + __Protocol__ + __RangeConnectHandler__ + __RatePolicy__ + __ReadHandler__ + __Stream__ + __SyncStream__ + __SyncReadStream__ + __SyncWriteStream__ + __WriteHandler__ diff --git a/example/echo-op/echo_op.cpp b/example/echo-op/echo_op.cpp index 33fcb293..dd7890b7 100644 --- a/example/echo-op/echo_op.cpp +++ b/example/echo-op/echo_op.cpp @@ -61,7 +61,7 @@ async_echo (AsyncStream& stream, DynamicBuffer& buffer, CompletionToken&& token) to provide the implementation with any leftover bytes. @param stream The stream to operate on. The type must meet the - requirements of @b AsyncReadStream and @AsyncWriteStream + requirements of AsyncReadStream and @AsyncWriteStream @param buffer A dynamic buffer to hold implementation-defined temporary data. Ownership is not transferred; the caller is diff --git a/include/boost/beast/_experimental/http/icy_stream.hpp b/include/boost/beast/_experimental/http/icy_stream.hpp index e546bdd0..fce7639d 100644 --- a/include/boost/beast/_experimental/http/icy_stream.hpp +++ b/include/boost/beast/_experimental/http/icy_stream.hpp @@ -39,26 +39,23 @@ namespace http { operations are performed within the same implicit or explicit strand. @par Example - To use the @ref icy_stream template with an @ref tcp_stream you would write: - @code http::icy_stream is(ioc); @endcode @tparam NextLayer The type representing the next layer, to which data will be read and written during operations. For synchronous - operations, the type must support the @b SyncStream concept. + operations, the type must support the SyncStream concept. For asynchronous operations, the type must support the - @b AsyncStream concept. + AsyncStream concept. @note A stream object must not be moved or destroyed while there are pending asynchronous operations associated with it. @par Concepts - @b AsyncStream, - @b SyncStream + AsyncStream, SyncStream */ template class icy_stream @@ -208,12 +205,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - - @code void handler( + @code + void handler( const boost::system::error_code& error, // Result of operation. std::size_t bytes_transferred // Number of bytes read. - ); @endcode - + ); + @endcode Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -288,14 +285,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // Result of operation. std::size_t bytes_transferred // Number of bytes written. ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a diff --git a/include/boost/beast/_experimental/test/handler.hpp b/include/boost/beast/_experimental/test/handler.hpp index ccafa950..59988265 100644 --- a/include/boost/beast/_experimental/test/handler.hpp +++ b/include/boost/beast/_experimental/test/handler.hpp @@ -29,7 +29,7 @@ namespace test { not instantiated directly; instances of this class are returned by the helper functions listed below. - @see @ref success_handler, @ref fail_handler, @ref any_handler + @see success_handler, @ref fail_handler, @ref any_handler */ class handler { diff --git a/include/boost/beast/_experimental/test/stream.hpp b/include/boost/beast/_experimental/test/stream.hpp index 37f7df0f..ea4d53c5 100644 --- a/include/boost/beast/_experimental/test/stream.hpp +++ b/include/boost/beast/_experimental/test/stream.hpp @@ -91,10 +91,10 @@ namespace test { operations are performed within the same implicit or explicit strand. @par Concepts - @li @b SyncReadStream - @li @b SyncWriteStream - @li @b AsyncReadStream - @li @b AsyncWriteStream + @li SyncReadStream + @li SyncWriteStream + @li AsyncReadStream + @li AsyncWriteStream */ class stream { @@ -412,14 +412,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec, // Result of operation. std::size_t bytes_transferred // Number of bytes read. ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -490,14 +488,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec, // Result of operation. std::size_t bytes_transferred // Number of bytes written. ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a diff --git a/include/boost/beast/core/async_base.hpp b/include/boost/beast/core/async_base.hpp index 10c2f3c5..84047e65 100644 --- a/include/boost/beast/core/async_base.hpp +++ b/include/boost/beast/core/async_base.hpp @@ -29,7 +29,7 @@ namespace boost { namespace beast { -/** Base class to provide completion handler boilerplate for composed operations. +/** Base class to assist writing composed operations. A function object submitted to intermediate initiating functions during a composed operation may derive from this type to inherit all of the @@ -169,7 +169,7 @@ namespace beast { not default constructible, an instance of the type must be provided upon construction. - @see @ref stable_async_base + @see stable_async_base */ template< class Handler, @@ -377,43 +377,10 @@ public: } #if ! BOOST_BEAST_DOXYGEN - template< - class Handler_, - class Executor1_, - class Allocator_, - class Function> - friend - void asio_handler_invoke( - Function&& f, - async_base< - Handler_, Executor1_, Allocator_>* p); - - friend - void* asio_handler_allocate( - std::size_t size, async_base* p) + Handler* + get_legacy_handler_pointer() noexcept { - using net::asio_handler_allocate; - return asio_handler_allocate( - size, std::addressof(p->h_)); - } - - friend - void asio_handler_deallocate( - void* mem, std::size_t size, - async_base* p) - { - using net::asio_handler_deallocate; - asio_handler_deallocate(mem, size, - std::addressof(p->h_)); - } - - friend - bool asio_handler_is_continuation( - async_base* p) - { - using net::asio_handler_is_continuation; - return asio_handler_is_continuation( - std::addressof(p->h_)); + return std::addressof(h_); } #endif }; @@ -701,63 +668,19 @@ public: Args&&... args); }; -#if ! BOOST_BEAST_DOXYGEN -template< - class Handler, - class Executor1, - class Allocator, - class Function> -void asio_handler_invoke( - Function&& f, - async_base< - Handler, Executor1, Allocator>* p) -{ - using net::asio_handler_invoke; - asio_handler_invoke( - f, std::addressof(p->h_)); -} -#endif - -namespace detail { - -template -struct allocate_stable_state final - : stable_base - , boost::empty_value -{ - State value; - - template - explicit - allocate_stable_state( - Allocator const& alloc, - Args&&... args) - : boost::empty_value( - boost::empty_init_t{}, alloc) - , value{std::forward(args)...} - { - } - - void destroy() override - { - using A = typename allocator_traits< - Allocator>::template rebind_alloc< - allocate_stable_state>; - - A a(this->get()); - detail::allocator_traits::destroy(a, this); - detail::allocator_traits::deallocate(a, this, 1); - } -}; - -} // detail - /** Allocate a temporary object to hold stable asynchronous operation state. The object will be destroyed just before the completion handler is invoked, or when the base is destroyed. - @see @ref stable_async_base + @tparam State The type of object to allocate. + + @param base The helper to allocate from. + + @param args An optional list of parameters to forward to the + constructor of the object being allocated. + + @see stable_async_base */ template< class State, @@ -769,43 +692,11 @@ State& allocate_stable( stable_async_base< Handler, Executor1, Allocator>& base, - Args&&... args) -{ - using allocator_type = typename stable_async_base< - Handler, Executor1, Allocator>::allocator_type; - - using A = typename detail::allocator_traits< - allocator_type>::template rebind_alloc< - detail::allocate_stable_state< - State, allocator_type>>; - - struct deleter - { - allocator_type alloc; - detail::allocate_stable_state< - State, allocator_type>* ptr; - - ~deleter() - { - if(ptr) - { - A a(alloc); - detail::allocator_traits::deallocate(a, ptr, 1); - } - } - }; - - A a(base.get_allocator()); - deleter d{base.get_allocator(), nullptr}; - d.ptr = detail::allocator_traits::allocate(a, 1); - detail::allocator_traits::construct(a, d.ptr, - d.alloc, std::forward(args)...); - d.ptr->next_ = base.list_; - base.list_ = d.ptr; - return boost::exchange(d.ptr, nullptr)->value; -} + Args&&... args); } // beast } // boost +#include + #endif diff --git a/include/boost/beast/core/basic_stream.hpp b/include/boost/beast/core/basic_stream.hpp index a44fabd8..2f06f48e 100644 --- a/include/boost/beast/core/basic_stream.hpp +++ b/include/boost/beast/core/basic_stream.hpp @@ -516,7 +516,7 @@ public: @throws system_error Thrown on failure. - @see @ref connect + @see connect */ void connect(endpoint_type const& ep) @@ -537,7 +537,7 @@ public: @param ec Set to indicate what error occurred, if any. - @see @ref connect + @see connect */ void connect(endpoint_type const& ep, error_code& ec) @@ -890,19 +890,17 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code ec // Result of operation ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`. - @see @ref async_connect + @see async_connect */ template BOOST_BEAST_ASYNC_RESULT1(ConnectHandler) @@ -934,7 +932,6 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( // Result of operation. if the sequence is empty, set to @@ -947,7 +944,6 @@ public: typename Protocol::endpoint const& endpoint ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -1004,7 +1000,6 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( // Result of operation. if the sequence is empty, set to @@ -1017,7 +1012,6 @@ public: typename Protocol::endpoint const& endpoint ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -1082,7 +1076,6 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( // Result of operation. if the sequence is empty, set to @@ -1095,7 +1088,6 @@ public: Iterator iterator ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -1138,7 +1130,6 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( // Result of operation. if the sequence is empty, set to @@ -1151,7 +1142,6 @@ public: Iterator iterator ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -1262,14 +1252,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code error, // Result of operation. std::size_t bytes_transferred // Number of bytes read. ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -1381,14 +1369,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code error, // Result of operation. std::size_t bytes_transferred // Number of bytes written. ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a diff --git a/include/boost/beast/core/buffer_traits.hpp b/include/boost/beast/core/buffer_traits.hpp index d8c9de47..f7b9adae 100644 --- a/include/boost/beast/core/buffer_traits.hpp +++ b/include/boost/beast/core/buffer_traits.hpp @@ -28,18 +28,16 @@ namespace beast { will be `std::true_type` if each specified type meets the requirements, otherwise, this type alias will be `std::false_type`. - @tparam TN A list of zero or more types to check. If this list is - empty, the resulting type alias will be `std::true_type`. + @tparam BufferSequence A list of zero or more types to check. If this + list is empty, the resulting type alias will be `std::true_type`. */ +template #if BOOST_BEAST_DOXYGEN -template -struct is_const_buffer_sequence : __see_below__ {}; -//using is_const_buffer_sequence = __see_below__; +using is_const_buffer_sequence = __see_below__; #else -template using is_const_buffer_sequence = mp11::mp_all< net::is_const_buffer_sequence< - typename std::decay::type>...>; + typename std::decay::type>...>; #endif /** Determine if a list of types satisfy the MutableBufferSequence requirements. @@ -49,18 +47,16 @@ using is_const_buffer_sequence = mp11::mp_all< will be `std::true_type` if each specified type meets the requirements, otherwise, this type alias will be `std::false_type`. - @tparam TN A list of zero or more types to check. If this list is - empty, the resulting type alias will be `std::true_type`. + @tparam BufferSequence A list of zero or more types to check. If this + list is empty, the resulting type alias will be `std::true_type`. */ +template #if BOOST_BEAST_DOXYGEN -template -struct is_mutable_buffer_sequence : __see_below__ {}; -//using is_mutable_buffer_sequence = __see_below__; +using is_mutable_buffer_sequence = __see_below__; #else -template using is_mutable_buffer_sequence = mp11::mp_all< net::is_mutable_buffer_sequence< - typename std::decay::type>...>; + typename std::decay::type>...>; #endif /** Type alias for the underlying buffer type of a list of buffer sequence types. @@ -93,16 +89,15 @@ using is_mutable_buffer_sequence = mp11::mp_all< } @endcode - @tparam TN A list of zero or more types to check. If this list is - empty, the resulting type alias will be `net::mutable_buffer`. + @tparam BufferSequence A list of zero or more types to check. If this + list is empty, the resulting type alias will be `net::mutable_buffer`. */ -template +template #if BOOST_BEAST_DOXYGEN -struct buffers_type : __see_below__ {}; -//using buffers_type = __see_below__; +using buffers_type = __see_below__; #else using buffers_type = typename std::conditional< - is_mutable_buffer_sequence::value, + is_mutable_buffer_sequence::value, net::mutable_buffer, net::const_buffer>::type; #endif @@ -115,18 +110,17 @@ using buffers_type = typename std::conditional< type alias will be equal to the iterator type used by the buffer sequence. */ -template +template #if BOOST_BEAST_DOXYGEN -struct buffers_iterator_type : __see_below__ {}; -//using buffers_iterator_type = __see_below__; +using buffers_iterator_type = __see_below__; #elif BOOST_WORKAROUND(BOOST_MSVC, < 1910) using buffers_iterator_type = typename detail::buffers_iterator_type_helper< - typename std::decay::type>::type; + typename std::decay::type>::type; #else using buffers_iterator_type = decltype(net::buffer_sequence_begin( - std::declval())); + std::declval())); #endif /** Return the total number of bytes in a buffer or buffer sequence @@ -152,17 +146,14 @@ using buffers_iterator_type = In addition this handles types which are convertible to `net::const_buffer`; these are not handled by `net::buffer_size`. - @note It is expected that a future version of Networking will - incorporate the features of this function. - @param buffers The buffer or buffer sequence to calculate the size of. @return The total number of bytes in the buffer or sequence. */ #if BOOST_BEAST_DOXYGEN -template -void -buffer_bytes(Buffers const& buffers); +template +std::size_t +buffer_bytes(BufferSequence const& buffers); #else BOOST_BEAST_INLINE_VARIABLE(buffer_bytes, detail::buffer_bytes_impl) #endif diff --git a/include/boost/beast/core/buffered_read_stream.hpp b/include/boost/beast/core/buffered_read_stream.hpp index f588f6e4..66cd561e 100644 --- a/include/boost/beast/core/buffered_read_stream.hpp +++ b/include/boost/beast/core/buffered_read_stream.hpp @@ -23,11 +23,11 @@ namespace boost { namespace beast { -/** A @b Stream with attached @b DynamicBuffer to buffer reads. +/** A Stream with attached DynamicBuffer to buffer reads. - This wraps a @b Stream implementation so that calls to write are + This wraps a Stream implementation so that calls to write are passed through to the underlying stream, while calls to read will - first consume the input sequence stored in a @b DynamicBuffer which + first consume the input sequence stored in a DynamicBuffer which is part of the object. The use-case for this class is different than that of the @@ -250,14 +250,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // result of operation std::size_t bytes_transferred // number of bytes transferred ); - @endcode - + @endcode Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -326,14 +324,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // result of operation std::size_t bytes_transferred // number of bytes transferred ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a diff --git a/include/boost/beast/core/buffers_adaptor.hpp b/include/boost/beast/core/buffers_adaptor.hpp index b94fce20..d6400481 100644 --- a/include/boost/beast/core/buffers_adaptor.hpp +++ b/include/boost/beast/core/buffers_adaptor.hpp @@ -170,7 +170,7 @@ public: @throws std::length_error if `size() + n` exceeds `max_size()`. - @par Exception Safety + @esafe Strong guarantee. */ @@ -192,7 +192,7 @@ public: is greater than the number of writable bytes, all writable bytes are appended. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -210,7 +210,7 @@ public: is greater than the number of readable bytes, all readable bytes are removed. - @par Exception Safety + @esafe No-throw guarantee. */ diff --git a/include/boost/beast/core/buffers_cat.hpp b/include/boost/beast/core/buffers_cat.hpp index b34bdc4f..532ea32e 100644 --- a/include/boost/beast/core/buffers_cat.hpp +++ b/include/boost/beast/core/buffers_cat.hpp @@ -20,7 +20,7 @@ namespace beast { /** A buffer sequence representing a concatenation of buffer sequences. - @see @ref buffers_cat + @see buffers_cat */ template class buffers_cat_view @@ -85,7 +85,7 @@ public: also a MutableBufferSequence; otherwise the returned buffer sequence will be a ConstBufferSequence. - @see @ref buffers_cat_view + @see buffers_cat_view */ #if BOOST_BEAST_DOXYGEN template diff --git a/include/boost/beast/core/buffers_range.hpp b/include/boost/beast/core/buffers_range.hpp index 39faeb49..c7659e2f 100644 --- a/include/boost/beast/core/buffers_range.hpp +++ b/include/boost/beast/core/buffers_range.hpp @@ -51,7 +51,7 @@ namespace beast { sequence, the returned object will also meet the requirements of MutableBufferSequence. - @see @ref buffers_range_ref + @see buffers_range_ref */ template #if BOOST_BEAST_DOXYGEN @@ -104,7 +104,7 @@ buffers_range(BufferSequence const& buffers) sequence, the returned object will also meet the requirements of MutableBufferSequence. - @see @ref buffers_range + @see buffers_range */ template #if BOOST_BEAST_DOXYGEN diff --git a/include/boost/beast/core/detail/read.hpp b/include/boost/beast/core/detail/read.hpp index 7d8d03cc..3f7c17f2 100644 --- a/include/boost/beast/core/detail/read.hpp +++ b/include/boost/beast/core/detail/read.hpp @@ -198,7 +198,6 @@ read( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( @@ -211,7 +210,6 @@ read( // prior to the error. ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a diff --git a/include/boost/beast/core/file.hpp b/include/boost/beast/core/file.hpp index f0b530ae..207f8ef2 100644 --- a/include/boost/beast/core/file.hpp +++ b/include/boost/beast/core/file.hpp @@ -22,7 +22,7 @@ namespace beast { /** An implementation of File. This alias is set to the best available implementation - of @b File given the platform and build settings. + of File given the platform and build settings. */ #if BOOST_BEAST_DOXYGEN struct file : file_stdio diff --git a/include/boost/beast/core/file_base.hpp b/include/boost/beast/core/file_base.hpp index e49c5194..cf75e785 100644 --- a/include/boost/beast/core/file_base.hpp +++ b/include/boost/beast/core/file_base.hpp @@ -35,7 +35,7 @@ append_existing write-only exclusive sequential must exist /** File open modes These modes are used when opening files using - instances of the @b File concept. + instances of the File concept. @see file_stdio */ @@ -95,7 +95,7 @@ enum class file_mode append_existing }; -/** Determine if `T` meets the requirements of @b File. +/** Determine if `T` meets the requirements of File. Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, diff --git a/include/boost/beast/core/file_posix.hpp b/include/boost/beast/core/file_posix.hpp index 313e0978..b7a70a54 100644 --- a/include/boost/beast/core/file_posix.hpp +++ b/include/boost/beast/core/file_posix.hpp @@ -37,7 +37,7 @@ namespace beast { /** An implementation of File for POSIX systems. - This class implements a @b File using POSIX interfaces. + This class implements a File using POSIX interfaces. */ class file_posix { diff --git a/include/boost/beast/core/file_win32.hpp b/include/boost/beast/core/file_win32.hpp index 61246c43..908076d7 100644 --- a/include/boost/beast/core/file_win32.hpp +++ b/include/boost/beast/core/file_win32.hpp @@ -34,7 +34,7 @@ namespace beast { /** An implementation of File for Win32. - This class implements a @b File using Win32 native interfaces. + This class implements a File using Win32 native interfaces. */ class file_win32 { diff --git a/include/boost/beast/core/flat_buffer.hpp b/include/boost/beast/core/flat_buffer.hpp index ceab9fa8..9e8d639c 100644 --- a/include/boost/beast/core/flat_buffer.hpp +++ b/include/boost/beast/core/flat_buffer.hpp @@ -31,7 +31,7 @@ namespace beast { is provided to permit them to be efficiently used with I/O operations. - Objects of this type meet the requirements of @b DynamicBuffer + Objects of this type meet the requirements of DynamicBuffer and have the following additional properties: @li A mutable buffer sequence representing the readable @@ -129,7 +129,7 @@ public: @param alloc The allocator to use for the object. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -145,7 +145,7 @@ public: @param alloc The allocator to use for the object. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -166,7 +166,7 @@ public: moved-from object will have zero capacity, zero readable bytes, and zero writable bytes. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -272,7 +272,7 @@ public: the moved-from object will have zero capacity, zero readable bytes, and zero writable bytes. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -326,7 +326,7 @@ public: @param n The maximum number of bytes ever allowed for capacity. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -348,7 +348,7 @@ public: If this value is greater than the maximum size, then the maximum size will be adjusted upwards to this value. - @par Exception Safety + @esafe Basic guarantee. @@ -363,7 +363,7 @@ public: Buffer sequences previously obtained using @ref data or @ref prepare become invalid. - @par Exception Safety + @esafe Strong guarantee. */ @@ -376,7 +376,7 @@ public: Buffer sequences previously obtained using @ref data or @ref prepare become invalid. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -459,7 +459,7 @@ public: @throws std::length_error if `size() + n` exceeds either `max_size()` or the allocator's maximum allocation size. - @par Exception Safety + @esafe Strong guarantee. */ @@ -480,7 +480,7 @@ public: is greater than the number of writable bytes, all writable bytes are appended. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -501,7 +501,7 @@ public: is greater than the number of readable bytes, all readable bytes are removed. - @par Exception Safety + @esafe No-throw guarantee. */ diff --git a/include/boost/beast/core/flat_static_buffer.hpp b/include/boost/beast/core/flat_static_buffer.hpp index d664eedf..f951fe2c 100644 --- a/include/boost/beast/core/flat_static_buffer.hpp +++ b/include/boost/beast/core/flat_static_buffer.hpp @@ -29,7 +29,7 @@ namespace beast { is provided to permit them to be efficiently used with I/O operations. - Objects of this type meet the requirements of @b DynamicBuffer + Objects of this type meet the requirements of DynamicBuffer and have the following additional properties: @li A mutable buffer sequence representing the readable @@ -46,7 +46,7 @@ namespace beast { @ref flat_static_buffer; however, to reduce the number of template instantiations, objects should be passed `flat_static_buffer_base&`. - @see @ref flat_static_buffer + @see flat_static_buffer */ class flat_static_buffer_base { @@ -84,7 +84,7 @@ public: Buffer sequences previously obtained using @ref data or @ref prepare become invalid. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -175,7 +175,7 @@ public: @throws std::length_error if `size() + n` exceeds `max_size()`. - @par Exception Safety + @esafe Strong guarantee. */ @@ -197,7 +197,7 @@ public: is greater than the number of writable bytes, all writable bytes are appended. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -218,7 +218,7 @@ public: is greater than the number of readable bytes, all readable bytes are removed. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -246,7 +246,7 @@ protected: @param n The number of valid bytes pointed to by `p`. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -265,7 +265,7 @@ private: //------------------------------------------------------------------------------ -/** A @b DynamicBuffer with a fixed size internal buffer. +/** A DynamicBuffer with a fixed size internal buffer. Buffer sequences returned by @ref data and @ref prepare will always be of length one. @@ -277,7 +277,7 @@ private: objects of this type in a deduced context, the signature of the receiving function should use @ref flat_static_buffer_base instead. - @see @ref flat_static_buffer_base + @see flat_static_buffer_base */ template class flat_static_buffer : public flat_static_buffer_base diff --git a/include/boost/beast/core/flat_stream.hpp b/include/boost/beast/core/flat_stream.hpp index 288eaf2c..fb8d9c19 100644 --- a/include/boost/beast/core/flat_stream.hpp +++ b/include/boost/beast/core/flat_stream.hpp @@ -235,14 +235,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // Result of operation. std::size_t bytes_transferred // Number of bytes read. ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -317,14 +315,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec, // Result of operation. std::size_t bytes_transferred // Number of bytes written. ); - @endcode - + @endcode Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a diff --git a/include/boost/beast/core/handler_ptr.hpp b/include/boost/beast/core/handler_ptr.hpp index 280975a7..bbb9f4e9 100644 --- a/include/boost/beast/core/handler_ptr.hpp +++ b/include/boost/beast/core/handler_ptr.hpp @@ -103,7 +103,7 @@ public: T::T(Handler const&, Args&&...) @endcode - @par Exception Safety + @esafe Strong guarantee. @param handler The handler to associate with the owned object. diff --git a/include/boost/beast/core/impl/async_base.hpp b/include/boost/beast/core/impl/async_base.hpp new file mode 100644 index 00000000..ec17b1cc --- /dev/null +++ b/include/boost/beast/core/impl/async_base.hpp @@ -0,0 +1,156 @@ +// +// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Official repository: https://github.com/boostorg/beast +// + +#ifndef BOOST_BEAST_CORE_IMPL_ASYNC_BASE_HPP +#define BOOST_BEAST_CORE_IMPL_ASYNC_BASE_HPP + +#include + +namespace boost { +namespace beast { + +namespace detail { + +template +struct allocate_stable_state final + : stable_base + , boost::empty_value +{ + State value; + + template + explicit + allocate_stable_state( + Allocator const& alloc, + Args&&... args) + : boost::empty_value( + boost::empty_init_t{}, alloc) + , value{std::forward(args)...} + { + } + + void destroy() override + { + using A = typename allocator_traits< + Allocator>::template rebind_alloc< + allocate_stable_state>; + + A a(this->get()); + detail::allocator_traits::destroy(a, this); + detail::allocator_traits::deallocate(a, this, 1); + } +}; + +} // detail + +template< + class Handler, + class Executor1, + class Allocator, + class Function> +void asio_handler_invoke( + Function&& f, + async_base* p) +{ + using net::asio_handler_invoke; + asio_handler_invoke(f, + p->get_legacy_handler_pointer()); +} + +template< + class Handler, + class Executor1, + class Allocator> +void* +asio_handler_allocate( + std::size_t size, + async_base* p) +{ + using net::asio_handler_allocate; + return asio_handler_allocate(size, + p->get_legacy_handler_pointer()); +} + +template< + class Handler, + class Executor1, + class Allocator> +void +asio_handler_deallocate( + void* mem, std::size_t size, + async_base* p) +{ + using net::asio_handler_deallocate; + asio_handler_deallocate(mem, size, + p->get_legacy_handler_pointer()); +} + +template< + class Handler, + class Executor1, + class Allocator> +bool +asio_handler_is_continuation( + async_base* p) +{ + using net::asio_handler_is_continuation; + return asio_handler_is_continuation( + p->get_legacy_handler_pointer()); +} + +template< + class State, + class Handler, + class Executor1, + class Allocator, + class... Args> +State& +allocate_stable( + stable_async_base< + Handler, Executor1, Allocator>& base, + Args&&... args) +{ + using allocator_type = typename stable_async_base< + Handler, Executor1, Allocator>::allocator_type; + + using A = typename detail::allocator_traits< + allocator_type>::template rebind_alloc< + detail::allocate_stable_state< + State, allocator_type>>; + + struct deleter + { + allocator_type alloc; + detail::allocate_stable_state< + State, allocator_type>* ptr; + + ~deleter() + { + if(ptr) + { + A a(alloc); + detail::allocator_traits::deallocate(a, ptr, 1); + } + } + }; + + A a(base.get_allocator()); + deleter d{base.get_allocator(), nullptr}; + d.ptr = detail::allocator_traits::allocate(a, 1); + detail::allocator_traits::construct(a, d.ptr, + d.alloc, std::forward(args)...); + d.ptr->next_ = base.list_; + base.list_ = d.ptr; + return boost::exchange(d.ptr, nullptr)->value; +} + +} // beast +} // boost + +#endif diff --git a/include/boost/beast/core/multi_buffer.hpp b/include/boost/beast/core/multi_buffer.hpp index ecb4ce56..2cf477a8 100644 --- a/include/boost/beast/core/multi_buffer.hpp +++ b/include/boost/beast/core/multi_buffer.hpp @@ -147,7 +147,7 @@ public: @param alloc The allocator to use for the object. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -163,7 +163,7 @@ public: @param alloc The allocator to use for the object. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -183,7 +183,7 @@ public: moved-from object will have zero capacity, zero readable bytes, and zero writable bytes. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -337,7 +337,7 @@ public: @param n The maximum number of bytes ever allowed for capacity. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -363,7 +363,7 @@ public: @throws std::length_error if n is larger than the maximum allocation size of the allocator. - @par Exception Safety + @esafe Strong guarantee. */ @@ -375,7 +375,7 @@ public: Buffer sequences previously obtained using @ref data or @ref prepare become invalid. - @par Exception Safety + @esafe Strong guarantee. */ @@ -388,7 +388,7 @@ public: Buffer sequences previously obtained using @ref data or @ref prepare become invalid. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -477,7 +477,7 @@ public: @throws std::length_error if `size() + n` exceeds `max_size()`. - @par Exception Safety + @esafe Strong guarantee. */ @@ -499,7 +499,7 @@ public: is greater than the number of writable bytes, all writable bytes are appended. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -517,7 +517,7 @@ public: is greater than the number of readable bytes, all readable bytes are removed. - @par Exception Safety + @esafe No-throw guarantee. */ diff --git a/include/boost/beast/core/ostream.hpp b/include/boost/beast/core/ostream.hpp index 5b93d148..46899b60 100644 --- a/include/boost/beast/core/ostream.hpp +++ b/include/boost/beast/core/ostream.hpp @@ -23,9 +23,9 @@ namespace boost { namespace beast { -/** Return an output stream that formats values into a @b DynamicBuffer. +/** Return an output stream that formats values into a DynamicBuffer. - This function wraps the caller provided @b DynamicBuffer into + This function wraps the caller provided DynamicBuffer into a `std::ostream` derived class, to allow `operator<<` stream style formatting operations. @@ -37,7 +37,7 @@ namespace beast { @note Calling members of the underlying buffer before the output stream is destroyed results in undefined behavior. - @param buffer An object meeting the requirements of @b DynamicBuffer + @param buffer An object meeting the requirements of DynamicBuffer into which the formatted output will be placed. @return An object derived from `std::ostream` which redirects output diff --git a/include/boost/beast/core/rate_policy.hpp b/include/boost/beast/core/rate_policy.hpp index e6a25d87..1f8abb9b 100644 --- a/include/boost/beast/core/rate_policy.hpp +++ b/include/boost/beast/core/rate_policy.hpp @@ -17,7 +17,7 @@ namespace boost { namespace beast { -/** Helper class to assist implementing a RatePolicy. +/** Helper class to assist implementing a RatePolicy. This class is used by the implementation to gain access to the private members of a user-defined object meeting the requirements @@ -36,7 +36,7 @@ namespace beast { @li RatePolicy - @see @ref beast::basic_stream + @see beast::basic_stream */ class rate_policy_access { @@ -145,7 +145,7 @@ class unlimited_rate_policy @li RatePolicy - @see @ref beast::basic_stream + @see beast::basic_stream */ class simple_rate_policy { diff --git a/include/boost/beast/core/static_buffer.hpp b/include/boost/beast/core/static_buffer.hpp index d36fd868..1e442371 100644 --- a/include/boost/beast/core/static_buffer.hpp +++ b/include/boost/beast/core/static_buffer.hpp @@ -32,7 +32,7 @@ namespace beast { is provided to permit them to be efficiently used with I/O operations. - Objects of this type meet the requirements of @b DynamicBuffer + Objects of this type meet the requirements of DynamicBuffer and have the following additional properties: @li A mutable buffer sequence representing the readable @@ -51,7 +51,7 @@ namespace beast { @ref static_buffer; however, to reduce the number of template instantiations, objects should be passed `static_buffer_base&`. - @see @ref static_buffer + @see static_buffer */ class static_buffer_base { @@ -84,7 +84,7 @@ public: Buffer sequences previously obtained using @ref data or @ref prepare become invalid. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -161,7 +161,7 @@ public: @throws std::length_error if `size() + n` exceeds `max_size()`. - @par Exception Safety + @esafe Strong guarantee. */ @@ -183,7 +183,7 @@ public: is greater than the number of writable bytes, all writable bytes are appended. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -202,7 +202,7 @@ public: is greater than the number of readable bytes, all readable bytes are removed. - @par Exception Safety + @esafe No-throw guarantee. */ @@ -223,7 +223,7 @@ public: is provided to permit them to be efficiently used with I/O operations. - Objects of this type meet the requirements of @b DynamicBuffer + Objects of this type meet the requirements of DynamicBuffer and have the following additional properties: @li A mutable buffer sequence representing the readable @@ -241,7 +241,7 @@ public: objects of this type in a deduced context, the signature of the receiving function should use @ref static_buffer_base instead. - @see @ref static_buffer_base + @see static_buffer_base */ template class static_buffer : public static_buffer_base diff --git a/include/boost/beast/core/static_string.hpp b/include/boost/beast/core/static_string.hpp index 7b0d1f6b..9227fa15 100644 --- a/include/boost/beast/core/static_string.hpp +++ b/include/boost/beast/core/static_string.hpp @@ -35,7 +35,7 @@ namespace beast { @note The stored string is always null-terminated. - @see @ref to_static_string + @see to_static_string */ template< std::size_t N, diff --git a/include/boost/beast/core/stream_traits.hpp b/include/boost/beast/core/stream_traits.hpp index 8f8e9593..26f9ea54 100644 --- a/include/boost/beast/core/stream_traits.hpp +++ b/include/boost/beast/core/stream_traits.hpp @@ -79,7 +79,7 @@ using lowest_layer_type = detail::lowest_layer_type; @param t The layer in a stack of layered objects for which the lowest layer is returned. - @see @ref close_socket, @ref lowest_layer_type + @see close_socket, lowest_layer_type */ template lowest_layer_type& @@ -163,7 +163,7 @@ using executor_type = */ #if BOOST_BEAST_DOXYGEN template -struct has_get_executor : std::integral_constant{}; +using has_get_executor = __see_below__; #else template struct has_get_executor : std::false_type {}; @@ -175,16 +175,14 @@ struct has_get_executorSyncReadStream. Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, else the type will be `std::false_type`. @par Example - Use with `static_assert`: - @code template void f(SyncReadStream& stream) @@ -195,7 +193,6 @@ struct has_get_executor typename std::enable_if::value>::type @@ -204,7 +201,7 @@ struct has_get_executor -struct is_sync_read_stream : std::integral_constant{}; +using is_sync_read_stream = __see_below__; #else template struct is_sync_read_stream : std::false_type {}; @@ -219,7 +216,7 @@ struct is_sync_read_stream> : std::true_type {}; #endif -/** Determine if `T` meets the requirements of @b SyncWriteStream. +/** Determine if `T` meets the requirements of SyncWriteStream. Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, @@ -248,7 +245,7 @@ struct is_sync_read_stream -struct is_sync_write_stream : std::integral_constant{}; +using is_sync_write_stream = __see_below__; #else template struct is_sync_write_stream : std::false_type {}; @@ -293,7 +290,7 @@ struct is_sync_write_stream -struct is_sync_stream : std::integral_constant{}; +using is_sync_stream = __see_below__; #else template using is_sync_stream = std::integral_constantAsyncReadStream. Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, @@ -331,7 +328,7 @@ using is_sync_stream = std::integral_constant -struct is_async_read_stream : std::integral_constant{}; +using is_async_read_stream = __see_below__; #else template struct is_async_read_stream : std::false_type {}; @@ -346,7 +343,7 @@ struct is_async_read_stream {}; #endif -/** Determine if `T` meets the requirements of @b AsyncWriteStream. +/** Determine if `T` meets the requirements of AsyncWriteStream. Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, @@ -375,7 +372,7 @@ struct is_async_read_stream -struct is_async_write_stream : std::integral_constant{}; +using is_async_write_stream = __see_below__; #else template struct is_async_write_stream : std::false_type {}; @@ -419,7 +416,7 @@ struct is_async_write_stream -struct is_async_stream : std::integral_constant{}; +using is_async_stream = __see_below__; #else template using is_async_stream = std::integral_constant is DEPRECATED and will namespace boost { namespace beast { -/** Determine if `T` meets the requirements of @b CompletionHandler. +/** Determine if `T` meets the requirements of CompletionHandler. + This trait checks whether a type meets the requirements for a completion handler, and is also callable with the specified signature. Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, else the type will be `std::false_type`. + @par Example Use with `static_assert`: @code @@ -42,7 +44,7 @@ namespace beast { */ template #if BOOST_BEAST_DOXYGEN -using is_completion_handler = std::integral_constant; +using is_completion_handler = __see_below__ #else using is_completion_handler = std::integral_constant::type>::value && diff --git a/include/boost/beast/http/basic_dynamic_body.hpp b/include/boost/beast/http/basic_dynamic_body.hpp index 5d203394..3fea3737 100644 --- a/include/boost/beast/http/basic_dynamic_body.hpp +++ b/include/boost/beast/http/basic_dynamic_body.hpp @@ -24,9 +24,9 @@ namespace boost { namespace beast { namespace http { -/** A @b Body using a @b DynamicBuffer +/** A Body using a DynamicBuffer - This body uses a @b DynamicBuffer as a memory-based container + This body uses a DynamicBuffer as a memory-based container for holding message payloads. Messages using this body type may be serialized and parsed. */ @@ -59,7 +59,7 @@ struct basic_dynamic_body /** The algorithm for parsing the body - Meets the requirements of @b BodyReader. + Meets the requirements of BodyReader. */ #if BOOST_BEAST_DOXYGEN using reader = __implementation_defined__; @@ -117,7 +117,7 @@ struct basic_dynamic_body /** The algorithm for serializing the body - Meets the requirements of @b BodyWriter. + Meets the requirements of BodyWriter. */ #if BOOST_BEAST_DOXYGEN using writer = __implementation_defined__; diff --git a/include/boost/beast/http/basic_file_body.hpp b/include/boost/beast/http/basic_file_body.hpp index c33715cd..152df889 100644 --- a/include/boost/beast/http/basic_file_body.hpp +++ b/include/boost/beast/http/basic_file_body.hpp @@ -38,7 +38,7 @@ namespace http { content from a directory as part of a web service. @tparam File The implementation to use for accessing files. - This type must meet the requirements of @b File. + This type must meet the requirements of File. */ template struct basic_file_body diff --git a/include/boost/beast/http/basic_parser.hpp b/include/boost/beast/http/basic_parser.hpp index e0b6056d..25748f38 100644 --- a/include/boost/beast/http/basic_parser.hpp +++ b/include/boost/beast/http/basic_parser.hpp @@ -377,7 +377,7 @@ public: the parser may not be restarted. @param buffers An object meeting the requirements of - @b ConstBufferSequence that represents the next chunk of + ConstBufferSequence that represents the next chunk of message data. If the length of this buffer sequence is one, the implementation will not allocate additional memory. The class @ref beast::basic_flat_buffer is provided as one way to diff --git a/include/boost/beast/http/buffer_body.hpp b/include/boost/beast/http/buffer_body.hpp index 00ca475a..8988c232 100644 --- a/include/boost/beast/http/buffer_body.hpp +++ b/include/boost/beast/http/buffer_body.hpp @@ -23,7 +23,7 @@ namespace boost { namespace beast { namespace http { -/** A @b Body using a caller provided buffer +/** A Body using a caller provided buffer Messages using this body type may be serialized and parsed. To use this class, the caller must initialize the members @@ -94,7 +94,7 @@ struct buffer_body /** The algorithm for parsing the body - Meets the requirements of @b BodyReader. + Meets the requirements of BodyReader. */ #if BOOST_BEAST_DOXYGEN using reader = __implementation_defined__; @@ -150,7 +150,7 @@ struct buffer_body /** The algorithm for serializing the body - Meets the requirements of @b BodyWriter. + Meets the requirements of BodyWriter. */ #if BOOST_BEAST_DOXYGEN using writer = __implementation_defined__; diff --git a/include/boost/beast/http/chunk_encode.hpp b/include/boost/beast/http/chunk_encode.hpp index 8c1b804a..8b8ff651 100644 --- a/include/boost/beast/http/chunk_encode.hpp +++ b/include/boost/beast/http/chunk_encode.hpp @@ -25,7 +25,7 @@ namespace http { /** A chunked encoding crlf - This implements a @b ConstBufferSequence holding the CRLF + This implements a ConstBufferSequence holding the CRLF (`"\r\n"`) used as a delimiter in a @em chunk. To use this class, pass an instance of it to a @@ -44,20 +44,20 @@ struct chunk_crlf //----- - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence #if BOOST_BEAST_DOXYGEN using value_type = __implementation_defined__; #else using value_type = net::const_buffer; #endif - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence using const_iterator = value_type const*; - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence chunk_crlf(chunk_crlf const&) = default; - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence const_iterator begin() const { @@ -65,7 +65,7 @@ struct chunk_crlf return &cb; } - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence const_iterator end() const { @@ -77,7 +77,7 @@ struct chunk_crlf /** A @em chunk header - This implements a @b ConstBufferSequence representing the + This implements a ConstBufferSequence representing the header of a @em chunk. The serialized format is as follows: @code chunk-header = 1*HEXDIG chunk-ext CRLF @@ -228,31 +228,31 @@ public: //----- - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence #if BOOST_BEAST_DOXYGEN using value_type = __implementation_defined__; #else using value_type = typename view_type::value_type; #endif - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence #if BOOST_BEAST_DOXYGEN using const_iterator = __implementation_defined__; #else using const_iterator = typename view_type::const_iterator; #endif - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence chunk_header(chunk_header const&) = default; - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence const_iterator begin() const { return view_.begin(); } - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence const_iterator end() const { @@ -264,7 +264,7 @@ public: /** A @em chunk - This implements a @b ConstBufferSequence representing + This implements a ConstBufferSequence representing a @em chunk. The serialized format is as follows: @code chunk = chunk-size [ chunk-ext ] CRLF chunk-data CRLF @@ -422,28 +422,28 @@ public: //----- - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence #if BOOST_BEAST_DOXYGEN using value_type = __implementation_defined__; #else using value_type = typename view_type::value_type; #endif - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence #if BOOST_BEAST_DOXYGEN using const_iterator = __implementation_defined__; #else using const_iterator = typename view_type::const_iterator; #endif - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence const_iterator begin() const { return view_.begin(); } - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence const_iterator end() const { @@ -524,10 +524,10 @@ public: //----- - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence chunk_last(chunk_last const&) = default; - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence #if BOOST_BEAST_DOXYGEN using value_type = __implementation_defined__; #else @@ -535,7 +535,7 @@ public: typename view_type::value_type; #endif - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence #if BOOST_BEAST_DOXYGEN using const_iterator = __implementation_defined__; #else @@ -543,14 +543,14 @@ public: typename view_type::const_iterator; #endif - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence const_iterator begin() const { return view_.begin(); } - /// Required for @b ConstBufferSequence + /// Required for ConstBufferSequence const_iterator end() const { diff --git a/include/boost/beast/http/detail/type_traits.hpp b/include/boost/beast/http/detail/type_traits.hpp index 77d6d3fd..1da4c4e4 100644 --- a/include/boost/beast/http/detail/type_traits.hpp +++ b/include/boost/beast/http/detail/type_traits.hpp @@ -80,7 +80,7 @@ struct has_value_type > : std::true_type {}; -/** Determine if a @b Body type has a size +/** Determine if a Body type has a size This metafunction is equivalent to `std::true_type` if Body contains a static member function called `size`. diff --git a/include/boost/beast/http/dynamic_body.hpp b/include/boost/beast/http/dynamic_body.hpp index 16dffaa1..a55fff45 100644 --- a/include/boost/beast/http/dynamic_body.hpp +++ b/include/boost/beast/http/dynamic_body.hpp @@ -19,7 +19,7 @@ namespace http { /** A dynamic message body represented by a @ref multi_buffer - Meets the requirements of @b Body. + Meets the requirements of Body. */ using dynamic_body = basic_dynamic_body; diff --git a/include/boost/beast/http/empty_body.hpp b/include/boost/beast/http/empty_body.hpp index 3d4f679c..40ea2461 100644 --- a/include/boost/beast/http/empty_body.hpp +++ b/include/boost/beast/http/empty_body.hpp @@ -19,7 +19,7 @@ namespace boost { namespace beast { namespace http { -/** An empty @b Body +/** An empty Body This body is used to represent messages which do not have a message body. If this body is used with a parser, and the @@ -54,7 +54,7 @@ struct empty_body /** The algorithm for parsing the body - Meets the requirements of @b BodyReader. + Meets the requirements of BodyReader. */ #if BOOST_BEAST_DOXYGEN using reader = __implementation_defined__; @@ -92,7 +92,7 @@ struct empty_body /** The algorithm for serializing the body - Meets the requirements of @b BodyWriter. + Meets the requirements of BodyWriter. */ #if BOOST_BEAST_DOXYGEN using writer = __implementation_defined__; diff --git a/include/boost/beast/http/error.hpp b/include/boost/beast/http/error.hpp index 1f4dfea2..d0c287eb 100644 --- a/include/boost/beast/http/error.hpp +++ b/include/boost/beast/http/error.hpp @@ -51,7 +51,7 @@ enum class error octets into a message container which has the @ref empty_body body type. - @see @ref empty_body + @see empty_body */ unexpected_body, diff --git a/include/boost/beast/http/fields.hpp b/include/boost/beast/http/fields.hpp index f0f980b8..927191d7 100644 --- a/include/boost/beast/http/fields.hpp +++ b/include/boost/beast/http/fields.hpp @@ -45,10 +45,9 @@ namespace http { is iterated the fields are presented in the order of insertion, with fields having the same name following each other consecutively. - Meets the requirements of @b Fields + Meets the requirements of Fields - @tparam Allocator The allocator to use. This must meet the - requirements of @b Allocator. + @tparam Allocator The allocator to use. */ template class basic_fields diff --git a/include/boost/beast/http/message.hpp b/include/boost/beast/http/message.hpp index d4dd79ea..6ed9d8a1 100644 --- a/include/boost/beast/http/message.hpp +++ b/include/boost/beast/http/message.hpp @@ -129,7 +129,7 @@ public: @note This function is only available when `isRequest == true`. - @see @ref method_string + @see method_string */ verb method() const; @@ -152,7 +152,7 @@ public: @note This function is only available when `isRequest == true`. - @see @ref method + @see method */ string_view method_string() const; @@ -824,7 +824,7 @@ public: /** Returns the payload size of the body in octets if possible. - This function invokes the @b Body algorithm to measure + This function invokes the Body algorithm to measure the number of octets in the serialized body container. If there is no body, this will return zero. Otherwise, if the body exists but is not known ahead of time, `boost::none` diff --git a/include/boost/beast/http/parser.hpp b/include/boost/beast/http/parser.hpp index cd427e01..9b0523f7 100644 --- a/include/boost/beast/http/parser.hpp +++ b/include/boost/beast/http/parser.hpp @@ -35,7 +35,7 @@ namespace http { will be parsed. @tparam Body The type used to represent the body. This must - meet the requirements of @b Body. + meet the requirements of Body. @tparam Allocator The type of allocator used with the @ref basic_fields container. @@ -120,7 +120,7 @@ public: This constructs a new parser by move constructing the header from another parser with a different body type. The constructed-from parser must not have any parsed body octets or - initialized @b BodyReader, otherwise an exception is generated. + initialized BodyReader, otherwise an exception is generated. @par Example @code diff --git a/include/boost/beast/http/read.hpp b/include/boost/beast/http/read.hpp index aa8d1285..229444be 100644 --- a/include/boost/beast/http/read.hpp +++ b/include/boost/beast/http/read.hpp @@ -185,14 +185,12 @@ read_some( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // result of operation std::size_t bytes_transferred // the total number of bytes transferred from the stream ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -378,14 +376,12 @@ read_header( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // result of operation std::size_t bytes_transferred // the total number of bytes transferred from the stream ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -573,14 +569,12 @@ read( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // result of operation std::size_t bytes_transferred // the total number of bytes transferred from the stream ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -777,14 +771,12 @@ read( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // result of operation std::size_t bytes_transferred // the total number of bytes transferred from the stream ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a diff --git a/include/boost/beast/http/serializer.hpp b/include/boost/beast/http/serializer.hpp index d7982e4d..f2922608 100644 --- a/include/boost/beast/http/serializer.hpp +++ b/include/boost/beast/http/serializer.hpp @@ -65,7 +65,7 @@ public: /** The type of message this serializer uses This may be const or non-const depending on the - implementation of the corresponding @b BodyWriter. + implementation of the corresponding BodyWriter. */ #if BOOST_BEAST_DOXYGEN using value_type = __implementation_defined__; @@ -294,7 +294,7 @@ public: /** Returns the next set of buffers in the serialization. This function will attempt to call the `visit` function - object with a @b ConstBufferSequence of unspecified type + object with a ConstBufferSequence of unspecified type representing the next set of buffers in the serialization of the message represented by this object. @@ -336,7 +336,7 @@ public: void consume(std::size_t n); - /** Provides low-level access to the associated @b BodyWriter + /** Provides low-level access to the associated BodyWriter This function provides access to the instance of the writer associated with the body and created by the serializer diff --git a/include/boost/beast/http/span_body.hpp b/include/boost/beast/http/span_body.hpp index 1af32a63..a0d32f84 100644 --- a/include/boost/beast/http/span_body.hpp +++ b/include/boost/beast/http/span_body.hpp @@ -21,7 +21,7 @@ namespace boost { namespace beast { namespace http { -/** A @b Body using @ref span +/** A Body using @ref span This body uses @ref span as a memory-based container for holding message payloads. The container represents a @@ -62,7 +62,7 @@ public: /** The algorithm for parsing the body - Meets the requirements of @b BodyReader. + Meets the requirements of BodyReader. */ #if BOOST_BEAST_DOXYGEN using reader = __implementation_defined__; @@ -121,7 +121,7 @@ public: /** The algorithm for serializing the body - Meets the requirements of @b BodyWriter. + Meets the requirements of BodyWriter. */ #if BOOST_BEAST_DOXYGEN using writer = __implementation_defined__; diff --git a/include/boost/beast/http/string_body.hpp b/include/boost/beast/http/string_body.hpp index 5059ddc6..73a01a41 100644 --- a/include/boost/beast/http/string_body.hpp +++ b/include/boost/beast/http/string_body.hpp @@ -30,7 +30,7 @@ namespace boost { namespace beast { namespace http { -/** A @b Body using `std::basic_string` +/** A Body using `std::basic_string` This body uses `std::basic_string` as a memory-based container for holding message payloads. Messages using this body type @@ -72,7 +72,7 @@ public: /** The algorithm for parsing the body - Meets the requirements of @b BodyReader. + Meets the requirements of BodyReader. */ #if BOOST_BEAST_DOXYGEN using reader = __implementation_defined__; @@ -140,7 +140,7 @@ public: /** The algorithm for serializing the body - Meets the requirements of @b BodyWriter. + Meets the requirements of BodyWriter. */ #if BOOST_BEAST_DOXYGEN using writer = __implementation_defined__; @@ -177,7 +177,7 @@ public: #endif }; -/// A @b Body using `std::string` +/// A Body using `std::string` using string_body = basic_string_body; } // http diff --git a/include/boost/beast/http/type_traits.hpp b/include/boost/beast/http/type_traits.hpp index a7339b03..b8bfdbaa 100644 --- a/include/boost/beast/http/type_traits.hpp +++ b/include/boost/beast/http/type_traits.hpp @@ -26,12 +26,12 @@ namespace http { template class message; -/** Determine if `T` meets the requirements of @b Body. +/** Determine if a type meets the Body named requirements. - This metafunction is equivalent to `std::true_type` - if `T` has a nested type named `value_type`. + This alias template is `std::true_type` if `T` meets + the requirements, otherwise it is `std::false_type`. - @tparam T The body type to test. + @tparam T The type to test. @par Example @code @@ -45,18 +45,18 @@ class message; */ template #if BOOST_BEAST_DOXYGEN -struct is_body : std::integral_constant{}; +using is_body = __see_below__; #else using is_body = detail::has_value_type; #endif -/** Determine if a @b Body type has a reader. +/** Determine if a type has a nested BodyWriter. - This metafunction is equivalent to `std::true_type` if: + This alias template is `std::true_type` when: - @li `T` has a nested type named `reader` + @li `T` has a nested type named `writer` - @li The nested type meets the requirements of @b BodyWriter. + @li `writer` meets the requirements of BodyWriter. @tparam T The body type to test. @@ -72,7 +72,7 @@ using is_body = detail::has_value_type; */ #if BOOST_BEAST_DOXYGEN template -struct is_body_writer : std::integral_constant {}; +using is_body_writer = __see_below__; #else template struct is_body_writer : std::false_type {}; @@ -99,11 +99,19 @@ struct is_body_writer {}; #endif -/** Returns true if the writer for a @b Body mutates the body container. +/** Determine if a type has a nested BodyWriter. + + This alias template is `std::true_type` when: + + @li `T` has a nested type named `writer` + + @li `writer` meets the requirements of BodyWriter. + + @tparam T The body type to test. */ #if BOOST_BEAST_DOXYGEN template -struct is_mutable_body_writer : std::integral_constant {}; +using is_mutable_body_writer = __see_below__; #else template struct is_mutable_body_writer : std::false_type {}; @@ -136,13 +144,13 @@ struct is_mutable_body_writer{}; #endif -/** Determine if a @b Body type has a reader. +/** Determine if a type has a nested BodyReader. - This metafunction is equivalent to `std::true_type` if: + This alias template is `std::true_type` when: @li `T` has a nested type named `reader` - @li The nested type meets the requirements of @b BodyReader. + @li `reader` meets the requirements of BodyReader. @tparam T The body type to test. @@ -158,7 +166,7 @@ struct is_mutable_body_writer -struct is_body_reader : std::integral_constant {}; +using is_body_reader = __see_below__; #else template struct is_body_reader : std::false_type {}; @@ -186,14 +194,15 @@ struct is_body_readerFields named requirements. - @tparam T The body type to test. + This alias template is `std::true_type` if `T` meets + the requirements, otherwise it is `std::false_type`. + + @tparam T The type to test. @par Example - Use with `static_assert`: - @code template void f(message const&) @@ -204,7 +213,6 @@ struct is_body_reader typename std::enable_if::value>::type @@ -213,7 +221,7 @@ struct is_body_reader -struct is_fields : std::integral_constant {}; +using is_fields = __see_below__; #else template using is_fields = typename detail::is_fields_helper::type; diff --git a/include/boost/beast/http/vector_body.hpp b/include/boost/beast/http/vector_body.hpp index a42c6b4e..b44ef0f6 100644 --- a/include/boost/beast/http/vector_body.hpp +++ b/include/boost/beast/http/vector_body.hpp @@ -29,7 +29,7 @@ namespace boost { namespace beast { namespace http { -/** A @b Body using `std::vector` +/** A Body using `std::vector` This body uses `std::vector` as a memory-based container for holding message payloads. Messages using this body type @@ -66,7 +66,7 @@ public: /** The algorithm for parsing the body - Meets the requirements of @b BodyReader. + Meets the requirements of BodyReader. */ #if BOOST_BEAST_DOXYGEN using reader = __implementation_defined__; @@ -128,7 +128,7 @@ public: /** The algorithm for serializing the body - Meets the requirements of @b BodyWriter. + Meets the requirements of BodyWriter. */ #if BOOST_BEAST_DOXYGEN using writer = __implementation_defined__; diff --git a/include/boost/beast/http/write.hpp b/include/boost/beast/http/write.hpp index 05962161..b4d74101 100644 --- a/include/boost/beast/http/write.hpp +++ b/include/boost/beast/http/write.hpp @@ -55,7 +55,7 @@ namespace http { stream. @param stream The stream to which the data is to be written. - The type must support the @b SyncWriteStream concept. + The type must support the SyncWriteStream concept. @param sr The serializer to use. @@ -97,7 +97,7 @@ write_some( stream. @param stream The stream to which the data is to be written. - The type must support the @b SyncWriteStream concept. + The type must support the SyncWriteStream concept. @param sr The serializer to use. @@ -105,7 +105,7 @@ write_some( @return The number of bytes written to the stream. - @see @ref async_write_some, @ref serializer + @see async_write_some, serializer */ template< class SyncWriteStream, @@ -143,7 +143,7 @@ write_some( stream. @param stream The stream to which the data is to be written. - The type must support the @b AsyncWriteStream concept. + The type must support the AsyncWriteStream concept. @param sr The serializer to use. The object must remain valid at least until the @@ -153,20 +153,18 @@ write_some( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // result of operation std::size_t bytes_transferred // the number of bytes written to the stream ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`. - @see @ref serializer + @see serializer */ template< class AsyncWriteStream, @@ -194,7 +192,7 @@ async_write_some( to the stream's `write_some` function. @param stream The stream to which the data is to be written. - The type must support the @b SyncWriteStream concept. + The type must support the SyncWriteStream concept. @param sr The serializer to use. @@ -205,7 +203,7 @@ async_write_some( @note The implementation will call @ref serializer::split with the value `true` on the serializer passed in. - @see @ref serializer + @see serializer */ template< class SyncWriteStream, @@ -229,7 +227,7 @@ write_header( to the stream's `write_some` function. @param stream The stream to which the data is to be written. - The type must support the @b SyncWriteStream concept. + The type must support the SyncWriteStream concept. @param sr The serializer to use. @@ -240,7 +238,7 @@ write_header( @note The implementation will call @ref serializer::split with the value `true` on the serializer passed in. - @see @ref serializer + @see serializer */ template< class SyncWriteStream, @@ -268,7 +266,7 @@ write_header( until this operation completes. @param stream The stream to which the data is to be written. - The type must support the @b AsyncWriteStream concept. + The type must support the AsyncWriteStream concept. @param sr The serializer to use. The object must remain valid at least until the @@ -278,14 +276,12 @@ write_header( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // result of operation std::size_t bytes_transferred // the number of bytes written to the stream ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -294,7 +290,7 @@ write_header( @note The implementation will call @ref serializer::split with the value `true` on the serializer passed in. - @see @ref serializer + @see serializer */ template< class AsyncWriteStream, @@ -322,7 +318,7 @@ async_write_header( to the stream's `write_some` function. @param stream The stream to which the data is to be written. - The type must support the @b SyncWriteStream concept. + The type must support the SyncWriteStream concept. @param sr The serializer to use. @@ -330,7 +326,7 @@ async_write_header( @throws system_error Thrown on failure. - @see @ref serializer + @see serializer */ template< class SyncWriteStream, @@ -354,7 +350,7 @@ write( to the stream's `write_some` function. @param stream The stream to which the data is to be written. - The type must support the @b SyncWriteStream concept. + The type must support the SyncWriteStream concept. @param sr The serializer to use. @@ -362,7 +358,7 @@ write( @return The number of bytes written to the stream. - @see @ref serializer + @see serializer */ template< class SyncWriteStream, @@ -390,7 +386,7 @@ write( until this operation completes. @param stream The stream to which the data is to be written. - The type must support the @b AsyncWriteStream concept. + The type must support the AsyncWriteStream concept. @param sr The serializer to use. The object must remain valid at least until the @@ -400,20 +396,18 @@ write( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // result of operation std::size_t bytes_transferred // the number of bytes written to the stream ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`. - @see @ref serializer + @see serializer */ template< class AsyncWriteStream, @@ -441,10 +435,10 @@ async_write( with an empty chunk decorator to produce buffers. @note This function only participates in overload resolution - if @ref is_mutable_body_writer for @b Body returns `true`. + if @ref is_mutable_body_writer for Body returns `true`. @param stream The stream to which the data is to be written. - The type must support the @b SyncWriteStream concept. + The type must support the SyncWriteStream concept. @param msg The message to write. @@ -452,7 +446,7 @@ async_write( @throws system_error Thrown on failure. - @see @ref message + @see message */ template< class SyncWriteStream, @@ -482,10 +476,10 @@ write( with an empty chunk decorator to produce buffers. @note This function only participates in overload resolution - if @ref is_mutable_body_writer for @b Body returns `false`. + if @ref is_mutable_body_writer for Body returns `false`. @param stream The stream to which the data is to be written. - The type must support the @b SyncWriteStream concept. + The type must support the SyncWriteStream concept. @param msg The message to write. @@ -493,7 +487,7 @@ write( @throws system_error Thrown on failure. - @see @ref message + @see message */ template< class SyncWriteStream, @@ -523,10 +517,10 @@ write( with an empty chunk decorator to produce buffers. @note This function only participates in overload resolution - if @ref is_mutable_body_writer for @b Body returns `true`. + if @ref is_mutable_body_writer for Body returns `true`. @param stream The stream to which the data is to be written. - The type must support the @b SyncWriteStream concept. + The type must support the SyncWriteStream concept. @param msg The message to write. @@ -534,7 +528,7 @@ write( @return The number of bytes written to the stream. - @see @ref message + @see message */ template< class SyncWriteStream, @@ -565,10 +559,10 @@ write( with an empty chunk decorator to produce buffers. @note This function only participates in overload resolution - if @ref is_mutable_body_writer for @b Body returns `false`. + if @ref is_mutable_body_writer for Body returns `false`. @param stream The stream to which the data is to be written. - The type must support the @b SyncWriteStream concept. + The type must support the SyncWriteStream concept. @param msg The message to write. @@ -576,7 +570,7 @@ write( @return The number of bytes written to the stream. - @see @ref message + @see message */ template< class SyncWriteStream, @@ -610,10 +604,10 @@ write( @ref serializer with an empty chunk decorator to produce buffers. @note This function only participates in overload resolution - if @ref is_mutable_body_writer for @b Body returns `true`. + if @ref is_mutable_body_writer for Body returns `true`. @param stream The stream to which the data is to be written. - The type must support the @b AsyncWriteStream concept. + The type must support the AsyncWriteStream concept. @param msg The message to write. The object must remain valid at least until the @@ -623,20 +617,18 @@ write( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // result of operation std::size_t bytes_transferred // the number of bytes written to the stream ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`. - @see @ref message + @see message */ template< class AsyncWriteStream, @@ -671,10 +663,10 @@ async_write( @ref serializer with an empty chunk decorator to produce buffers. @note This function only participates in overload resolution - if @ref is_mutable_body_writer for @b Body returns `false`. + if @ref is_mutable_body_writer for Body returns `false`. @param stream The stream to which the data is to be written. - The type must support the @b AsyncWriteStream concept. + The type must support the AsyncWriteStream concept. @param msg The message to write. The object must remain valid at least until the @@ -684,20 +676,18 @@ async_write( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error, // result of operation std::size_t bytes_transferred // the number of bytes written to the stream ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`. - @see @ref message + @see message */ template< class AsyncWriteStream, diff --git a/include/boost/beast/ssl/ssl_stream.hpp b/include/boost/beast/ssl/ssl_stream.hpp index c585c488..cfc37165 100644 --- a/include/boost/beast/ssl/ssl_stream.hpp +++ b/include/boost/beast/ssl/ssl_stream.hpp @@ -401,8 +401,7 @@ public: ); @endcode */ template - BOOST_ASIO_INITFN_RESULT_TYPE(HandshakeHandler, - void(boost::system::error_code)) + BOOST_ASIO_INITFN_RESULT_TYPE(HandshakeHandler, void(boost::system::error_code)) async_handshake(handshake_type type, BOOST_ASIO_MOVE_ARG(HandshakeHandler) handler) { @@ -432,8 +431,7 @@ public: ); @endcode */ template - BOOST_ASIO_INITFN_RESULT_TYPE(BufferedHandshakeHandler, - void(boost::system::error_code, std::size_t)) + BOOST_ASIO_INITFN_RESULT_TYPE(BufferedHandshakeHandler, void(boost::system::error_code, std::size_t)) async_handshake(handshake_type type, ConstBufferSequence const& buffers, BOOST_ASIO_MOVE_ARG(BufferedHandshakeHandler) handler) { @@ -480,8 +478,7 @@ public: ); @endcode */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ShutdownHandler, - void(boost::system::error_code)) + BOOST_ASIO_INITFN_RESULT_TYPE(ShutdownHandler, void(boost::system::error_code)) async_shutdown(BOOST_ASIO_MOVE_ARG(ShutdownHandler) handler) { return p_->next_layer().async_shutdown( @@ -559,8 +556,7 @@ public: completes. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, - void(boost::system::error_code, std::size_t)) + BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void(boost::system::error_code, std::size_t)) async_write_some(ConstBufferSequence const& buffers, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { @@ -641,8 +637,7 @@ public: the asynchronous operation completes. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, - void(boost::system::error_code, std::size_t)) + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void(boost::system::error_code, std::size_t)) async_read_some(MutableBufferSequence const& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { diff --git a/include/boost/beast/websocket/ssl.hpp b/include/boost/beast/websocket/ssl.hpp index ecf0407b..b7d62a37 100644 --- a/include/boost/beast/websocket/ssl.hpp +++ b/include/boost/beast/websocket/ssl.hpp @@ -58,13 +58,11 @@ teardown( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error // result of operation ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a diff --git a/include/boost/beast/websocket/stream.hpp b/include/boost/beast/websocket/stream.hpp index 8d66d9af..77c57791 100644 --- a/include/boost/beast/websocket/stream.hpp +++ b/include/boost/beast/websocket/stream.hpp @@ -91,9 +91,9 @@ class frame_test; @tparam NextLayer The type representing the next layer, to which data will be read and written during operations. For synchronous - operations, the type must support the @b SyncStream concept. + operations, the type must support the SyncStream concept. For asynchronous operations, the type must support the - @b AsyncStream concept. + AsyncStream concept. @tparam deflateSupported A `bool` indicating whether or not the stream will be capable of negotiating the permessage-deflate websocket @@ -105,9 +105,9 @@ class frame_test; are pending asynchronous operations associated with it. @par Concepts - @b AsyncStream, - @b DynamicBuffer, - @b SyncStream + @li AsyncStream + @li DynamicBuffer + @li SyncStream @see @li Websocket Opening Handshake Client Requirements (RFC6455) @@ -848,13 +848,11 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec // Result of operation ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -927,13 +925,11 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec // Result of operation ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -1265,13 +1261,11 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec // Result of operation ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -1328,13 +1322,11 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec // Result of operation ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -1391,13 +1383,11 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec // Result of operation ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -1525,13 +1515,11 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec // Result of operation ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -1625,13 +1613,11 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec // Result of operation ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -1728,13 +1714,11 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec // Result of operation ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -1883,14 +1867,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec, // Result of operation std::size_t bytes_written // Number of bytes appended to buffer ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -2058,14 +2040,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec, // Result of operation std::size_t bytes_written // Number of bytes appended to buffer ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -2229,14 +2209,12 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec, // Result of operation std::size_t bytes_written // Number of bytes written to the buffers ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -2346,7 +2324,6 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec, // Result of operation @@ -2355,7 +2332,6 @@ public: // this will be less than the buffer_size. ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -2467,7 +2443,6 @@ public: completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& ec, // Result of operation @@ -2476,7 +2451,6 @@ public: // this will be less than the buffer_size. ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a diff --git a/include/boost/beast/websocket/stream_base.hpp b/include/boost/beast/websocket/stream_base.hpp index d23973f7..c25df25a 100644 --- a/include/boost/beast/websocket/stream_base.hpp +++ b/include/boost/beast/websocket/stream_base.hpp @@ -57,8 +57,14 @@ struct stream_base friend class stream; public: + // Move Constructor decorator(decorator&&) = default; + /** Construct a decorator option. + + @param f An invocable function object. Ownership of + the function object is transferred by decay-copy. + */ template decorator(Decorator&& f) : d_(std::forward(f)) diff --git a/include/boost/beast/websocket/teardown.hpp b/include/boost/beast/websocket/teardown.hpp index 79f1d090..257cb1cb 100644 --- a/include/boost/beast/websocket/teardown.hpp +++ b/include/boost/beast/websocket/teardown.hpp @@ -73,13 +73,11 @@ teardown( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error // result of operation ); @endcode - Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a @@ -155,13 +153,11 @@ teardown( completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be: - @code void handler( error_code const& error // result of operation ); - @endcode - + @endcode Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a diff --git a/test/doc/exemplars.cpp b/test/doc/exemplars.cpp index 6e876de4..c09a58b0 100644 --- a/test/doc/exemplars.cpp +++ b/test/doc/exemplars.cpp @@ -87,7 +87,7 @@ public: body, no more buffers are present. @li If the optional contains a value, the first element of the - pair represents a @b ConstBufferSequence containing one or + pair represents a ConstBufferSequence containing one or more octets of the body data. The second element indicates whether or not there are additional octets of body data. A value of `true` means there is more data, and that the diff --git a/test/doc/http_snippets.cpp b/test/doc/http_snippets.cpp index 4cb6a90f..3811514e 100644 --- a/test/doc/http_snippets.cpp +++ b/test/doc/http_snippets.cpp @@ -296,10 +296,10 @@ void fxx() { /** Send a message to a stream synchronously. @param stream The stream to write to. This type must support - the @b SyncWriteStream concept. + the SyncWriteStream concept. @param m The message to send. The Body type must support - the @b BodyWriter concept. + the BodyWriter concept. */ template< class SyncWriteStream,