StormByte-Network 4.0.0
C++26 networking module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Network::BufferedRemoteFileReader Class Referencefinal

File-like buffered reader backed by a peer DataPlane and mount token. More...

#include <StormByte/network/remote_file.hxx>

Inheritance diagram for StormByte::Network::BufferedRemoteFileReader:
Collaboration diagram for StormByte::Network::BufferedRemoteFileReader:

Public Member Functions

 BufferedRemoteFileReader (const BufferedRemoteFileReader &)=delete
 Copy construction is disabled.
 BufferedRemoteFileReader (BufferedRemoteFileReader &&)=delete
 Move construction is disabled while a mount token is registered.
BufferedRemoteFileReader & operator= (const BufferedRemoteFileReader &)=delete
 Copy assignment is disabled.
BufferedRemoteFileReader & operator= (BufferedRemoteFileReader &&)=delete
 Move assignment is disabled while a mount token is registered.
 ~BufferedRemoteFileReader () noexcept override
 Release this leaf's token before base destruction.
Public Member Functions inherited from StormByte::Buffer::IO::BufferedLocationReader
 BufferedLocationReader (const BufferedLocationReader &)=delete
 BufferedLocationReader (BufferedLocationReader &&other) noexcept
virtual ~BufferedLocationReader () noexcept override
BufferedLocationReader & operator= (const BufferedLocationReader &)=delete
BufferedLocationReader & operator= (BufferedLocationReader &&other) noexcept
StormByte::Safe::Shared< StormByte::System::Device > Device () const
Public Member Functions inherited from StormByte::Buffer::IO::BufferedReader
const StormByte::Safe::String & Path () const noexcept
enum Location Location () const noexcept
virtual operator bool () const noexcept final
virtual enum State State () const noexcept final
 BufferedReader (const BufferedReader &)=delete
 BufferedReader (BufferedReader &&other) noexcept
virtual ~BufferedReader () noexcept
BufferedReader & operator= (const BufferedReader &)=delete
BufferedReader & operator= (BufferedReader &&other) noexcept
virtual bool Open () final
virtual Result Close () final
virtual bool Rewind () final
virtual bool IsOpen () const noexcept final
virtual bool IsReadable () const noexcept final
virtual bool EoF () const noexcept final
virtual StormByte::ByteSize Available () const noexcept final
virtual Result Read (StormByte::ByteSize n, FIFO &dest) const final
virtual Result Read (std::span< std::byte > dest) const final
virtual Result Peek (StormByte::ByteSize n, FIFO &dest) const final
virtual Result Peek (std::span< std::byte > dest) const final
virtual Result Seek (std::ptrdiff_t offset, Position mode) const final
virtual StormByte::ByteSize Tell () const noexcept final
virtual bool IsSeekable () const noexcept final
virtual bool IsSized () const noexcept final
virtual StormByte::Safe::Optional< StormByte::ByteSize > Size () const noexcept final
const StormByte::Safe::Shared< StormByte::Buffer::ReadTelemetry > Telemetry () const noexcept
StormByte::ByteSize ReadAhead () const noexcept
StormByte::ByteSize ReadChunk () const noexcept
void ReadChunk (StormByte::ByteSize bytes)
ReaderConfiguration Configuration () const noexcept
Result Configure (ReaderConfiguration configuration)
TransferSnapshot Transfers () const noexcept
void ReadAhead (StormByte::ByteSize bytes)
StormByte::ByteSize MaxMemory () const noexcept
void MaxMemory (StormByte::ByteSize bytes)
std::chrono::milliseconds MaxWait () const noexcept
void MaxWait (std::chrono::milliseconds wait)
 BufferedReader (const BufferedReader &)=delete
 BufferedReader (BufferedReader &&other) noexcept
virtual ~BufferedReader () noexcept
BufferedReader & operator= (const BufferedReader &)=delete
BufferedReader & operator= (BufferedReader &&other) noexcept
virtual bool Open () final
virtual Result Close () final
virtual bool Rewind () final
virtual bool IsOpen () const noexcept final
virtual bool IsReadable () const noexcept final
virtual bool EoF () const noexcept final
virtual StormByte::ByteSize Available () const noexcept final
virtual Result Read (StormByte::ByteSize n, FIFO &dest) const final
virtual Result Read (std::span< std::byte > dest) const final
virtual Result Peek (StormByte::ByteSize n, FIFO &dest) const final
virtual Result Peek (std::span< std::byte > dest) const final
virtual Result Seek (std::ptrdiff_t offset, Position mode) const final
virtual StormByte::ByteSize Tell () const noexcept final
virtual bool IsSeekable () const noexcept final
virtual bool IsSized () const noexcept final
virtual StormByte::Safe::Optional< StormByte::ByteSize > Size () const noexcept final
const StormByte::Safe::Shared< StormByte::Buffer::ReadTelemetry > Telemetry () const noexcept
StormByte::ByteSize ReadAhead () const noexcept
StormByte::ByteSize ReadChunk () const noexcept
void ReadChunk (StormByte::ByteSize bytes)
ReaderConfiguration Configuration () const noexcept
Result Configure (ReaderConfiguration configuration)
TransferSnapshot Transfers () const noexcept
void ReadAhead (StormByte::ByteSize bytes)
StormByte::ByteSize MaxMemory () const noexcept
void MaxMemory (StormByte::ByteSize bytes)
std::chrono::milliseconds MaxWait () const noexcept
void MaxWait (std::chrono::milliseconds wait)

Protected Member Functions

StormByte::Safe::Shared< StormByte::System::Device > OriginDevice () const override
 Network-interface snapshot for this connected origin.
bool OriginDeviceUsable (const StormByte::Safe::Shared< StormByte::System::Device > &device) const noexcept override
 Accept the network device without probing its accessor as a filesystem path.
Buffer::IO::Result OriginOpen () override
 Open the token's server-side reader handle.
Buffer::IO::Result OriginClose () override
 Release this reader token without closing the peer plane.
Buffer::IO::Result OriginPull (StormByte::ByteSize count, Buffer::FIFO &destination) override
 Pull one protocol-bounded segment at this leaf's absolute logical offset.
Buffer::IO::Result OriginSeek (std::ptrdiff_t offset, Buffer::Position mode) override
 Move only this Buffer leaf's logical cursor.
StormByte::Safe::Optional< StormByte::ByteSize > OriginSize () const noexcept override
 Query the server-side file length.
Protected Member Functions inherited from StormByte::Buffer::IO::BufferedLocationReader
 BufferedLocationReader (StormByte::Safe::String path, enum Location location, Unpacked knobs)
bool OriginCanSeek () const noexcept final
bool OriginHasSize () const noexcept final
void Setup () final
Protected Member Functions inherited from StormByte::Buffer::IO::BufferedReader
STORMBYTE_FORCE_INLINE BufferedReader (StormByte::Safe::String path, enum Location location, Parameters parameters={})
 BufferedReader (StormByte::Safe::String path, enum Location location, ReaderConfiguration configuration)
void SetState (enum State state) noexcept
virtual StormByte::Safe::Shared< StormByte::Buffer::ReadTelemetry > CreateTelemetry () const

Friends

class Client
 Client may construct mounted reader leaves.
template<class T, class... Args>
StormByte::Safe::Unique< T > StormByte::Safe::MakeUnique (Args &&...)
 Allow the Base heap factory to construct this private Network leaf.

Detailed Description

File-like buffered reader backed by a peer DataPlane and mount token.

The peer-scoped data plane owns the socket and heartbeat; each leaf has one capability and an independent logical file offset.

Constructor & Destructor Documentation

◆ BufferedRemoteFileReader() [1/2]

StormByte::Network::BufferedRemoteFileReader::BufferedRemoteFileReader ( const BufferedRemoteFileReader & )
delete

Copy construction is disabled.

Parameters
The unnamed parameter is the reader that cannot be copied.

◆ BufferedRemoteFileReader() [2/2]

StormByte::Network::BufferedRemoteFileReader::BufferedRemoteFileReader ( BufferedRemoteFileReader && )
delete

Move construction is disabled while a mount token is registered.

Parameters
The unnamed parameter is the reader that cannot be moved.

◆ ~BufferedRemoteFileReader()

StormByte::Network::BufferedRemoteFileReader::~BufferedRemoteFileReader ( )
overridenoexcept

Release this leaf's token before base destruction.

The DataPlane owns the heartbeat.

Member Function Documentation

◆ operator=() [1/2]

BufferedRemoteFileReader & StormByte::Network::BufferedRemoteFileReader::operator= ( BufferedRemoteFileReader && )
delete

Move assignment is disabled while a mount token is registered.

Parameters
The unnamed parameter is the reader that cannot be moved.
Returns
No value; this operation is deleted.

◆ operator=() [2/2]

BufferedRemoteFileReader & StormByte::Network::BufferedRemoteFileReader::operator= ( const BufferedRemoteFileReader & )
delete

Copy assignment is disabled.

Parameters
The unnamed parameter is the reader that cannot be copied.
Returns
No value; this operation is deleted.

◆ OriginClose()

Buffer::IO::Result StormByte::Network::BufferedRemoteFileReader::OriginClose ( )
overrideprotectedvirtual

Release this reader token without closing the peer plane.

Returns
Result of releasing the reader channel.

Implements StormByte::Buffer::IO::BufferedReader.

◆ OriginDevice()

StormByte::Safe::Shared< StormByte::System::Device > StormByte::Network::BufferedRemoteFileReader::OriginDevice ( ) const
overrideprotectedvirtual

Network-interface snapshot for this connected origin.

Returns
Connected origin device, or an empty pointer if unavailable.

Implements StormByte::Buffer::IO::BufferedLocationReader.

◆ OriginDeviceUsable()

bool StormByte::Network::BufferedRemoteFileReader::OriginDeviceUsable ( const StormByte::Safe::Shared< StormByte::System::Device > & device) const
overrideprotectedvirtualnoexcept

Accept the network device without probing its accessor as a filesystem path.

Parameters
deviceOrigin device to check.
Returns
Whether the device is usable as a network origin.

Reimplemented from StormByte::Buffer::IO::BufferedLocationReader.

◆ OriginOpen()

Buffer::IO::Result StormByte::Network::BufferedRemoteFileReader::OriginOpen ( )
overrideprotectedvirtual

Open the token's server-side reader handle.

Returns
Result of opening the reader channel.

Implements StormByte::Buffer::IO::BufferedReader.

◆ OriginPull()

Buffer::IO::Result StormByte::Network::BufferedRemoteFileReader::OriginPull ( StormByte::ByteSize count,
Buffer::FIFO & destination )
overrideprotectedvirtual

Pull one protocol-bounded segment at this leaf's absolute logical offset.

Parameters
countMaximum number of bytes to read.
destinationFIFO receiving the bytes.
Returns
Read result and transferred byte count, or an error.

Implements StormByte::Buffer::IO::BufferedReader.

◆ OriginSeek()

Buffer::IO::Result StormByte::Network::BufferedRemoteFileReader::OriginSeek ( std::ptrdiff_t offset,
Buffer::Position mode )
overrideprotectedvirtual

Move only this Buffer leaf's logical cursor.

Parameters
offsetSigned displacement relative to the selected position.
modeReference position for the displacement.
Returns
Seek result, or an error for an invalid position.

Implements StormByte::Buffer::IO::BufferedReader.

◆ OriginSize()

StormByte::Safe::Optional< StormByte::ByteSize > StormByte::Network::BufferedRemoteFileReader::OriginSize ( ) const
overrideprotectedvirtualnoexcept

Query the server-side file length.

Returns
File length in bytes, or an empty value if unavailable.

Implements StormByte::Buffer::IO::BufferedReader.

◆ Client

friend class Client
friend

Client may construct mounted reader leaves.

◆ StormByte::Safe::MakeUnique

template<class T, class... Args>
StormByte::Safe::Unique< T > StormByte::Safe::MakeUnique ( Args && ...)
friend

Allow the Base heap factory to construct this private Network leaf.

Template Parameters
TType constructed on Base's heap.
ArgsConstructor argument types.
Parameters
The unnamed argument pack supplies forwarded constructor arguments.
Returns
Unique owner of the constructed leaf.

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