diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c11f1ba..8467773c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Version 110: * Refactor stream open state variable * Refactor websocket stream members * Refactor websocket stream: fixes and tests +* Add test::stream::lowest_layer -------------------------------------------------------------------------------- diff --git a/test/extras/include/boost/beast/test/stream.hpp b/test/extras/include/boost/beast/test/stream.hpp index 3d32bc0f..75b20076 100644 --- a/test/extras/include/boost/beast/test/stream.hpp +++ b/test/extras/include/boost/beast/test/stream.hpp @@ -113,6 +113,9 @@ class stream public: using buffer_type = flat_buffer; + /// The type of the lowest layer. + using lowest_layer_type = stream; + /// Destructor ~stream() { @@ -209,6 +212,34 @@ public: return in_->ios; } + /** Get a reference to the lowest layer + + This function returns a reference to the lowest layer + in a stack of stream layers. + + @return A reference to the lowest layer in the stack of + stream layers. + */ + lowest_layer_type& + lowest_layer() + { + return *this; + } + + /** Get a reference to the lowest layer + + This function returns a reference to the lowest layer + in a stack of stream layers. + + @return A reference to the lowest layer in the stack of + stream layers. Ownership is not transferred to the caller. + */ + lowest_layer_type const& + lowest_layer() const + { + return *this; + } + /// Set the maximum number of bytes returned by read_some void read_size(std::size_t n)