Protected Member Functions | Protected Attributes

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:
Collaboration diagram for eq::net::DataIStream:

List of all members.

Public Member Functions

Internal

 DataIStream ()
 DataIStream (const DataIStream &)
virtual ~DataIStream ()
virtual size_t nRemainingBuffers () const =0
 Get the number of remaining buffers.
virtual uint32_t getVersion () const =0
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.
template<typename O , typename C >
void deserializeChildren (O *object, const std::vector< C * > &old, std::vector< C * > &result)
 Deserialize child objects.
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>> (Object *&object)
 Deserialize an object (id+version).
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.
template<>
DataIStreamoperator>> (std::vector< ObjectVersion > &value)
 Optimized specialization to read a std::vector of ObjectVersion.

Protected Member Functions

virtual bool getNextBuffer (const uint8_t **buffer, uint64_t *size)=0
void _decompress (const uint8_t *src, const uint8_t **dst, const uint32_t name, const uint32_t nChunks, const uint64_t dataSize)

Protected Attributes

base::CPUCompressor *const decompressor

Detailed Description

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

Definition at line 35 of file dataIStream.h.


Member Function Documentation

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

Advance the current buffer by a number of bytes.

Definition at line 103 of file dataIStream.cpp.

Referenced by operator>>().

Here is the caller graph for this function:

template<typename O , typename C >
void eq::net::DataIStream::deserializeChildren ( O *  object,
const std::vector< C * > &  old,
std::vector< C * > &  result 
)

Deserialize child objects.

Existing children are synced to the new version. New children are created by calling the void create( C** child ) method on the object, and registered or mapped to the object's session. Removed children are released by calling the void release( C* ) method on the object. The resulting child vector is created in result. The old and result vector can be the same object, the result vector is cleared and rebuild completely.

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 87 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 95 of file dataIStream.cpp.

Referenced by eq::net::VersionedSlaveCM::applyMapData(), eq::net::StaticSlaveCM::applyMapData(), operator>>(), and eq::net::MasterCM::sync().

Here is the caller graph for this function:

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

Get the number of remaining buffers.

Implemented in eq::net::ObjectDataIStream.

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 272 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 277 of file dataIStream.h.

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

Read a std::string.

Definition at line 161 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< uint64_t > &  value  )  [inline]

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

Definition at line 287 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 302 of file dataIStream.h.

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

Read a std::vector of serializable items.

Definition at line 61 of file dataIStream.h.

References read().

Here is the call graph for this function:

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

Read a plain data item.

Definition at line 56 of file dataIStream.h.

References read().

Here is the call graph for this function:

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 292 of file dataIStream.h.

template<>
DataIStream& eq::net::DataIStream::operator>> ( Object *&  object  )  [inline]

Deserialize an object (id+version).

Definition at line 178 of file dataIStream.h.

References eq::net::Object::getID().

Here is the call graph for this function:

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

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

Definition at line 307 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 297 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 282 of file dataIStream.h.

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

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

Definition at line 62 of file dataIStream.cpp.

References EQERROR.

Referenced by eqNbody::SharedDataProxy::deserialize(), eqNbody::FrameData::deserialize(), and operator>>().

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Sun Aug 29 2010 13:53:46 for Equalizer 0.9.1 by  doxygen 1.7.1