eq::net::DataIStream Class Reference

A std::istream-like input data stream for binary data. More...

#include <dataIStream.h>

Inheritance diagram for eq::net::DataIStream:

Inheritance graph
[legend]

List of all members.

Public Member Functions

Internal
 DataIStream ()
virtual ~DataIStream ()
virtual size_t nRemainingBuffers () const =0
 Get the number of remaining buffers.
virtual uint32_t getVersion () const
virtual void reset ()
Data input
template<typename T >
DataIStreamoperator>> (T &value)
 Read a plain data item.
template<typename T >
DataIStreamoperator>> (std::vector< T > &value)
 Read a std::vector of serializable items.
void read (void *data, uint64_t size)
 Read a number of bytes from the stream into a buffer.
const void * getRemainingBuffer ()
 Get the pointer to the remaining data in the current buffer.
uint64_t getRemainingBufferSize ()
 Get the size of the remaining data in the current buffer.
void advanceBuffer (const uint64_t offset)
 Advance the current buffer by a number of bytes.
Specialized input operators
template<>
DataIStreamoperator>> (std::string &str)
 Read a std::string.
template<>
DataIStreamoperator>> (base::UUID &id)
 Read a base::UUID.
template<>
DataIStreamoperator>> (std::vector< uint8_t > &value)
 Optimized specialization to read a std::vector of uint8_t.
template<>
DataIStreamoperator>> (std::vector< uint32_t > &value)
 Optimized specialization to read a std::vector of uint32_t.
template<>
DataIStreamoperator>> (std::vector< int32_t > &value)
 Optimized specialization to read a std::vector of int32_t.
template<>
DataIStreamoperator>> (std::vector< uint64_t > &value)
 Optimized specialization to read a std::vector of uint64_t.
template<>
DataIStreamoperator>> (std::vector< int64_t > &value)
 Optimized specialization to read a std::vector of int64_t.
template<>
DataIStreamoperator>> (std::vector< float > &value)
 Optimized specialization to read a std::vector of float.
template<>
DataIStreamoperator>> (std::vector< double > &value)
 Optimized specialization to read a std::vector of double.

Protected Member Functions

virtual bool getNextBuffer (const uint8_t **buffer, uint64_t *size)=0


Detailed Description

A std::istream-like input data stream for binary data.

Definition at line 33 of file dataIStream.h.


Member Function Documentation

virtual size_t eq::net::DataIStream::nRemainingBuffers (  )  const [pure virtual]

Get the number of remaining buffers.

Implemented in eq::net::ObjectDataIStream.

template<typename T >
DataIStream& eq::net::DataIStream::operator>> ( T &  value  )  [inline]

Read a plain data item.

Definition at line 53 of file dataIStream.h.

References read().

Here is the call graph for this function:

template<typename T >
DataIStream& eq::net::DataIStream::operator>> ( std::vector< T > &  value  )  [inline]

Read a std::vector of serializable items.

Definition at line 58 of file dataIStream.h.

References read().

Here is the call graph for this function:

void eq::net::DataIStream::read ( void *  data,
uint64_t  size 
)

Read a number of bytes from the stream into a buffer.

Definition at line 49 of file dataIStream.cpp.

References EQERROR.

Referenced by operator>>().

Here is the caller graph for this function:

const void * eq::net::DataIStream::getRemainingBuffer (  ) 

Get the pointer to the remaining data in the current buffer.

The data written by the DataOStream on the other end is bucketized, that is, it is sent in multiple blocks. The remaining buffer and its size points into one of the buffers, that is, not all the data sent is returned by this function. However, a write operation on the other end is never segmented, that is, if the application writes n bytes to the DataOStream, a symmetric read from the DataIStream has at least n bytes available.

Definition at line 73 of file dataIStream.cpp.

Referenced by operator>>().

Here is the caller graph for this function:

uint64_t eq::net::DataIStream::getRemainingBufferSize (  ) 

Get the size of the remaining data in the current buffer.

Definition at line 81 of file dataIStream.cpp.

Referenced by eq::net::FullSlaveCM::_unpackOneVersion(), and operator>>().

Here is the caller graph for this function:

void eq::net::DataIStream::advanceBuffer ( const uint64_t  offset  ) 

Advance the current buffer by a number of bytes.

Definition at line 89 of file dataIStream.cpp.

Referenced by operator>>().

Here is the caller graph for this function:

template<>
DataIStream& eq::net::DataIStream::operator>> ( std::string &  str  )  [inline]

Read a std::string.

Definition at line 132 of file dataIStream.h.

References advanceBuffer(), getRemainingBuffer(), getRemainingBufferSize(), and read().

Here is the call graph for this function:

template<>
DataIStream& eq::net::DataIStream::operator>> ( std::vector< uint8_t > &  value  )  [inline]

Optimized specialization to read a std::vector of uint8_t.

Definition at line 159 of file dataIStream.h.

template<>
DataIStream& eq::net::DataIStream::operator>> ( std::vector< uint32_t > &  value  )  [inline]

Optimized specialization to read a std::vector of uint32_t.

Definition at line 166 of file dataIStream.h.

template<>
DataIStream& eq::net::DataIStream::operator>> ( std::vector< int32_t > &  value  )  [inline]

Optimized specialization to read a std::vector of int32_t.

Definition at line 173 of file dataIStream.h.

template<>
DataIStream& eq::net::DataIStream::operator>> ( std::vector< uint64_t > &  value  )  [inline]

Optimized specialization to read a std::vector of uint64_t.

Definition at line 180 of file dataIStream.h.

template<>
DataIStream& eq::net::DataIStream::operator>> ( std::vector< int64_t > &  value  )  [inline]

Optimized specialization to read a std::vector of int64_t.

Definition at line 187 of file dataIStream.h.

template<>
DataIStream& eq::net::DataIStream::operator>> ( std::vector< float > &  value  )  [inline]

Optimized specialization to read a std::vector of float.

Definition at line 194 of file dataIStream.h.

template<>
DataIStream& eq::net::DataIStream::operator>> ( std::vector< double > &  value  )  [inline]

Optimized specialization to read a std::vector of double.

Definition at line 201 of file dataIStream.h.


The documentation for this class was generated from the following files:
Generated on Mon Aug 10 18:58:44 2009 for Equalizer 0.9 by  doxygen 1.5.8