OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::stream_serializer Class Reference

Implementation of serializer for std::ios. More...

#include <stream_serializer.hpp>

Inheritance diagram for cbdc::stream_serializer:
Collaboration diagram for cbdc::stream_serializer:

Public Member Functions

 stream_serializer (std::ios &s)
 Constructor.
 
 operator bool () const final
 Indicates whether the last serialization operation succeeded.
 
- Public Member Functions inherited from cbdc::serializer
virtual ~serializer ()=default
 
 serializer (const serializer &)=delete
 
auto operator= (const serializer &)=delete
 
 serializer (serializer &&)=delete
 
auto operator= (serializer &&)=delete
 
virtual void advance_cursor (size_t len)=0
 Moves the serialization cursor forward by the given number of bytes.
 
virtual void reset ()=0
 Resets the cursor to the start of the buffer.
 
virtual auto end_of_buffer () const -> bool=0
 Indicates whether the cursor is at or beyond the end of the buffer.
 
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.
 
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 location.
 

Additional Inherited Members

- Protected Member Functions inherited from cbdc::serializer
 serializer ()=default
 

Detailed Description

Implementation of serializer for std::ios.

Cannot be used directly. Must be specialized for the stream type.

See also
istream_serializer

Definition at line 18 of file stream_serializer.hpp.

Constructor & Destructor Documentation

◆ stream_serializer()

cbdc::stream_serializer::stream_serializer ( std::ios & s)
explicit

Constructor.

Parameters
sIO stream to serialize into or from.

Definition at line 9 of file stream_serializer.cpp.

Member Function Documentation

◆ operator bool()

cbdc::stream_serializer::operator bool ( ) const
explicitfinalvirtual

Indicates whether the last serialization operation succeeded.

Returns
true if the last serialization operation succeeded.

Implements cbdc::serializer.

Definition at line 11 of file stream_serializer.cpp.


The documentation for this class was generated from the following files: