SEGS  0.6.1-develop [3e741b81]
Super Entity Game Server
Public Member Functions | Friends | List of all members
BitStream Class Reference

#include <BitStream.h>

Inheritance diagram for BitStream:
Inheritance graph
Collaboration diagram for BitStream:
Collaboration graph

Public Member Functions

 BitStream (size_t size)
 
 BitStream (uint8_t *from, size_t bitsize)
 
 BitStream (const BitStream &bs)
 
 BitStream (BitStream &&bs) noexcept
 
BitStreamoperator= (const BitStream &bs)
 
 ~BitStream ()
 
void StoreBits (uint32_t nBits, uint32_t dataBits)
 
void uStoreBits (uint32_t nBits, uint32_t dataBits)
 
void StoreFloat (float val)
 
void StorePackedBits (uint32_t nBits, uint32_t dataBits)
 
void appendBitStream (BitStream &src)
 
void StoreBitArray (const uint8_t *array, size_t nBits)
 BitStream::StoreBitArray Stores an array of bits in the bit stream buffer. The main difference between StoreBitArray and StoreBits, is that StoreBitArray can accept more than 32 bits at a time. More...
 
void StoreString (const char *str)
 
void StoreString (const QByteArray &str)
 
void StoreString (const QString &str)
 
int32_t GetBits (uint32_t nBits)
 
int32_t uGetBits (uint32_t nBits)
 
int32_t GetPackedBits (uint32_t minbits)
 
void GetBitArray (uint8_t *array, uint32_t nBits)
 
void GetString (QString &str)
 Retrieves a null-terminated C-style string from the bit stream. More...
 
float GetFloat ()
 
int64_t Get64Bits ()
 Read upto 8 bytes from input stream and return them as 64bit integer. More...
 
uint32_t GetWritableBits () const
 
uint32_t GetReadableBits () const
 
uint32_t GetAvailSize () const
 
bool IsByteAligned () const
 
void SetReadPos (uint32_t pos)
 
uint32_t GetReadPos () const
 
void SetWritePos (uint32_t pos)
 
uint32_t GetWritePos () const
 
void UseByteAlignedMode (bool toggle)
 
void ByteAlign (bool read_part=true, bool write_part=true)
 
void ResetReading ()
 
void ResetOffsets ()
 
void CompressAndStoreString (const char *str)
 
void GetAndDecompressString (QString &tgt)
 
- Public Member Functions inherited from GrowingBuffer
 GrowingBuffer (const GrowingBuffer &)
 
 GrowingBuffer (GrowingBuffer &&) noexcept
 
 GrowingBuffer (uint8_t *buf, uint32_t size, bool become_owner)
 
 GrowingBuffer (uint32_t max_size, uint8_t safe_area, uint32_t current_size)
 
 ~GrowingBuffer ()
 
void PutString (const char *t)
 
void PutBytes (const uint8_t *t, uint32_t len)
 
void GetString (char *t)
 
bool GetBytes (uint8_t *t, uint32_t len)
 
void uGetString (char *t)
 
void uGetBytes (uint8_t *t, uint32_t len)
 
void uPutString (const char *t)
 
void uPutBytes (const uint8_t *t, uint32_t len)
 
template<typename T >
void Put (const T &val)
 
template<typename T >
void Get (T &val)
 
template<typename T >
void uPut (const T &val)
 
template<typename T >
void uGet (T &val)
 
template<typename T >
ruGet ()
 
void PopFront (uint32_t count)
 
uint32_t GetMaxSize () const
 this method removes up-to 'count' elements from the beginning of the buffer More...
 
uint32_t GetAvailSize () const
 
uint32_t GetDataSize () const
 
uint32_t GetReadableDataSize () const
 
uint8_t * GetBuffer () const
 
uint32_t getLastError () const
 
void setLastError (uint32_t val)
 
uint8_t * read_ptr ()
 
const uint8_t * read_ptr () const
 
void read_ptr (int off)
 
uint8_t * write_ptr ()
 
void write_ptr (int off)
 
void Reset ()
 
void ResetReading ()
 
void ResetWriting ()
 
void ResetContents ()
 

Friends

template<class Archive >
void CEREAL_SAVE_FUNCTION_NAME (Archive &ar, const BitStream &buf)
 
template<class Archive >
void CEREAL_LOAD_FUNCTION_NAME (Archive &ar, BitStream &buf)
 Serialization for non-arithmetic vector types. More...
 

Additional Inherited Members

- Protected Member Functions inherited from GrowingBuffer
GrowingBufferoperator= (const GrowingBuffer &)=delete
 
int resize (uint32_t accommodate_size)
 
- Protected Attributes inherited from GrowingBuffer
uint8_t * m_buf
 
uint32_t m_write_off
 
uint32_t m_read_off
 
uint32_t m_size
 
uint32_t m_max_size
 
uint32_t m_last_err
 
uint8_t m_safe_area
 

Constructor & Destructor Documentation

◆ BitStream()

BitStream::BitStream ( BitStream &&  bs)
inlinenoexcept
Here is the call graph for this function:

Member Function Documentation

◆ appendBitStream()

void BitStream::appendBitStream ( BitStream src)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetReadableBits()

uint32_t BitStream::GetReadableBits ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetReadPos()

uint32_t BitStream::GetReadPos ( ) const
inline
Here is the caller graph for this function:

◆ GetWritableBits()

uint32_t BitStream::GetWritableBits ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetWritePos()

uint32_t BitStream::GetWritePos ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsByteAligned()

bool BitStream::IsByteAligned ( ) const
inline
Here is the caller graph for this function:

◆ ResetReading()

void BitStream::ResetReading ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetReadPos()

void BitStream::SetReadPos ( uint32_t  pos)
inline
Here is the caller graph for this function:

◆ SetWritePos()

void BitStream::SetWritePos ( uint32_t  pos)
inline

Friends And Related Function Documentation

◆ CEREAL_LOAD_FUNCTION_NAME

template<class Archive >
void CEREAL_LOAD_FUNCTION_NAME ( Archive &  ar,
BitStream buf 
)
friend

Serialization for non-arithmetic vector types.

◆ CEREAL_SAVE_FUNCTION_NAME

template<class Archive >
void CEREAL_SAVE_FUNCTION_NAME ( Archive &  ar,
const BitStream buf 
)
friend

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