6#ifndef OPENCBDC_TX_SRC_SERIALIZATION_SERIALIZER_H_
7#define OPENCBDC_TX_SRC_SERIALIZATION_SERIALIZER_H_
24 virtual explicit operator bool()
const = 0;
45 virtual auto
write(const
void* data,
size_t len) ->
bool = 0;
54 virtual auto
read(
void* data,
size_t len) ->
bool = 0;
Interface for serializing objects into and out of raw bytes representations.
serializer(serializer &&)=delete
virtual ~serializer()=default
virtual void advance_cursor(size_t len)=0
Moves the serialization cursor forward by the given number of bytes.
virtual auto end_of_buffer() const -> bool=0
Indicates whether the cursor is at or beyond the end of the buffer.
auto operator=(const serializer &)=delete
serializer(const serializer &)=delete
virtual auto write(const void *data, size_t len) -> bool=0
Attempts to write the given raw data into the buffer starting at the current cursor position.
auto operator=(serializer &&)=delete
virtual void reset()=0
Resets the cursor to the start of the buffer.
virtual auto read(void *data, size_t len) -> bool=0
Attempts to read the requested number of bytes from the current cursor position into the given memory...