StormByte C++ Library: Buffer module 0.0.9999
StormByte-Buffer is a StormByte library module for handling buffers
Loading...
Searching...
No Matches
Public Member Functions | List of all members
StormByte::Buffer::ExternalReader Class Referenceabstract

Interface for reading data from an external source. More...

#include <external.hxx>

Inheritance diagram for StormByte::Buffer::ExternalReader:
Inheritance graph
[legend]
Collaboration diagram for StormByte::Buffer::ExternalReader:
Collaboration graph
[legend]

Public Member Functions

 ExternalReader () noexcept=default
 Construct ExternalReader.
 
 ExternalReader (const ExternalReader &other)=default
 Construct ExternalReader.
 
 ExternalReader (ExternalReader &&other) noexcept=default
 Move constructor.
 
virtual ~ExternalReader () noexcept=default
 Destructor.
 
ExternalReaderoperator= (const ExternalReader &other)=default
 Assignment operator.
 
ExternalReaderoperator= (ExternalReader &&other) noexcept=default
 Move assignment operator.
 
virtual bool Read (std::size_t bytes, DataType &out) const noexcept=0
 Read data into the provided buffer.
 
virtual bool Read (std::size_t bytes, DataType &out) noexcept=0
 Read data into the provided buffer.
 

Detailed Description

Interface for reading data from an external source.

This class defines the interface for reading data from an external source such as a file, network socket, or other I/O stream. It provides methods for reading data into a buffer.

Note
This class is intended to be used as a base class for specific implementations that handle different types of external data sources.

Constructor & Destructor Documentation

◆ ExternalReader() [1/2]

StormByte::Buffer::ExternalReader::ExternalReader ( const ExternalReader other)
default

Construct ExternalReader.

Parameters
otherExternalReader to copy from.

◆ ExternalReader() [2/2]

StormByte::Buffer::ExternalReader::ExternalReader ( ExternalReader &&  other)
defaultnoexcept

Move constructor.

Parameters
otherExternalReader to move from.

Member Function Documentation

◆ operator=() [1/2]

ExternalReader & StormByte::Buffer::ExternalReader::operator= ( const ExternalReader other)
default

Assignment operator.

Parameters
otherExternalReader to copy from.
Returns
Reference to this ExternalReader.

◆ operator=() [2/2]

ExternalReader & StormByte::Buffer::ExternalReader::operator= ( ExternalReader &&  other)
defaultnoexcept

Move assignment operator.

Parameters
otherExternalReader to move from.
Returns
Reference to this ExternalReader.

◆ Read() [1/2]

virtual bool StormByte::Buffer::ExternalReader::Read ( std::size_t  bytes,
DataType &  out 
) const
pure virtualnoexcept

Read data into the provided buffer.

Parameters
bytesNumber of bytes to read.
outDataType to fill with read data.
Returns
true if data was successfully read, false otherwise.

Implemented in StormByte::Buffer::ExternalBufferReader.

◆ Read() [2/2]

virtual bool StormByte::Buffer::ExternalReader::Read ( std::size_t  bytes,
DataType &  out 
)
pure virtualnoexcept

Read data into the provided buffer.

Parameters
bytesNumber of bytes to read.
outDataType to fill with read data.
Returns
true if data was successfully read, false otherwise.
Note
Non-const version for mutable readers or destructive read operations.

Implemented in StormByte::Buffer::ExternalBufferReader.


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