OpenCBDC Transaction Processor
|
Implementation of serializer for writing to a std::ostream. More...
#include <ostream_serializer.hpp>
Public Member Functions | |
ostream_serializer (std::ostream &s) | |
Constructor. | |
auto | end_of_buffer () const -> bool final |
Indicates whether the serializer has reached the end of the stream. | |
void | advance_cursor (size_t len) final |
Moves the stream forward without writing to the stream. | |
void | reset () final |
Seeks the stream position to the beginning. | |
auto | write (const void *data, size_t len) -> bool final |
Attempts to write the given number of bytes from the given memory location to the stream's current position. | |
auto | read (void *data, size_t len) -> bool final |
Not implemented for ostream. | |
![]() | |
stream_serializer (std::ios &s) | |
Constructor. | |
operator bool () const final | |
Indicates whether the last serialization operation succeeded. | |
![]() | |
virtual | ~serializer ()=default |
serializer (const serializer &)=delete | |
auto | operator= (const serializer &)=delete |
serializer (serializer &&)=delete | |
auto | operator= (serializer &&)=delete |
Additional Inherited Members | |
![]() | |
serializer ()=default | |
Implementation of serializer for writing to a std::ostream.
Definition at line 15 of file ostream_serializer.hpp.
|
explicit |
Constructor.
s | ostream to serialize into. |
Definition at line 12 of file ostream_serializer.cpp.
|
finalvirtual |
Moves the stream forward without writing to the stream.
len | number of bytes by which to move the stream forward. |
Implements cbdc::serializer.
Definition at line 26 of file ostream_serializer.cpp.
|
nodiscardfinalvirtual |
Indicates whether the serializer has reached the end of the stream.
Implements cbdc::serializer.
Definition at line 16 of file ostream_serializer.cpp.
|
finalvirtual |
Not implemented for ostream.
Implements cbdc::serializer.
Definition at line 42 of file ostream_serializer.cpp.
|
finalvirtual |
Seeks the stream position to the beginning.
Implements cbdc::serializer.
Definition at line 30 of file ostream_serializer.cpp.
|
finalvirtual |
Attempts to write the given number of bytes from the given memory location to the stream's current position.
data | memory location from which to write data into the stream. |
len | number of bytes to write into the stream. |
Implements cbdc::serializer.
Definition at line 35 of file ostream_serializer.cpp.