![]() |
MySQL 9.0.0
Source Code Documentation
|
accumulator of encoded buffers. More...
#include <classic_protocol_codec_base.h>
Public Types | |
using | result_type = stdx::expected< size_t, std::error_code > |
Public Member Functions | |
EncodeBufferAccumulator (net::mutable_buffer buffer, capabilities::value_type caps, size_t consumed=0) | |
construct a encode-buffer-accumulator. More... | |
template<class T > | |
EncodeBufferAccumulator & | step (const T &v) |
encode a T into the buffer and move position forward. More... | |
result_type | result () const |
get result the steps(). More... | |
Private Attributes | |
const net::mutable_buffer | buffer_ |
const capabilities::value_type | caps_ |
size_t | consumed_ {} |
result_type | res_ |
accumulator of encoded buffers.
writes the .step()ed encoded types into buffer.
EncodeBufferAccumulator(buffer, caps) .step(wire::VarInt(42)) .step(wire::VarInt(512)) .result()
The class should be used together with EncodeSizeAccumulator which shares the same interface.
using classic_protocol::impl::EncodeBufferAccumulator::result_type = stdx::expected<size_t, std::error_code> |
|
inline |
construct a encode-buffer-accumulator.
buffer | mutable-buffer to encode into |
caps | protocol capabilities |
consumed | bytes already used in the in buffer |
|
inline |
get result the steps().
|
inline |
encode a T into the buffer and move position forward.
no-op of a previous step failed.
|
private |
|
private |
|
private |
|
private |