forked from boostorg/beast
Rename to buffered_read_stream (API Change):
dynabuf_readstream is renamed to buffered_read_stream.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#include <beast/core/buffer_concepts.hpp>
|
||||
#include <beast/core/buffers_adapter.hpp>
|
||||
#include <beast/core/consuming_buffers.hpp>
|
||||
#include <beast/core/dynabuf_readstream.hpp>
|
||||
#include <beast/core/buffered_read_stream.hpp>
|
||||
#include <beast/core/error.hpp>
|
||||
#include <beast/core/flat_buffer.hpp>
|
||||
#include <beast/core/handler_alloc.hpp>
|
||||
|
||||
+11
-11
@@ -5,8 +5,8 @@
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef BEAST_DYNABUF_READSTREAM_HPP
|
||||
#define BEAST_DYNABUF_READSTREAM_HPP
|
||||
#ifndef BEAST_BUFFERED_READ_STREAM_HPP
|
||||
#define BEAST_BUFFERED_READ_STREAM_HPP
|
||||
|
||||
#include <beast/config.hpp>
|
||||
#include <beast/core/async_completion.hpp>
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
namespace beast {
|
||||
|
||||
/** A @b `Stream` with attached @b `DynamicBuffer` to buffer reads.
|
||||
/** A @b Stream with attached @b DynamicBuffer to buffer reads.
|
||||
|
||||
This wraps a @b `Stream` implementation so that calls to write are
|
||||
This wraps a @b 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
|
||||
is part of the object.
|
||||
@@ -52,7 +52,7 @@ namespace beast {
|
||||
//
|
||||
template<class DynamicBuffer>
|
||||
void process_http_message(
|
||||
dynabuf_readstream<DynamicBuffer>& stream)
|
||||
buffered_read_stream<DynamicBuffer>& stream)
|
||||
{
|
||||
// Read up to and including the end of the HTTP
|
||||
// header, leaving the sequence in the stream's
|
||||
@@ -88,7 +88,7 @@ namespace beast {
|
||||
@tparam DynamicBuffer The type of stream buffer to use.
|
||||
*/
|
||||
template<class Stream, class DynamicBuffer>
|
||||
class dynabuf_readstream
|
||||
class buffered_read_stream
|
||||
{
|
||||
static_assert(is_DynamicBuffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
@@ -102,7 +102,7 @@ class dynabuf_readstream
|
||||
|
||||
public:
|
||||
/// The type of the internal buffer
|
||||
using dynabuf_type = DynamicBuffer;
|
||||
using buffer_type = DynamicBuffer;
|
||||
|
||||
/// The type of the next layer.
|
||||
using next_layer_type =
|
||||
@@ -122,14 +122,14 @@ public:
|
||||
@note The behavior of move assignment on or from streams
|
||||
with active or pending operations is undefined.
|
||||
*/
|
||||
dynabuf_readstream(dynabuf_readstream&&) = default;
|
||||
buffered_read_stream(buffered_read_stream&&) = default;
|
||||
|
||||
/** Move assignment.
|
||||
|
||||
@note The behavior of move assignment on or from streams
|
||||
with active or pending operations is undefined.
|
||||
*/
|
||||
dynabuf_readstream& operator=(dynabuf_readstream&&) = default;
|
||||
buffered_read_stream& operator=(buffered_read_stream&&) = default;
|
||||
|
||||
/** Construct the wrapping stream.
|
||||
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
*/
|
||||
template<class... Args>
|
||||
explicit
|
||||
dynabuf_readstream(Args&&... args);
|
||||
buffered_read_stream(Args&&... args);
|
||||
|
||||
/// Get a reference to the next layer.
|
||||
next_layer_type&
|
||||
@@ -358,6 +358,6 @@ public:
|
||||
|
||||
} // beast
|
||||
|
||||
#include <beast/core/impl/dynabuf_readstream.ipp>
|
||||
#include <beast/core/impl/buffered_read_stream.ipp>
|
||||
|
||||
#endif
|
||||
+13
-13
@@ -5,8 +5,8 @@
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef BEAST_IMPL_DYNABUF_READSTREAM_HPP
|
||||
#define BEAST_IMPL_DYNABUF_READSTREAM_HPP
|
||||
#ifndef BEAST_IMPL_BUFFERED_READ_STREAM_IPP
|
||||
#define BEAST_IMPL_BUFFERED_READ_STREAM_IPP
|
||||
|
||||
#include <beast/core/bind_handler.hpp>
|
||||
#include <beast/core/error.hpp>
|
||||
@@ -18,17 +18,17 @@ namespace beast {
|
||||
|
||||
template<class Stream, class DynamicBuffer>
|
||||
template<class MutableBufferSequence, class Handler>
|
||||
class dynabuf_readstream<
|
||||
class buffered_read_stream<
|
||||
Stream, DynamicBuffer>::read_some_op
|
||||
{
|
||||
// VFALCO What about bool cont for is_continuation?
|
||||
struct data
|
||||
{
|
||||
dynabuf_readstream& srs;
|
||||
buffered_read_stream& srs;
|
||||
MutableBufferSequence bs;
|
||||
int state = 0;
|
||||
|
||||
data(Handler&, dynabuf_readstream& srs_,
|
||||
data(Handler&, buffered_read_stream& srs_,
|
||||
MutableBufferSequence const& bs_)
|
||||
: srs(srs_)
|
||||
, bs(bs_)
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
template<class DeducedHandler, class... Args>
|
||||
read_some_op(DeducedHandler&& h,
|
||||
dynabuf_readstream& srs, Args&&... args)
|
||||
buffered_read_stream& srs, Args&&... args)
|
||||
: d_(std::forward<DeducedHandler>(h),
|
||||
srs, std::forward<Args>(args)...)
|
||||
{
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
template<class Stream, class DynamicBuffer>
|
||||
template<class MutableBufferSequence, class Handler>
|
||||
void
|
||||
dynabuf_readstream<Stream, DynamicBuffer>::
|
||||
buffered_read_stream<Stream, DynamicBuffer>::
|
||||
read_some_op<MutableBufferSequence, Handler>::operator()(
|
||||
error_code const& ec, std::size_t bytes_transferred)
|
||||
{
|
||||
@@ -150,8 +150,8 @@ read_some_op<MutableBufferSequence, Handler>::operator()(
|
||||
|
||||
template<class Stream, class DynamicBuffer>
|
||||
template<class... Args>
|
||||
dynabuf_readstream<Stream, DynamicBuffer>::
|
||||
dynabuf_readstream(Args&&... args)
|
||||
buffered_read_stream<Stream, DynamicBuffer>::
|
||||
buffered_read_stream(Args&&... args)
|
||||
: next_layer_(std::forward<Args>(args)...)
|
||||
{
|
||||
}
|
||||
@@ -159,7 +159,7 @@ dynabuf_readstream(Args&&... args)
|
||||
template<class Stream, class DynamicBuffer>
|
||||
template<class ConstBufferSequence, class WriteHandler>
|
||||
auto
|
||||
dynabuf_readstream<Stream, DynamicBuffer>::
|
||||
buffered_read_stream<Stream, DynamicBuffer>::
|
||||
async_write_some(ConstBufferSequence const& buffers,
|
||||
WriteHandler&& handler) ->
|
||||
typename async_completion<
|
||||
@@ -180,7 +180,7 @@ async_write_some(ConstBufferSequence const& buffers,
|
||||
template<class Stream, class DynamicBuffer>
|
||||
template<class MutableBufferSequence>
|
||||
std::size_t
|
||||
dynabuf_readstream<Stream, DynamicBuffer>::
|
||||
buffered_read_stream<Stream, DynamicBuffer>::
|
||||
read_some(
|
||||
MutableBufferSequence const& buffers)
|
||||
{
|
||||
@@ -199,7 +199,7 @@ read_some(
|
||||
template<class Stream, class DynamicBuffer>
|
||||
template<class MutableBufferSequence>
|
||||
std::size_t
|
||||
dynabuf_readstream<Stream, DynamicBuffer>::
|
||||
buffered_read_stream<Stream, DynamicBuffer>::
|
||||
read_some(MutableBufferSequence const& buffers,
|
||||
error_code& ec)
|
||||
{
|
||||
@@ -228,7 +228,7 @@ read_some(MutableBufferSequence const& buffers,
|
||||
template<class Stream, class DynamicBuffer>
|
||||
template<class MutableBufferSequence, class ReadHandler>
|
||||
auto
|
||||
dynabuf_readstream<Stream, DynamicBuffer>::
|
||||
buffered_read_stream<Stream, DynamicBuffer>::
|
||||
async_read_some(
|
||||
MutableBufferSequence const& buffers,
|
||||
ReadHandler&& handler) ->
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <beast/http/message.hpp>
|
||||
#include <beast/http/string_body.hpp>
|
||||
#include <beast/core/async_completion.hpp>
|
||||
#include <beast/core/dynabuf_readstream.hpp>
|
||||
#include <beast/core/buffered_read_stream.hpp>
|
||||
#include <beast/core/detail/get_lowest_layer.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
@@ -98,7 +98,7 @@ class stream : public detail::stream_base
|
||||
{
|
||||
friend class stream_test;
|
||||
|
||||
dynabuf_readstream<NextLayer, multi_buffer> stream_;
|
||||
buffered_read_stream<NextLayer, multi_buffer> stream_;
|
||||
|
||||
public:
|
||||
/// The type of the next layer.
|
||||
|
||||
Reference in New Issue
Block a user