NCBI C++ ToolKit
Public Types | Public Member Functions | Private Attributes | List of all members
NDirectNetStorageImpl::CWOFileTrack Class Reference

Search Toolkit Book for NDirectNetStorageImpl::CWOFileTrack

#include "state.hpp"
(Private to src/misc/netstorage.)

+ Inheritance diagram for NDirectNetStorageImpl::CWOFileTrack:
+ Collaboration diagram for NDirectNetStorageImpl::CWOFileTrack:

Public Types

typedef CRef< SFileTrackUploadTRequest
 

Public Member Functions

void Set (TRequest request)
 
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...
 
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 SNetStorageObjectOState
ERW_Result Read (void *buf, size_t count, size_t *read) final
 Read as many as "count" bytes into a buffer pointed to by the "buf" argument. More...
 
ERW_Result PendingCount (size_t *count) final
 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...
 
bool Eof () final
 
- Public Member Functions inherited from SNetStorageObjectIoState
Uint8 GetSize () final
 
list< stringGetAttributeList () const final
 
string GetAttribute (const string &name) const final
 
void SetAttribute (const string &name, const string &value) final
 
CNetStorageObjectInfo GetInfo () final
 
void SetExpiration (const CTimeout &ttl) final
 
string FileTrack_Path () final
 
string Relocate (TNetStorageFlags flags, TNetStorageProgressCb cb) final
 
bool Exists () final
 
ENetStorageRemoveResult Remove () final
 
- Public Member Functions inherited from INetStorageObjectState
virtual string GetLoc () const =0
 
virtual pair< string, stringGetUserInfo ()
 
virtual CNetStorageObjectLocLocator ()
 
virtual void CancelRelocate ()
 
- 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

TRequest m_Request
 

Additional Inherited Members

- Protected Member Functions inherited from INetStorageObjectState
void EnterState (INetStorageObjectState *state)
 
void ExitState ()
 

Detailed Description

Definition at line 230 of file state.hpp.

Member Typedef Documentation

◆ TRequest

Definition at line 233 of file state.hpp.

Member Function Documentation

◆ Abort()

void NDirectNetStorageImpl::CWOFileTrack::Abort ( void  )
overridevirtual

◆ Close()

void NDirectNetStorageImpl::CWOFileTrack::Close ( void  )
overridevirtual

◆ Flush()

ERW_Result NDirectNetStorageImpl::CWOFileTrack::Flush ( )
overridevirtual

Flush pending data (if any) down to the output device.

Implements IWriter.

Definition at line 202 of file state.cpp.

References eRW_Success.

◆ Set()

void NDirectNetStorageImpl::CWOFileTrack::Set ( TRequest  request)
inline

Definition at line 235 of file state.hpp.

References m_Request.

◆ Write()

ERW_Result NDirectNetStorageImpl::CWOFileTrack::Write ( const void *  buf,
size_t  count,
size_t *  bytes_written 
)
overridevirtual

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.

Implements IWriter.

Definition at line 195 of file state.cpp.

References buf, eRW_Success, m_Request, and SFileTrackUpload::Write().

Member Data Documentation

◆ m_Request

TRequest NDirectNetStorageImpl::CWOFileTrack::m_Request
private

Definition at line 247 of file state.hpp.

Referenced by Abort(), Close(), Set(), and Write().


The documentation for this class was generated from the following files:
Modified on Fri Mar 01 10:05:34 2024 by modify_doxy.py rev. 669887