# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::CBitMemStream Class Reference

Bit-oriented memory stream. More...

#include <bit_mem_stream.h>

Inheritance diagram for NLMISC::CBitMemStream:

NLMISC::CMemStream NLMISC::IStream List of all members.

Public Methods

 CBitMemStream (bool inputStream=false, uint32 defaultcapacity=32)
 Constructor. More...

 CBitMemStream (const CBitMemStream &other)
 Copy constructor. More...

CBitMemStream & operator= (const CBitMemStream &other)
 Assignment operator. More...

virtual uint32 length () const
 Returns the length (size) of the message, in bytes. More...

virtual void invert ()
 Transforms the message from input to output or from output to input. More...

virtual void clear ()
 Clears the message. More...

sint32 getPosInBit ()
 Returns the number of bit from the beginning of the buffer (in bit). More...

virtual void serialBuffer (uint8 *buf, uint len)
 Serialize a buffer. More...

virtual void serialBit (bool &bit)
 Serialize one bit. More...

void serial (uint32 &value, uint nbits, bool resetvalue=true)
 Serialize only the nbits lower bits of value (nbits range: [1..32]) When using this method, always leave resetvalue to true. More...

void serial (uint64 &value, uint nbits)
 Serialize only the nbits lower bits of 64-bit value (nbits range: [1..64]). More...

template<class T> void serial (T &obj)
 Template serialisation (should take the one from IStream). More...

template<class T> void serialCont (std::vector< T > &cont)
template<class T> void serialCont (std::list< T > &cont)
template<class T> void serialCont (std::deque< T > &cont)
template<class T> void serialCont (std::set< T > &cont)
template<class T> void serialCont (std::multiset< T > &cont)
template<class K, class T> void serialCont (std::map< K, T > &cont)
template<class K, class T> void serialCont (std::multimap< K, T > &cont)
virtual void serialCont (std::vector< uint8 > &cont)
 Specialisation of serialCont() for vector<uint8>. More...

virtual void serialCont (std::vector< sint8 > &cont)
 Specialisation of serialCont() for vector<sint8>. More...

virtual void serialCont (std::vector< bool > &cont)
 Specialisation of serialCont() for vector<bool>. More...

Base type serialisation.
Those method are a specialisation of template method "void serial(T&)".

virtual void serial (uint8 &b)
virtual void serial (sint8 &b)
virtual void serial (uint16 &b)
virtual void serial (sint16 &b)
virtual void serial (uint32 &b)
virtual void serial (sint32 &b)
virtual void serial (uint64 &b)
virtual void serial (sint64 &b)
virtual void serial (float &b)
virtual void serial (double &b)
virtual void serial (bool &b)
virtual void serial (char &b)
virtual void serial (std::string &b)
virtual void serial (CBitMemStream &b)

Protected Attributes

uint _FreeBits

Detailed Description

Bit-oriented memory stream.

Author:
Olivier Cado , Nevrax France
Date:
2001

Definition at line 42 of file bit_mem_stream.h.


Constructor & Destructor Documentation

NLMISC::CBitMemStream::CBitMemStream bool    inputStream = false,
uint32    defaultcapacity = 32
 

Constructor.

Definition at line 39 of file bit_mem_stream.cpp.

References NLMISC::CMemStream::_BufPos.

Referenced by operator=.

NLMISC::CBitMemStream::CBitMemStream const CBitMemStream &    other
 

Copy constructor.

Definition at line 50 of file bit_mem_stream.cpp.


Member Function Documentation

virtual void NLMISC::CBitMemStream::clear   [inline, virtual]
 

Clears the message.

Reimplemented from NLMISC::CMemStream.

Definition at line 96 of file bit_mem_stream.h.

References NLMISC::CMemStream::_BufPos, and _FreeBits.

sint32 NLMISC::CBitMemStream::getPosInBit   [inline]
 

Returns the number of bit from the beginning of the buffer (in bit).

Definition at line 104 of file bit_mem_stream.h.

References NLMISC::CMemStream::_Buffer, NLMISC::CMemStream::_BufPos, _FreeBits, NLMISC::CMemStream::getPos, and NLMISC::IStream::isReading.

Referenced by serial.

virtual void NLMISC::CBitMemStream::invert   [inline, virtual]
 

Transforms the message from input to output or from output to input.

Reimplemented from NLMISC::CMemStream.

Definition at line 79 of file bit_mem_stream.h.

References NLMISC::CMemStream::_BufPos, _FreeBits, and NLMISC::IStream::isReading.

virtual uint32 NLMISC::CBitMemStream::length   const [inline, virtual]
 

Returns the length (size) of the message, in bytes.

If isReading(), it is the number of bytes that can be read, otherwise it is the number of bytes that have been written.

Reimplemented from NLMISC::CMemStream.

Definition at line 59 of file bit_mem_stream.h.

References NLMISC::CMemStream::_Buffer, NLMISC::CMemStream::_BufPos, NLMISC::IStream::isReading, NLMISC::CMemStream::lengthR, and NLMISC::CMemStream::lengthS.

Referenced by serial, and serialCont.

CBitMemStream& NLMISC::CBitMemStream::operator= const CBitMemStream &    other [inline]
 

Assignment operator.

Definition at line 53 of file bit_mem_stream.h.

References _FreeBits, and CBitMemStream.

void NLMISC::CBitMemStream::serial CBitMemStream &    b [virtual]
 

Definition at line 310 of file bit_mem_stream.cpp.

References NLMISC::CMemStream::getPos, NLMISC::IStream::isReading, length, nlwarning, serial, and serialBuffer.

void NLMISC::CBitMemStream::serial std::string &    b [virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 279 of file bit_mem_stream.cpp.

References NLMISC::CMemStream::getPos, NLMISC::IStream::isReading, length, nlwarning, serial, and serialBuffer.

virtual void NLMISC::CBitMemStream::serial char &    b [inline, virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 273 of file bit_mem_stream.h.

References serialAdapt.

virtual void NLMISC::CBitMemStream::serial bool &    b [inline, virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 271 of file bit_mem_stream.h.

References serialBit.

virtual void NLMISC::CBitMemStream::serial double &    b [inline, virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 270 of file bit_mem_stream.h.

References serialAdapt64.

void NLMISC::CBitMemStream::serial float &    b [virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 260 of file bit_mem_stream.cpp.

References NLMISC::IStream::isReading, and serial.

virtual void NLMISC::CBitMemStream::serial sint64   b [inline, virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 268 of file bit_mem_stream.h.

References serialAdapt64.

virtual void NLMISC::CBitMemStream::serial uint64   b [inline, virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 267 of file bit_mem_stream.h.

References serialAdapt64.

virtual void NLMISC::CBitMemStream::serial sint32   b [inline, virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 266 of file bit_mem_stream.h.

References serialAdapt.

virtual void NLMISC::CBitMemStream::serial uint32   b [inline, virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 265 of file bit_mem_stream.h.

References serialAdapt.

virtual void NLMISC::CBitMemStream::serial sint16   b [inline, virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 264 of file bit_mem_stream.h.

References serialAdapt.

virtual void NLMISC::CBitMemStream::serial uint16   b [inline, virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 263 of file bit_mem_stream.h.

References serialAdapt.

virtual void NLMISC::CBitMemStream::serial sint8   b [inline, virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 262 of file bit_mem_stream.h.

References serialAdapt.

virtual void NLMISC::CBitMemStream::serial uint8   b [inline, virtual]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 261 of file bit_mem_stream.h.

References serialAdapt.

template<class T>
void NLMISC::CBitMemStream::serial T &    obj [inline]
 

Template serialisation (should take the one from IStream).

Reimplemented from NLMISC::CMemStream.

Definition at line 176 of file bit_mem_stream.h.

void NLMISC::CBitMemStream::serial uint64   value,
uint    nbits
[inline]
 

Serialize only the nbits lower bits of 64-bit value (nbits range: [1..64]).

Definition at line 140 of file bit_mem_stream.h.

References NLMISC::IStream::isReading, serial, and value.

void NLMISC::CBitMemStream::serial uint32   value,
uint    nbits,
bool    resetvalue = true
 

Serialize only the nbits lower bits of value (nbits range: [1..32]) When using this method, always leave resetvalue to true.

Definition at line 146 of file bit_mem_stream.cpp.

References NLMISC::CMemStream::_Buffer, NLMISC::CMemStream::_BufPos, _FreeBits, displayByteBits, displayDwordBits, getPosInBit, NLMISC::IStream::isReading, NLMISC::CMemStream::lengthR, NLMISC::toString, v, and value.

Referenced by serial, serialBit, serialBuffer, and serialCont.

void NLMISC::CBitMemStream::serialBit bool &    bit [virtual]
 

Serialize one bit.

Reimplemented from NLMISC::CMemStream.

Definition at line 86 of file bit_mem_stream.cpp.

References NLMISC::IStream::isReading, and serial.

Referenced by serial, and serialCont.

void NLMISC::CBitMemStream::serialBuffer uint8   buf,
uint    len
[virtual]
 

Serialize a buffer.

Reimplemented from NLMISC::CMemStream.

Definition at line 60 of file bit_mem_stream.cpp.

References NLMISC::IStream::isReading, serial, and v.

Referenced by serial.

void NLMISC::CBitMemStream::serialCont std::vector< bool > &    cont [virtual]
 

Specialisation of serialCont() for vector<bool>.

Reimplemented from NLMISC::CMemStream.

Definition at line 342 of file bit_mem_stream.cpp.

References NLMISC::contReset, NLMISC::CMemStream::getPos, NLMISC::IStream::isReading, length, nlwarning, serial, serialBit, and v.

virtual void NLMISC::CBitMemStream::serialCont std::vector< sint8 > &    cont [inline, virtual]
 

Specialisation of serialCont() for vector<sint8>.

Reimplemented from NLMISC::CMemStream.

Definition at line 285 of file bit_mem_stream.h.

References NLMISC::IStream::serialVector.

virtual void NLMISC::CBitMemStream::serialCont std::vector< uint8 > &    cont [inline, virtual]
 

Specialisation of serialCont() for vector<uint8>.

Reimplemented from NLMISC::CMemStream.

Definition at line 283 of file bit_mem_stream.h.

References NLMISC::IStream::serialVector.

template<class K, class T>
void NLMISC::CBitMemStream::serialCont std::multimap< K, T > &    cont [inline]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 192 of file bit_mem_stream.h.

template<class K, class T>
void NLMISC::CBitMemStream::serialCont std::map< K, T > &    cont [inline]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 190 of file bit_mem_stream.h.

template<class T>
void NLMISC::CBitMemStream::serialCont std::multiset< T > &    cont [inline]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 188 of file bit_mem_stream.h.

template<class T>
void NLMISC::CBitMemStream::serialCont std::set< T > &    cont [inline]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 186 of file bit_mem_stream.h.

template<class T>
void NLMISC::CBitMemStream::serialCont std::deque< T > &    cont [inline]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 184 of file bit_mem_stream.h.

template<class T>
void NLMISC::CBitMemStream::serialCont std::list< T > &    cont [inline]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 182 of file bit_mem_stream.h.

template<class T>
void NLMISC::CBitMemStream::serialCont std::vector< T > &    cont [inline]
 

Reimplemented from NLMISC::CMemStream.

Definition at line 180 of file bit_mem_stream.h.


Member Data Documentation

uint NLMISC::CBitMemStream::_FreeBits [protected]
 

Definition at line 291 of file bit_mem_stream.h.

Referenced by clear, getPosInBit, invert, operator=, and serial.


The documentation for this class was generated from the following files: