LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
Rhesus::Messenger::NetBuffer Class Reference

Implements a buffer for data that can be sent over the network. More...

#include <NetBuffer.h>

Public Member Functions

 NetBuffer ()
 Initializes the NetBuffer.
 
 NetBuffer (const int bufferDefaultSize)
 Initializes the NetBuffer with a buffer size of bufferDefaultSize.
 
 NetBuffer (UINT8 *buff, int len)
 Initializes the NetBuffer with a buffer.
 
 ~NetBuffer ()
 Releases the resources utilized by the NetBuffer.
 
void Write (UINT8 c)
 Writes a one-byte value to the buffer.
 
void Write (UINT8 *c, UINT16 len)
 Writes a length-prefixed byte array to the buffer.
 
void WriteRaw (UINT8 *c, UINT16 len)
 Writes a byte array to the buffer.
 
void Write (string str)
 Wriets a length-prefixed string to the buffer.
 
void Write (INT32 i)
 Writes an four-byte value to the buffer.
 
void Write (UINT32 i)
 Writes a four-byte unsigned value to the buffer.
 
void Write (INT16 s)
 Writes a two-byte value to the buffer.
 
void Write (double d)
 Writes a floating point value to the buffer.
 
void Write (float f)
 Writes a floating point value to the buffer.
 
void Write (bool b)
 Writes a one-bit boolean value to the buffer.
 
void WritePadBits ()
 Finishes the current byte to improve CPU read/write time.
 
UINT8 ReadChar ()
 Reads a one-byte value from the buffer and advances the internal pointer by 8 bits.
 
UINT8 * ReadBytes ()
 Reads a length-prefixed byte array from the buffer and advances the internal pointer.
 
string ReadStdString ()
 Reads a length-prefixed STL string from the buffer and advances the internal pointer.
 
INT32 ReadInt32 ()
 Reads a four-byte value from the buffer and advances the internal pointer by 32 bits.
 
UINT32 ReadUInt32 ()
 Reads a four-byte unsigned value from the buffer and advances the internal pointer by 32 bits.
 
INT16 ReadInt16 ()
 Reads a two-byte value from the buffer and advances the internal pointer by 16 bits.
 
double ReadDouble ()
 Reads a floating point value from the buffer and advances the internal pointer.
 
float ReadFloat ()
 Reads a floating point value from the buffer and advances the internal pointer.
 
bool ReadBool ()
 Reads a one-bit boolean value from the buffer and advances the internal pointer to the next bit.
 
void SkipPadBits ()
 Advances the internal pointer to skip over the remaining values in the current byte to improve CPU read time.
 
int GetBytePos ()
 Gets the position of the internal pointer in bytes.
 
int GetBitIndexInCurrentByte ()
 Gets the position of the internal pointer in bits.
 
UINT8 * GetBuffer ()
 Gets the internal buffer.
 

Detailed Description

Implements a buffer for data that can be sent over the network.

Author
Tony Peng

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