NCBI C++ ToolKit
|
Search Toolkit Book for SPSG_BlobReader
#include "psg_client_impl.hpp"
(Private to src/objtools/pubseq_gateway/client
.)
Public Types | |
using | TStats = pair< bool, weak_ptr< SPSG_Stats > > |
Public Member Functions | |
SPSG_BlobReader (SPSG_Reply::SItem::TTS &src, TStats stats=TStats()) | |
ERW_Result | Read (void *buf, size_t count, size_t *bytes_read=0) |
Read as many as "count" bytes into a buffer pointed to by the "buf" argument. More... | |
ERW_Result | PendingCount (size_t *count) |
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... | |
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 () |
Private Member Functions | |
void | CheckForNewChunks () |
ERW_Result | x_Read (void *buf, size_t count, size_t *bytes_read) |
Private Attributes | |
SPSG_Reply::SItem::TTS & | m_Src |
TStats | m_Stats |
vector< SPSG_Chunk > | m_Data |
size_t | m_Chunk = 0 |
size_t | m_Index = 0 |
Additional Inherited Members | |
Protected Member Functions inherited from array< char, 64 *1024 > | |
array (alp_data *alp_data_) | |
~array () | |
void | increment_array_on_the_rigth () |
void | increment_array_on_the_left () |
void | set_elem (Int4 ind_, char elem_) |
void | increase_elem_by_1 (Int4 ind_) |
Protected Attributes inherited from array< char, 64 *1024 > | |
Int4 | d_step |
Int4 | d_dim |
Int4 | d_ind0 |
Int4 | d_dim_plus_d_ind0 |
char * | d_elem |
alp_data * | d_alp_data |
Definition at line 49 of file psg_client_impl.hpp.
using SPSG_BlobReader::TStats = pair<bool, weak_ptr<SPSG_Stats> > |
Definition at line 51 of file psg_client_impl.hpp.
SPSG_BlobReader::SPSG_BlobReader | ( | SPSG_Reply::SItem::TTS & | src, |
TStats | stats = TStats() |
||
) |
Definition at line 73 of file psg_client.cpp.
References stats.
|
private |
Definition at line 154 of file psg_client.cpp.
References SPSG_StatsData::eRead, SThreadSafe< TType >::GetLock(), i, m_Data, m_Src, m_Stats, ncbi::grid::netcache::search::fields::size, and stats.
Referenced by PendingCount(), and x_Read().
|
virtual |
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 131 of file psg_client.cpp.
References assert, CheckForNewChunks(), count, data, eRW_Success, i, m_Chunk, m_Data, and m_Index.
|
virtual |
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 111 of file psg_client.cpp.
References buf, count, eRW_Error, eRW_Success, SPSG_Param< TParam >::GetDefault(), m_Src, NCBI_THROW_FMT, SPSG_CV< TType >::WaitUntil(), and x_Read().
|
private |
Definition at line 79 of file psg_client.cpp.
References assert, available, buf, CheckForNewChunks(), count, data, eRW_Eof, eRW_Success, SThreadSafe< TType >::GetLock(), m_Chunk, m_Data, m_Index, m_Src, and min().
Referenced by Read().
|
private |
Definition at line 64 of file psg_client_impl.hpp.
Referenced by PendingCount(), and x_Read().
|
private |
Definition at line 63 of file psg_client_impl.hpp.
Referenced by CheckForNewChunks(), PendingCount(), and x_Read().
|
private |
Definition at line 65 of file psg_client_impl.hpp.
Referenced by PendingCount(), and x_Read().
|
private |
Definition at line 61 of file psg_client_impl.hpp.
Referenced by CheckForNewChunks(), Read(), and x_Read().
|
private |
Definition at line 62 of file psg_client_impl.hpp.
Referenced by CheckForNewChunks().