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

File-like buffered writer with an exclusive server-side mount. More...

#include <StormByte/network/remote_file.hxx>

Inheritance diagram for StormByte::Network::BufferedRemoteFileWriter:
Collaboration diagram for StormByte::Network::BufferedRemoteFileWriter:

Public Member Functions

 BufferedRemoteFileWriter (const BufferedRemoteFileWriter &)=delete
 Copy construction is disabled.
 BufferedRemoteFileWriter (BufferedRemoteFileWriter &&)=delete
 Move construction is disabled while a mount token is registered.
BufferedRemoteFileWriter & operator= (const BufferedRemoteFileWriter &)=delete
 Copy assignment is disabled.
BufferedRemoteFileWriter & operator= (BufferedRemoteFileWriter &&)=delete
 Move assignment is disabled while a mount token is registered.
 ~BufferedRemoteFileWriter () noexcept override
 Release this leaf's token before base destruction.
Public Member Functions inherited from StormByte::Buffer::IO::BufferedLocationWriter
 BufferedLocationWriter (const BufferedLocationWriter &)=delete
 BufferedLocationWriter (BufferedLocationWriter &&other) noexcept
virtual ~BufferedLocationWriter () noexcept override
BufferedLocationWriter & operator= (const BufferedLocationWriter &)=delete
BufferedLocationWriter & operator= (BufferedLocationWriter &&other) noexcept
StormByte::Safe::Shared< StormByte::System::Device > Device () const
bool IsSeekable () const noexcept
bool IsSized () const noexcept
StormByte::ByteSize Size () const noexcept final
Public Member Functions inherited from StormByte::Buffer::IO::BufferedWriter
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
 BufferedWriter (const BufferedWriter &)=delete
 BufferedWriter (BufferedWriter &&other) noexcept
virtual ~BufferedWriter () noexcept
BufferedWriter & operator= (const BufferedWriter &)=delete
BufferedWriter & operator= (BufferedWriter &&other) noexcept
virtual bool Open () final
virtual bool Close () final
virtual bool Rewind () final
virtual bool IsOpen () const noexcept final
virtual Result Flush () final
virtual Result Truncate () final
virtual Result Write (const FIFO &src) final
virtual Result Write (FIFO &src) final
virtual Result Write (std::span< const std::byte > src) final
virtual StormByte::ByteSize Tell () const noexcept
virtual StormByte::ByteSize Dirty () const noexcept
virtual Result Seek (std::ptrdiff_t offset, Position mode)
const StormByte::Safe::Shared< StormByte::Buffer::WriteTelemetry > Telemetry () const noexcept
StormByte::ByteSize WriteChunk () const noexcept
StormByte::ByteSize WriteTransfer () const noexcept
void WriteTransfer (StormByte::ByteSize bytes)
StormByte::ByteSize WriteThreshold () const noexcept
void WriteThreshold (StormByte::ByteSize bytes)
WriterConfiguration Configuration () const noexcept
Result Configure (WriterConfiguration configuration)
TransferSnapshot Transfers () const noexcept
void WriteChunk (StormByte::ByteSize bytes)
std::size_t BackPressure () const noexcept
void BackPressure (std::size_t chunks)
StormByte::ByteSize MaxMemory () const noexcept
void MaxMemory (StormByte::ByteSize bytes)
std::chrono::milliseconds MaxWait () const noexcept
void MaxWait (std::chrono::milliseconds wait)
 BufferedWriter (const BufferedWriter &)=delete
 BufferedWriter (BufferedWriter &&other) noexcept
virtual ~BufferedWriter () noexcept
BufferedWriter & operator= (const BufferedWriter &)=delete
BufferedWriter & operator= (BufferedWriter &&other) noexcept
virtual bool Open () final
virtual bool Close () final
virtual bool Rewind () final
virtual bool IsOpen () const noexcept final
virtual Result Flush () final
virtual Result Truncate () final
virtual Result Write (const FIFO &src) final
virtual Result Write (FIFO &src) final
virtual Result Write (std::span< const std::byte > src) final
virtual StormByte::ByteSize Tell () const noexcept
virtual StormByte::ByteSize Dirty () const noexcept
virtual Result Seek (std::ptrdiff_t offset, Position mode)
const StormByte::Safe::Shared< StormByte::Buffer::WriteTelemetry > Telemetry () const noexcept
StormByte::ByteSize WriteChunk () const noexcept
StormByte::ByteSize WriteTransfer () const noexcept
void WriteTransfer (StormByte::ByteSize bytes)
StormByte::ByteSize WriteThreshold () const noexcept
void WriteThreshold (StormByte::ByteSize bytes)
WriterConfiguration Configuration () const noexcept
Result Configure (WriterConfiguration configuration)
TransferSnapshot Transfers () const noexcept
void WriteChunk (StormByte::ByteSize bytes)
std::size_t BackPressure () const noexcept
void BackPressure (std::size_t chunks)
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 this writer token on the peer plane.
Buffer::IO::Result OriginClose () override
 Release this writer token without closing the peer plane.
Buffer::IO::Result OriginPush (std::span< const std::byte > data) override
 Write one protocol-bounded segment at this leaf's absolute logical offset.
Buffer::IO::Result OriginFlush () override
 Flush the server-side writer handle.
Buffer::IO::Result OriginTruncate () override
 Truncate the server-side file to zero bytes.
Buffer::IO::Result OriginSeek (StormByte::ByteSize absolute) override
 Set this Buffer leaf's local writer offset.
StormByte::ByteSize OriginSize () const noexcept override
 Query the greater of the server file length and accepted logical write position.
Protected Member Functions inherited from StormByte::Buffer::IO::BufferedLocationWriter
 BufferedLocationWriter (StormByte::Safe::String path, enum Location location, Unpacked knobs)
void Setup () final
Protected Member Functions inherited from StormByte::Buffer::IO::BufferedWriter
STORMBYTE_FORCE_INLINE BufferedWriter (StormByte::Safe::String path, enum Location location, Parameters parameters={})
 BufferedWriter (StormByte::Safe::String path, enum Location location, WriterConfiguration configuration)
void SetState (enum State state) noexcept
void SetTell (StormByte::ByteSize offset) noexcept
virtual StormByte::Safe::Shared< StormByte::Buffer::WriteTelemetry > CreateTelemetry () const
virtual bool WillWrite (StormByte::ByteSize n) const

Friends

class Client
 Client may construct mounted writer 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 writer with an exclusive server-side mount.

Constructor & Destructor Documentation

◆ BufferedRemoteFileWriter() [1/2]

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

Copy construction is disabled.

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

◆ BufferedRemoteFileWriter() [2/2]

StormByte::Network::BufferedRemoteFileWriter::BufferedRemoteFileWriter ( BufferedRemoteFileWriter && )
delete

Move construction is disabled while a mount token is registered.

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

◆ ~BufferedRemoteFileWriter()

StormByte::Network::BufferedRemoteFileWriter::~BufferedRemoteFileWriter ( )
overridenoexcept

Release this leaf's token before base destruction.

The DataPlane owns the heartbeat.

Member Function Documentation

◆ operator=() [1/2]

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

Move assignment is disabled while a mount token is registered.

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

◆ operator=() [2/2]

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

Copy assignment is disabled.

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

◆ OriginClose()

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

Release this writer token without closing the peer plane.

Returns
Result of releasing the writer channel.

Implements StormByte::Buffer::IO::BufferedWriter.

◆ OriginDevice()

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

Network-interface snapshot for this connected origin.

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

Implements StormByte::Buffer::IO::BufferedLocationWriter.

◆ OriginDeviceUsable()

bool StormByte::Network::BufferedRemoteFileWriter::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::BufferedLocationWriter.

◆ OriginFlush()

Buffer::IO::Result StormByte::Network::BufferedRemoteFileWriter::OriginFlush ( )
overrideprotectedvirtual

Flush the server-side writer handle.

Returns
Flush result, or an error.

Implements StormByte::Buffer::IO::BufferedWriter.

◆ OriginOpen()

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

Open this writer token on the peer plane.

Returns
Result of opening the writer channel.

Implements StormByte::Buffer::IO::BufferedWriter.

◆ OriginPush()

Buffer::IO::Result StormByte::Network::BufferedRemoteFileWriter::OriginPush ( std::span< const std::byte > data)
overrideprotectedvirtual

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

Parameters
dataBytes to write.
Returns
Write result and transferred byte count, or an error.

Implements StormByte::Buffer::IO::BufferedWriter.

◆ OriginSeek()

Buffer::IO::Result StormByte::Network::BufferedRemoteFileWriter::OriginSeek ( StormByte::ByteSize absolute)
overrideprotectedvirtual

Set this Buffer leaf's local writer offset.

Parameters
absoluteAbsolute byte offset from the start of the file.
Returns
Seek result.

Implements StormByte::Buffer::IO::BufferedLocationWriter.

◆ OriginSize()

StormByte::ByteSize StormByte::Network::BufferedRemoteFileWriter::OriginSize ( ) const
overrideprotectedvirtualnoexcept

Query the greater of the server file length and accepted logical write position.

Returns
File length in bytes, or zero if unavailable.

Implements StormByte::Buffer::IO::BufferedLocationWriter.

◆ OriginTruncate()

Buffer::IO::Result StormByte::Network::BufferedRemoteFileWriter::OriginTruncate ( )
overrideprotectedvirtual

Truncate the server-side file to zero bytes.

This API does not accept a target size.

Returns
Truncation result, or an error.

Implements StormByte::Buffer::IO::BufferedWriter.

◆ Client

friend class Client
friend

Client may construct mounted writer 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: