6#ifndef OPENCBDC_TX_SRC_SERIALIZATION_SIZE_SERIALIZER_H_
7#define OPENCBDC_TX_SRC_SERIALIZATION_SIZE_SERIALIZER_H_
23 explicit operator bool() const final;
41 auto
write(const
void* data,
size_t len) ->
bool final;
45 auto
read(
void* data,
size_t len) ->
bool final;
50 [[nodiscard]] auto
size() const ->
size_t;
Interface for serializing objects into and out of raw bytes representations.
Utility class for determining the size of a buffer needed to serialize a sequence of objects.
auto size() const -> size_t
Returns the number of bytes accumulated in the size counter during mock serialization.
auto read(void *data, size_t len) -> bool final
Read is not implemented for size serializer.
auto end_of_buffer() const -> bool final
Size serializer has no underlying buffer so this method always returns false.
size_serializer()=default
void reset() final
Resets the size counter to zero.
void advance_cursor(size_t len) final
Increases the size counter by the given number of bytes.
auto write(const void *data, size_t len) -> bool final
Increases size counter by the given number of bytes.