doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
idBitMsg Class Reference

#include <BitMsg.h>

Public Member Functions

 idBitMsg ()
 
 ~idBitMsg ()
 
void Init (byte *data, int length)
 
void Init (const byte *data, int length)
 
byteGetData (void)
 
const byteGetData (void) const
 
int GetMaxSize (void) const
 
void SetAllowOverflow (bool set)
 
bool IsOverflowed (void) const
 
int GetSize (void) const
 
void SetSize (int size)
 
int GetWriteBit (void) const
 
void SetWriteBit (int bit)
 
int GetNumBitsWritten (void) const
 
int GetRemainingWriteBits (void) const
 
void SaveWriteState (int &s, int &b) const
 
void RestoreWriteState (int s, int b)
 
int GetReadCount (void) const
 
void SetReadCount (int bytes)
 
int GetReadBit (void) const
 
void SetReadBit (int bit)
 
int GetNumBitsRead (void) const
 
int GetRemainingReadBits (void) const
 
void SaveReadState (int &c, int &b) const
 
void RestoreReadState (int c, int b)
 
void BeginWriting (void)
 
int GetRemainingSpace (void) const
 
void WriteByteAlign (void)
 
void WriteBits (int value, int numBits)
 
void WriteChar (int c)
 
void WriteByte (int c)
 
void WriteShort (int c)
 
void WriteUShort (int c)
 
void WriteLong (int c)
 
void WriteFloat (float f)
 
void WriteFloat (float f, int exponentBits, int mantissaBits)
 
void WriteAngle8 (float f)
 
void WriteAngle16 (float f)
 
void WriteDir (const idVec3 &dir, int numBits)
 
void WriteString (const char *s, int maxLength=-1, bool make7Bit=true)
 
void WriteData (const void *data, int length)
 
void WriteNetadr (const netadr_t adr)
 
void WriteDeltaChar (int oldValue, int newValue)
 
void WriteDeltaByte (int oldValue, int newValue)
 
void WriteDeltaShort (int oldValue, int newValue)
 
void WriteDeltaLong (int oldValue, int newValue)
 
void WriteDeltaFloat (float oldValue, float newValue)
 
void WriteDeltaFloat (float oldValue, float newValue, int exponentBits, int mantissaBits)
 
void WriteDeltaByteCounter (int oldValue, int newValue)
 
void WriteDeltaShortCounter (int oldValue, int newValue)
 
void WriteDeltaLongCounter (int oldValue, int newValue)
 
bool WriteDeltaDict (const idDict &dict, const idDict *base)
 
void BeginReading (void) const
 
int GetRemaingData (void) const
 
void ReadByteAlign (void) const
 
int ReadBits (int numBits) const
 
int ReadChar (void) const
 
int ReadByte (void) const
 
int ReadShort (void) const
 
int ReadUShort (void) const
 
int ReadLong (void) const
 
float ReadFloat (void) const
 
float ReadFloat (int exponentBits, int mantissaBits) const
 
float ReadAngle8 (void) const
 
float ReadAngle16 (void) const
 
idVec3 ReadDir (int numBits) const
 
int ReadString (char *buffer, int bufferSize) const
 
int ReadData (void *data, int length) const
 
void ReadNetadr (netadr_t *adr) const
 
int ReadDeltaChar (int oldValue) const
 
int ReadDeltaByte (int oldValue) const
 
int ReadDeltaShort (int oldValue) const
 
int ReadDeltaLong (int oldValue) const
 
float ReadDeltaFloat (float oldValue) const
 
float ReadDeltaFloat (float oldValue, int exponentBits, int mantissaBits) const
 
int ReadDeltaByteCounter (int oldValue) const
 
int ReadDeltaShortCounter (int oldValue) const
 
int ReadDeltaLongCounter (int oldValue) const
 
bool ReadDeltaDict (idDict &dict, const idDict *base) const
 

Static Public Member Functions

static int DirToBits (const idVec3 &dir, int numBits)
 
static idVec3 BitsToDir (int bits, int numBits)
 

Private Member Functions

bool CheckOverflow (int numBits)
 
byteGetByteSpace (int length)
 
void WriteDelta (int oldValue, int newValue, int numBits)
 
int ReadDelta (int oldValue, int numBits) const
 

Private Attributes

bytewriteData
 
const bytereadData
 
int maxSize
 
int curSize
 
int writeBit
 
int readCount
 
int readBit
 
bool allowOverflow
 
bool overflowed
 

Detailed Description

Definition at line 44 of file BitMsg.h.

Constructor & Destructor Documentation

idBitMsg::idBitMsg ( )

Definition at line 46 of file BitMsg.cpp.

idBitMsg::~idBitMsg ( )
inline

Definition at line 47 of file BitMsg.h.

Member Function Documentation

ID_INLINE void idBitMsg::BeginReading ( void  ) const

Definition at line 346 of file BitMsg.h.

ID_INLINE void idBitMsg::BeginWriting ( void  )

Definition at line 265 of file BitMsg.h.

idVec3 idBitMsg::BitsToDir ( int  bits,
int  numBits 
)
static

Definition at line 613 of file BitMsg.cpp.

bool idBitMsg::CheckOverflow ( int  numBits)
private

Definition at line 63 of file BitMsg.cpp.

int idBitMsg::DirToBits ( const idVec3 dir,
int  numBits 
)
static

Definition at line 588 of file BitMsg.cpp.

byte * idBitMsg::GetByteSpace ( int  length)
private

Definition at line 85 of file BitMsg.cpp.

ID_INLINE byte * idBitMsg::GetData ( void  )

Definition at line 167 of file BitMsg.h.

ID_INLINE const byte * idBitMsg::GetData ( void  ) const

Definition at line 171 of file BitMsg.h.

ID_INLINE int idBitMsg::GetMaxSize ( void  ) const

Definition at line 175 of file BitMsg.h.

ID_INLINE int idBitMsg::GetNumBitsRead ( void  ) const

Definition at line 247 of file BitMsg.h.

ID_INLINE int idBitMsg::GetNumBitsWritten ( void  ) const

Definition at line 210 of file BitMsg.h.

ID_INLINE int idBitMsg::GetReadBit ( void  ) const

Definition at line 239 of file BitMsg.h.

ID_INLINE int idBitMsg::GetReadCount ( void  ) const

Definition at line 231 of file BitMsg.h.

ID_INLINE int idBitMsg::GetRemaingData ( void  ) const

Definition at line 351 of file BitMsg.h.

ID_INLINE int idBitMsg::GetRemainingReadBits ( void  ) const

Definition at line 251 of file BitMsg.h.

ID_INLINE int idBitMsg::GetRemainingSpace ( void  ) const

Definition at line 271 of file BitMsg.h.

ID_INLINE int idBitMsg::GetRemainingWriteBits ( void  ) const

Definition at line 214 of file BitMsg.h.

ID_INLINE int idBitMsg::GetSize ( void  ) const

Definition at line 187 of file BitMsg.h.

ID_INLINE int idBitMsg::GetWriteBit ( void  ) const

Definition at line 199 of file BitMsg.h.

ID_INLINE void idBitMsg::Init ( byte data,
int  length 
)

Definition at line 155 of file BitMsg.h.

ID_INLINE void idBitMsg::Init ( const byte data,
int  length 
)

Definition at line 161 of file BitMsg.h.

ID_INLINE bool idBitMsg::IsOverflowed ( void  ) const

Definition at line 183 of file BitMsg.h.

ID_INLINE float idBitMsg::ReadAngle16 ( void  ) const

Definition at line 394 of file BitMsg.h.

ID_INLINE float idBitMsg::ReadAngle8 ( void  ) const

Definition at line 390 of file BitMsg.h.

int idBitMsg::ReadBits ( int  numBits) const

Definition at line 362 of file BitMsg.cpp.

ID_INLINE int idBitMsg::ReadByte ( void  ) const

Definition at line 363 of file BitMsg.h.

ID_INLINE void idBitMsg::ReadByteAlign ( void  ) const

Definition at line 355 of file BitMsg.h.

ID_INLINE int idBitMsg::ReadChar ( void  ) const

Definition at line 359 of file BitMsg.h.

int idBitMsg::ReadData ( void data,
int  length 
) const

Definition at line 457 of file BitMsg.cpp.

int idBitMsg::ReadDelta ( int  oldValue,
int  numBits 
) const
private

Definition at line 498 of file BitMsg.cpp.

ID_INLINE int idBitMsg::ReadDeltaByte ( int  oldValue) const

Definition at line 406 of file BitMsg.h.

int idBitMsg::ReadDeltaByteCounter ( int  oldValue) const

Definition at line 510 of file BitMsg.cpp.

ID_INLINE int idBitMsg::ReadDeltaChar ( int  oldValue) const

Definition at line 402 of file BitMsg.h.

bool idBitMsg::ReadDeltaDict ( idDict dict,
const idDict base 
) const

Definition at line 558 of file BitMsg.cpp.

ID_INLINE float idBitMsg::ReadDeltaFloat ( float  oldValue) const

Definition at line 418 of file BitMsg.h.

ID_INLINE float idBitMsg::ReadDeltaFloat ( float  oldValue,
int  exponentBits,
int  mantissaBits 
) const

Definition at line 424 of file BitMsg.h.

ID_INLINE int idBitMsg::ReadDeltaLong ( int  oldValue) const

Definition at line 414 of file BitMsg.h.

int idBitMsg::ReadDeltaLongCounter ( int  oldValue) const

Definition at line 542 of file BitMsg.cpp.

ID_INLINE int idBitMsg::ReadDeltaShort ( int  oldValue) const

Definition at line 410 of file BitMsg.h.

int idBitMsg::ReadDeltaShortCounter ( int  oldValue) const

Definition at line 526 of file BitMsg.cpp.

ID_INLINE idVec3 idBitMsg::ReadDir ( int  numBits) const

Definition at line 398 of file BitMsg.h.

ID_INLINE float idBitMsg::ReadFloat ( void  ) const

Definition at line 379 of file BitMsg.h.

ID_INLINE float idBitMsg::ReadFloat ( int  exponentBits,
int  mantissaBits 
) const

Definition at line 385 of file BitMsg.h.

ID_INLINE int idBitMsg::ReadLong ( void  ) const

Definition at line 375 of file BitMsg.h.

void idBitMsg::ReadNetadr ( netadr_t adr) const

Definition at line 483 of file BitMsg.cpp.

ID_INLINE int idBitMsg::ReadShort ( void  ) const

Definition at line 367 of file BitMsg.h.

int idBitMsg::ReadString ( char *  buffer,
int  bufferSize 
) const

Definition at line 424 of file BitMsg.cpp.

ID_INLINE int idBitMsg::ReadUShort ( void  ) const

Definition at line 371 of file BitMsg.h.

ID_INLINE void idBitMsg::RestoreReadState ( int  c,
int  b 
)

Definition at line 260 of file BitMsg.h.

ID_INLINE void idBitMsg::RestoreWriteState ( int  s,
int  b 
)

Definition at line 223 of file BitMsg.h.

ID_INLINE void idBitMsg::SaveReadState ( int c,
int b 
) const

Definition at line 255 of file BitMsg.h.

ID_INLINE void idBitMsg::SaveWriteState ( int s,
int b 
) const

Definition at line 218 of file BitMsg.h.

ID_INLINE void idBitMsg::SetAllowOverflow ( bool  set)

Definition at line 179 of file BitMsg.h.

ID_INLINE void idBitMsg::SetReadBit ( int  bit)

Definition at line 243 of file BitMsg.h.

ID_INLINE void idBitMsg::SetReadCount ( int  bytes)

Definition at line 235 of file BitMsg.h.

ID_INLINE void idBitMsg::SetSize ( int  size)

Definition at line 191 of file BitMsg.h.

ID_INLINE void idBitMsg::SetWriteBit ( int  bit)

Definition at line 203 of file BitMsg.h.

ID_INLINE void idBitMsg::WriteAngle16 ( float  f)

Definition at line 312 of file BitMsg.h.

ID_INLINE void idBitMsg::WriteAngle8 ( float  f)

Definition at line 308 of file BitMsg.h.

void idBitMsg::WriteBits ( int  value,
int  numBits 
)

Definition at line 110 of file BitMsg.cpp.

ID_INLINE void idBitMsg::WriteByte ( int  c)

Definition at line 283 of file BitMsg.h.

ID_INLINE void idBitMsg::WriteByteAlign ( void  )

Definition at line 275 of file BitMsg.h.

ID_INLINE void idBitMsg::WriteChar ( int  c)

Definition at line 279 of file BitMsg.h.

void idBitMsg::WriteData ( const void data,
int  length 
)

Definition at line 210 of file BitMsg.cpp.

void idBitMsg::WriteDelta ( int  oldValue,
int  newValue,
int  numBits 
)
private

Definition at line 231 of file BitMsg.cpp.

ID_INLINE void idBitMsg::WriteDeltaByte ( int  oldValue,
int  newValue 
)

Definition at line 324 of file BitMsg.h.

void idBitMsg::WriteDeltaByteCounter ( int  oldValue,
int  newValue 
)

Definition at line 245 of file BitMsg.cpp.

ID_INLINE void idBitMsg::WriteDeltaChar ( int  oldValue,
int  newValue 
)

Definition at line 320 of file BitMsg.h.

bool idBitMsg::WriteDeltaDict ( const idDict dict,
const idDict base 
)

Definition at line 308 of file BitMsg.cpp.

ID_INLINE void idBitMsg::WriteDeltaFloat ( float  oldValue,
float  newValue 
)

Definition at line 336 of file BitMsg.h.

ID_INLINE void idBitMsg::WriteDeltaFloat ( float  oldValue,
float  newValue,
int  exponentBits,
int  mantissaBits 
)

Definition at line 340 of file BitMsg.h.

ID_INLINE void idBitMsg::WriteDeltaLong ( int  oldValue,
int  newValue 
)

Definition at line 332 of file BitMsg.h.

void idBitMsg::WriteDeltaLongCounter ( int  oldValue,
int  newValue 
)

Definition at line 287 of file BitMsg.cpp.

ID_INLINE void idBitMsg::WriteDeltaShort ( int  oldValue,
int  newValue 
)

Definition at line 328 of file BitMsg.h.

void idBitMsg::WriteDeltaShortCounter ( int  oldValue,
int  newValue 
)

Definition at line 266 of file BitMsg.cpp.

ID_INLINE void idBitMsg::WriteDir ( const idVec3 dir,
int  numBits 
)

Definition at line 316 of file BitMsg.h.

ID_INLINE void idBitMsg::WriteFloat ( float  f)

Definition at line 299 of file BitMsg.h.

ID_INLINE void idBitMsg::WriteFloat ( float  f,
int  exponentBits,
int  mantissaBits 
)

Definition at line 303 of file BitMsg.h.

ID_INLINE void idBitMsg::WriteLong ( int  c)

Definition at line 295 of file BitMsg.h.

void idBitMsg::WriteNetadr ( const netadr_t  adr)

Definition at line 219 of file BitMsg.cpp.

ID_INLINE void idBitMsg::WriteShort ( int  c)

Definition at line 287 of file BitMsg.h.

void idBitMsg::WriteString ( const char *  s,
int  maxLength = -1,
bool  make7Bit = true 
)

Definition at line 174 of file BitMsg.cpp.

ID_INLINE void idBitMsg::WriteUShort ( int  c)

Definition at line 291 of file BitMsg.h.

Member Data Documentation

bool idBitMsg::allowOverflow
private

Definition at line 144 of file BitMsg.h.

int idBitMsg::curSize
private

Definition at line 140 of file BitMsg.h.

int idBitMsg::maxSize
private

Definition at line 139 of file BitMsg.h.

bool idBitMsg::overflowed
private

Definition at line 145 of file BitMsg.h.

int idBitMsg::readBit
mutableprivate

Definition at line 143 of file BitMsg.h.

int idBitMsg::readCount
mutableprivate

Definition at line 142 of file BitMsg.h.

const byte* idBitMsg::readData
private

Definition at line 138 of file BitMsg.h.

int idBitMsg::writeBit
private

Definition at line 141 of file BitMsg.h.

byte* idBitMsg::writeData
private

Definition at line 137 of file BitMsg.h.


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