MySQL 8.0.39
Source Code Documentation
|
Generator of decoded Types of a buffer. More...
#include <classic_protocol_codec_base.h>
Public Types | |
using | buffer_type = net::const_buffer |
using | result_type = stdx::expected< size_t, std::error_code > |
Public Member Functions | |
DecodeBufferAccumulator (const net::const_buffer &buffer, capabilities::value_type caps, size_t consumed=0) | |
construct a DecodeBufferAccumulator. More... | |
template<class T > | |
stdx::expected< typename Codec< T >::value_type, std::error_code > | step (size_t sz=std::numeric_limits< size_t >::max()) |
decode a Type from the buffer sequence. More... | |
template<class T > | |
stdx::expected< typename Codec< T >::value_type, std::error_code > | try_step (size_t sz=std::numeric_limits< size_t >::max()) |
try decoding a Type from the buffer sequence. More... | |
result_type | result () const |
get result of the step(). More... | |
Private Member Functions | |
template<class T > | |
stdx::expected< typename Codec< T >::value_type, std::error_code > | step_ (size_t sz) |
Private Attributes | |
net::const_buffer | buffer_ |
const capabilities::value_type | caps_ |
size_t | consumed_ |
result_type | res_ |
Generator of decoded Types of a buffer.
using classic_protocol::impl::DecodeBufferAccumulator::result_type = stdx::expected<size_t, std::error_code> |
|
inline |
construct a DecodeBufferAccumulator.
buffer | a net::const_buffer |
caps | classic-protocol capabilities |
consumed | bytes to skip from the buffers |
|
inline |
get result of the step().
if a step() failed, result is the error-code of the first failed step()
|
inline |
decode a Type from the buffer sequence.
if it succeeds, moves position in buffer forward and returns decoded Type, otherwise returns error and updates the global error-code in result()
'sz' is unlimited, the whole rest of the current buffer is passed to the decoder.
If not, a slice of size 'sz' is taken. If there isn't at least 'sz' bytes in the buffer, it fails.
sz | limits the size of the current buffer. |
|
inlineprivate |
|
inline |
try decoding a Type from the buffer sequence.
if it succeeds, moves position in buffer-sequence forward and returns decoded Type, otherwise returns error and does NOT update the global error-code in result()
|
private |
|
private |
|
private |
|
private |