OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::istream_serializer Class Referencefinal

Implementation of serializer for reading from a std::istream. More...

#include <istream_serializer.hpp>

Inheritance diagram for cbdc::istream_serializer:
Collaboration diagram for cbdc::istream_serializer:

Public Member Functions

 istream_serializer (std::istream &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 reading from the stream.
 
void reset () final
 Seeks the stream position to the beginning.
 
auto write (const void *data, size_t len) -> bool final
 Not implemented for istream.
 
auto read (void *data, size_t len) -> bool final
 Attempts to read the given number of bytes from the current position in the stream.
 
- Public Member Functions inherited from cbdc::stream_serializer
 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
 

Additional Inherited Members

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

Detailed Description

Implementation of serializer for reading from a std::istream.

Definition at line 16 of file istream_serializer.hpp.

Constructor & Destructor Documentation

◆ istream_serializer()

cbdc::istream_serializer::istream_serializer ( std::istream & s)
explicit

Constructor.

Parameters
sistream to serialize from.

Definition at line 12 of file istream_serializer.cpp.

Member Function Documentation

◆ advance_cursor()

void cbdc::istream_serializer::advance_cursor ( size_t len)
finalvirtual

Moves the stream forward without reading from the stream.

Parameters
lennumber of bytes by which to move the stream forward.

Implements cbdc::serializer.

Definition at line 26 of file istream_serializer.cpp.

◆ end_of_buffer()

auto cbdc::istream_serializer::end_of_buffer ( ) const -> bool
nodiscardfinalvirtual

Indicates whether the serializer has reached the end of the stream.

Returns
true if the istream has reached the end of the stream.

Implements cbdc::serializer.

Definition at line 16 of file istream_serializer.cpp.

◆ read()

auto cbdc::istream_serializer::read ( void * data,
size_t len ) -> bool
finalvirtual

Attempts to read the given number of bytes from the current position in the stream.

Parameters
datamemory location to write the bytes.
lennumber of bytes to read from the stream.
Returns
true if the operation read the requested number of bytes from the stream into the destination.

Implements cbdc::serializer.

Definition at line 41 of file istream_serializer.cpp.

◆ reset()

void cbdc::istream_serializer::reset ( )
finalvirtual

Seeks the stream position to the beginning.

Implements cbdc::serializer.

Definition at line 30 of file istream_serializer.cpp.

◆ write()

auto cbdc::istream_serializer::write ( const void * data,
size_t len ) -> bool
finalvirtual

Not implemented for istream.

Returns
false.

Implements cbdc::serializer.

Definition at line 35 of file istream_serializer.cpp.


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