NCBI C++ ToolKit
|
Search Toolkit Book for SEmbeddedStreamReaderWriter
Public Member Functions | |
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 | Write (const void *b, size_t c, size_t *w) override |
Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device. 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 () |
Private Attributes | |
SNetStorageObjectImpl & | m_Impl |
Definition at line 41 of file netstorage.cpp.
|
inline |
Definition at line 43 of file netstorage.cpp.
|
inlineoverridevirtual |
Implements IEmbeddedStreamWriter.
Definition at line 50 of file netstorage.cpp.
References IEmbeddedStreamWriter::Abort(), and m_Impl.
|
inlineoverridevirtual |
Implements IEmbeddedStreamWriter.
Definition at line 49 of file netstorage.cpp.
References IEmbeddedStreamWriter::Close(), and m_Impl.
|
inlineoverridevirtual |
Flush pending data (if any) down to the output device.
Implements IWriter.
Definition at line 48 of file netstorage.cpp.
References IWriter::Flush(), and m_Impl.
|
inlineoverridevirtual |
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.
Return eRW_Success if the number of pending bytes has been stored at the location pointed to by "count". Return eRW_NotImplemented if the number cannot be determined. Otherwise, return other eRW_... condition to reflect the problem ("*count" does not need to be updated in the case of non-eRW_Success). Note that if reporting 0 bytes ready, the method may return either both eRW_Success and zero "*count", or return eRW_NotImplemented alone.
Implements IReader.
Definition at line 46 of file netstorage.cpp.
References m_Impl, and IReader::PendingCount().
|
inlineoverridevirtual |
Read as many as "count" bytes into a buffer pointed to by the "buf" argument.
Always store the number of bytes actually read (0 if read none) via the pointer "bytes_read", if provided non-NULL. Return non-eRW_Success code if EOF / error condition has been encountered during the operation (some data may have been read, nevertheless, and reflected in "*bytes_read"). Special case: if "count" is passed as 0, then the value of "buf" must be ignored, and no change should be made to the state of the input device (but may return non-eRW_Success to indicate that the input device has already been in an error condition).
Implements IReader.
Definition at line 45 of file netstorage.cpp.
References b, m_Impl, r(), and IReader::Read().
|
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").
Implements IWriter.
Reimplemented in SIoStreamEmbeddedStreamReaderWriter.
Definition at line 47 of file netstorage.cpp.
References b, m_Impl, and IWriter::Write().
Referenced by SIoStreamEmbeddedStreamReaderWriter::Write().
|
private |
Definition at line 53 of file netstorage.cpp.
Referenced by Abort(), Close(), Flush(), PendingCount(), Read(), and Write().