MySQL 8.4.2
Source Code Documentation
|
accumulates the sizes of encoded T's. More...
#include <classic_protocol_codec_base.h>
Public Types | |
using | result_type = size_t |
Public Member Functions | |
constexpr | EncodeSizeAccumulator (capabilities::value_type caps) |
construct a EncodeSizeAccumulator. More... | |
template<class T > | |
constexpr EncodeSizeAccumulator & | step (const T &v) noexcept |
accumulate the size() of encoded T. More... | |
constexpr result_type | result () const |
Private Attributes | |
size_t | consumed_ {} |
const capabilities::value_type | caps_ |
accumulates the sizes of encoded T's.
e.g. the size of tw
EncodeSizeAccumulator(caps) .step(wire::VarInt(42)) // 1 .step(wire::VarInt(512)) // 2 .result() // = 3
The class should be used together with EncodeBufferAccumulator which shares the same interface.
using classic_protocol::impl::EncodeSizeAccumulator::result_type = size_t |
|
inlineexplicitconstexpr |
construct a EncodeSizeAccumulator.
|
inlineconstexpr |
|
inlineconstexprnoexcept |
accumulate the size() of encoded T.
calls Codec<T>(v, caps).size()
|
private |
|
private |