NCBI C++ ToolKit
|
Search Toolkit Book for SNetStorageObjectRPC::SIState
Public Member Functions | |
ERW_Result | Read (void *buf, size_t count, size_t *read) override |
Read as many as "count" bytes into a buffer pointed to by the "buf" argument. More... | |
ERW_Result | PendingCount (size_t *count) 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... | |
bool | Eof () override |
void | Close () override |
void | Abort () override |
string | GetLoc () const override |
void | StartReading () |
Public Member Functions inherited from SNetStorageObjectIState | |
ERW_Result | Write (const void *buf, size_t count, size_t *written) final |
Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device. More... | |
ERW_Result | Flush () final |
Flush pending data (if any) down to the output device. More... | |
Public Member Functions inherited from SNetStorageObjectIoState | |
Uint8 | GetSize () final |
list< string > | GetAttributeList () 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 pair< string, string > | GetUserInfo () |
virtual CNetStorageObjectLoc & | Locator () |
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 () |
Protected Member Functions | |
SIState (SContext &context) | |
Protected Member Functions inherited from INetStorageObjectState | |
void | EnterState (INetStorageObjectState *state) |
void | ExitState () |
Private Member Functions | |
void | ReadConfirmation () |
void | ReadSocket () |
Private Attributes | |
SContext & | m_Context |
vector< char > | m_ReadBuffer |
CUTTPReader | m_UTTPReader |
const char * | m_CurrentChunk |
size_t | m_CurrentChunkSize |
bool | m_EOF |
Definition at line 535 of file netstorage_rpc.cpp.
|
inlineprotected |
Definition at line 549 of file netstorage_rpc.cpp.
|
overridevirtual |
Implements IEmbeddedStreamWriter.
Definition at line 1307 of file netstorage_rpc.cpp.
References SNetServerConnectionImpl::Close(), INetStorageObjectState::ExitState(), SNetStorageObjectRPC::SContext::m_Connection, and SNetStorageObjectRPC::m_Context.
|
overridevirtual |
Implements IEmbeddedStreamWriter.
Definition at line 1258 of file netstorage_rpc.cpp.
References SNetServerConnectionImpl::Abort(), SNetStorageObjectRPC::Eof(), INetStorageObjectState::ExitState(), SNetStorageObjectRPC::SContext::m_Connection, and SNetStorageObjectRPC::m_Context.
|
overridevirtual |
Implements INetStorageObjectState.
Definition at line 1150 of file netstorage_rpc.cpp.
|
inlineoverridevirtual |
Implements INetStorageObjectState.
Definition at line 544 of file netstorage_rpc.cpp.
References SNetStorageObjectRPC::SContext::locator, and m_Context.
|
overridevirtual |
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 1285 of file netstorage_rpc.cpp.
References count, and eRW_Success.
|
overridevirtual |
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 1097 of file netstorage_rpc.cpp.
References SNetStorageObjectRPC::Abort(), CUTTPReader::eChunk, CUTTPReader::eChunkPart, CUTTPReader::eControlSymbol, CUTTPReader::eEndOfBuffer, eRW_Eof, eRW_Success, SNetStorageObjectRPC::SContext::locator, SNetStorageObjectRPC::m_Context, min(), and NCBI_THROW_FMT.
|
private |
Definition at line 1031 of file netstorage_rpc.cpp.
References CUTTPReader::eEndOfBuffer, END_OF_DATA_MARKER, CUTTPReader::GetControlSymbol(), CJsonOverUTTPReader::GetMessage(), CUTTPReader::GetNextEvent(), CSocket::GetPeerAddress(), SNetStorageObjectRPC::SContext::locator, SNetStorageObjectRPC::SContext::m_Connection, m_Context, m_EOF, SNetServerConnectionImpl::m_Socket, m_UTTPReader, NCBI_THROW_FMT, CJsonOverUTTPReader::ReadMessage(), ReadSocket(), and SNetStorageObjectRPC::SContext::TrapErrors().
|
inlineprivate |
Definition at line 553 of file netstorage_rpc.cpp.
References SNetStorageObjectRPC::SContext::m_Connection, m_Context, m_ReadBuffer, SNetServerConnectionImpl::m_Socket, m_UTTPReader, and s_ReadSocket().
Referenced by ReadConfirmation().
void SNetStorageObjectRPC::SIState::StartReading | ( | ) |
Definition at line 1074 of file netstorage_rpc.cpp.
References SNetStorageObjectRPC::Abort(), CJsonOverUTTPReader::GetMessage(), SNetStorageObjectRPC::m_Context, READ_BUFFER_SIZE, CJsonOverUTTPReader::ReadMessage(), and SNetStorageObjectRPC::SContext::TrapErrors().
|
private |
Definition at line 555 of file netstorage_rpc.cpp.
Referenced by GetLoc(), ReadConfirmation(), and ReadSocket().
|
private |
Definition at line 558 of file netstorage_rpc.cpp.
|
private |
Definition at line 559 of file netstorage_rpc.cpp.
|
private |
Definition at line 560 of file netstorage_rpc.cpp.
Referenced by ReadConfirmation().
|
private |
Definition at line 556 of file netstorage_rpc.cpp.
Referenced by ReadSocket().
|
private |
Definition at line 557 of file netstorage_rpc.cpp.
Referenced by ReadConfirmation(), and ReadSocket().