Add flat_static_buffer::mutable_data

This commit is contained in:
Vinnie Falco
2017-07-15 09:47:56 -07:00
parent cda710bda0
commit 6fa9a97727
4 changed files with 29 additions and 0 deletions
+13
View File
@@ -51,6 +51,12 @@ public:
*/
using const_buffers_type = boost::asio::const_buffers_1;
/** The type used to represent the mutable input sequence as a list of buffers.
This buffer sequence is guaranteed to have length 1.
*/
using mutable_data_type = boost::asio::mutable_buffers_1;
/** The type used to represent the output sequence as a list of buffers.
This buffer sequence is guaranteed to have length 1.
@@ -98,6 +104,13 @@ public:
const_buffers_type
data() const;
/** Get a list of mutable buffers that represent the input sequence.
@note These buffers remain valid across subsequent calls to `prepare`.
*/
mutable_data_type
mutable_data();
/** Get a list of buffers that represent the output sequence, with the given size.
@throws std::length_error if the size would exceed the limit
@@ -32,6 +32,15 @@ data() const ->
return {in_, dist(in_, out_)};
}
inline
auto
flat_static_buffer_base::
mutable_data() ->
mutable_data_type
{
return {in_, dist(in_, out_)};
}
inline
auto
flat_static_buffer_base::