m_PacketBytesToWrite(0)
63 classCIOBytesCountGuard
67CIOBytesCountGuard(
size_t* ret)
68:
count(0), m_Ret(ret)
71~CIOBytesCountGuard() {
if(m_Ret) *m_Ret =
count; }
79 size_t* bytes_written)
81CIOBytesCountGuard wrt(bytes_written);
85 count= (size_t) 0x80008000LU;
130 auto data=
reinterpret_cast<const char*
>(&
value);
142 template<
typenameTType>
145 return reinterpret_cast<constTType*
>(
data() +
m_Start);
150 returnm_End - m_Start;
155 return data() + m_End;
160 return size() - m_End;
172 if(DataSize() == 0) m_Start = m_End = 0;
209 const size_tkMinReadSize = 32 * 1024;
211CIOBytesCountGuard read(bytes_read);
231 if(to_read >= kMinReadSize) {
244read.count =
min(to_read, already_read);
266 Uint4start_word_coming;
274start_word_coming != 0x04030201)
276 "Cannot determine the byte order. Got: "static Int4 GetInt4(const unsigned char *ptr)
virtual ~CTransmissionReader()
ERW_Result ReadLength(Uint4 &length)
virtual ERW_Result PendingCount(size_t *count)
Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that a...
virtual 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.
CTransmissionReader(IReader *rdr, EOwnership own_reader=eNoOwnership)
Constructed on another IReader (supposed to implement the actual transmission)
Uint4 m_PacketBytesToRead
CTransmissionWriter(IWriter *wrt, EOwnership own_writer=eNoOwnership, ESendEofPacket send_eof=eDontSendEofPacket)
Constructed on another IWriter (comm.
ERW_Result WriteUint4(const Uint4 &value)
virtual ERW_Result Flush(void)
Flush pending data (if any) down to the output device.
virtual ERW_Result Write(const void *buf, size_t count, size_t *bytes_written=0)
Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device.
virtual ~CTransmissionWriter()
@ eDontSendEofPacket
Writer will not send EOF packet in the destructor.
@ eSendEofPacket
Writer will send EOF packet in the destructor.
size_t m_PacketBytesToWrite
A very basic data-read interface.
A very basic data-write interface.
The NCBI C++ standard methods for dealing with std::string.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
uint32_t Uint4
4-byte (32-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
ERW_Result
Result codes for I/O operations.
virtual ERW_Result Flush(void)=0
Flush pending data (if any) down to the output device.
virtual ERW_Result PendingCount(size_t *count)=0
Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that a...
virtual ERW_Result Write(const void *buf, size_t count, size_t *bytes_written=0)=0
Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device.
virtual ERW_Result Read(void *buf, size_t count, size_t *bytes_read=0)=0
Read as many as "count" bytes into a buffer pointed to by the "buf" argument.
@ eRW_Eof
End of data, should be considered permanent.
@ eRW_Error
Unrecoverable error, no retry possible.
@ eRW_Success
Everything is okay, I/O completed.
static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)
Convert UInt to string.
enum ENcbiOwnership EOwnership
Ownership relations between objects.
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
NCBI C++ auxiliary debug macros.
const TType * Data() const
void Remove(size_t count)
static const Uint4 sStartWord
static const Uint4 sEndPacket
Reader writer with transmission checking.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4