NCBI C++ ToolKit
Public Member Functions | List of all members
SIoStreamEmbeddedStreamReaderWriter Struct Reference

Search Toolkit Book for SIoStreamEmbeddedStreamReaderWriter

+ Inheritance diagram for SIoStreamEmbeddedStreamReaderWriter:
+ Collaboration diagram for SIoStreamEmbeddedStreamReaderWriter:

Public Member Functions

 SIoStreamEmbeddedStreamReaderWriter (SNetStorageObjectImpl &impl)
 
ERW_Result Write (const void *buf, size_t count, size_t *written) override
 Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device. More...
 
- Public Member Functions inherited from SEmbeddedStreamReaderWriter
 SEmbeddedStreamReaderWriter (SNetStorageObjectImpl &impl)
 
ERW_Result Read (void *b, size_t c, size_t *r) override
 Read as many as "count" bytes into a buffer pointed to by the "buf" argument. More...
 
ERW_Result PendingCount (size_t *c) override
 Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that are ready to be read from the input device without blocking. More...
 
ERW_Result Flush () override
 Flush pending data (if any) down to the output device. More...
 
void Close () override
 
void Abort () override
 
- Public Member Functions inherited from IReader
virtual ERW_Result Pushback (const void *buf, size_t count, void *del_ptr=0)
 This method gets called by RStream buffer destructor to return buffered yet still unread (from the stream) portion of data back to the device. More...
 
virtual ~IReader ()
 
- Public Member Functions inherited from IWriter
virtual ~IWriter ()
 

Detailed Description

Definition at line 57 of file netstorage.cpp.

Constructor & Destructor Documentation

◆ SIoStreamEmbeddedStreamReaderWriter()

SIoStreamEmbeddedStreamReaderWriter::SIoStreamEmbeddedStreamReaderWriter ( SNetStorageObjectImpl impl)
inline

Definition at line 59 of file netstorage.cpp.

Member Function Documentation

◆ Write()

ERW_Result SIoStreamEmbeddedStreamReaderWriter::Write ( const void *  buf,
size_t  count,
size_t *  bytes_written 
)
inlineoverridevirtual

Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device.

Always store the number of bytes actually written, or 0 if "count" has been passed as 0 ("buf" must be ignored in this case), via the "bytes_written" pointer, if provided non-NULL. Note that the method can return non-eRW_Success in case of an I/O error along with indicating (some) data delivered to the output device (and reflected in "*bytes_written").

Note
Apparently, may not return eRW_Success if hasn't been able to write "count" bytes as requested, and "bytes_written" was passed as NULL.
When returning "*bytes_written" as zero for a non-zero "count" requested, the return status should not indicate eRW_Success.
Warning
"*bytes_written" may never be returned greater than "count".
Attention
It is implementation-dependent whether the call blocks until the entire buffer or only some data has been written out. In general, it is advised that this call is made within a loop that checks for errors and proceeds with the writing until the required amount of data has been sent.

Reimplemented from SEmbeddedStreamReaderWriter.

Definition at line 61 of file netstorage.cpp.

References buf, count, eRW_Success, and SEmbeddedStreamReaderWriter::Write().


The documentation for this struct was generated from the following file:
Modified on Fri Sep 20 14:57:38 2024 by modify_doxy.py rev. 669887