VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtStreamReader Class Reference

Detailed Description

This class provides methods for reading various data types from a byte stream, maintaining the current read position, and handling platform-specific byte ordering.

#include <byteStream.h>

Public Member Functions

 DtStreamReader (char *buffer, int length, bool makeCopy=false)
 
virtual ~DtStreamReader ()
 

Value Readers

Methods to read values from the byte stream

These methods return a value and increment the current position in the byte stream based on the size of the value read.

char * myBuffer
 
char * myReadHead
 
int myLength
 
bool myShouldDelete
 
bool readBool ()
 
char readInt8 ()
 
unsigned char readUInt8 ()
 
short readInt16 ()
 
unsigned short readUInt16 ()
 
int readInt32 ()
 
unsigned int readUInt32 ()
 
Int64 readInt64 ()
 
UInt64 readUInt64 ()
 
float readSingle ()
 
double readDouble ()
 
std::string readString ()
 
DtVector readVector ()
 
DtTaitBryan readTaitBryan ()
 
DtQuaternion readQuaternion ()
 
DtEntityIdentifier readEntityId ()
 
DtEntityType readEntityType ()
 
DtSimulationAddress readSimulationAddress ()
 
char * readBytes (int length)
 
int decodeStringSize ()
 

Constructor & Destructor Documentation

◆ DtStreamReader()

makVre::DtStreamReader::DtStreamReader ( char * buffer,
int length,
bool makeCopy = false )

Constructor.

Parameters
bufferPointer to the buffer to read from
lengthLength of the buffer in bytes
makeCopyIf true, make a copy of the buffer; if false, use the provided buffer directly

◆ ~DtStreamReader()

virtual makVre::DtStreamReader::~DtStreamReader ( )
virtual

Virtual destructor.

Cleans up resources, including the buffer if it was copied

Member Function Documentation

◆ readBool()

bool makVre::DtStreamReader::readBool ( )

Reads a boolean value.

Returns
The boolean value read from the stream

◆ readInt8()

char makVre::DtStreamReader::readInt8 ( )

Reads a signed 8-bit integer.

Returns
The signed 8-bit integer read from the stream

◆ readUInt8()

unsigned char makVre::DtStreamReader::readUInt8 ( )

Reads an unsigned 8-bit integer.

Returns
The unsigned 8-bit integer read from the stream

◆ readInt16()

short makVre::DtStreamReader::readInt16 ( )

Reads a signed 16-bit integer.

Returns
The signed 16-bit integer read from the stream

◆ readUInt16()

unsigned short makVre::DtStreamReader::readUInt16 ( )

Reads an unsigned 16-bit integer.

Returns
The unsigned 16-bit integer read from the stream

◆ readInt32()

int makVre::DtStreamReader::readInt32 ( )

Reads a signed 32-bit integer.

Returns
The signed 32-bit integer read from the stream

◆ readUInt32()

unsigned int makVre::DtStreamReader::readUInt32 ( )

Reads an unsigned 32-bit integer.

Returns
The unsigned 32-bit integer read from the stream

◆ readInt64()

Int64 makVre::DtStreamReader::readInt64 ( )

Reads a signed 64-bit integer.

Returns
The signed 64-bit integer read from the stream

◆ readUInt64()

UInt64 makVre::DtStreamReader::readUInt64 ( )

Reads an unsigned 64-bit integer.

Returns
The unsigned 64-bit integer read from the stream

◆ readSingle()

float makVre::DtStreamReader::readSingle ( )

Reads a 32-bit floating point value.

Returns
The 32-bit float read from the stream

◆ readDouble()

double makVre::DtStreamReader::readDouble ( )

Reads a 64-bit floating point value.

Returns
The 64-bit double read from the stream

◆ readString()

std::string makVre::DtStreamReader::readString ( )

Reads a string value.

Returns
The string read from the stream

◆ readVector()

DtVector makVre::DtStreamReader::readVector ( )

Reads a 3D vector.

Returns
The vector read from the stream

◆ readTaitBryan()

DtTaitBryan makVre::DtStreamReader::readTaitBryan ( )

Reads a Tait-Bryan angles representation.

Returns
The Tait-Bryan angles read from the stream

◆ readQuaternion()

DtQuaternion makVre::DtStreamReader::readQuaternion ( )

Reads a quaternion.

Returns
The quaternion read from the stream

◆ readEntityId()

DtEntityIdentifier makVre::DtStreamReader::readEntityId ( )

Reads an entity identifier.

Returns
The entity identifier read from the stream

◆ readEntityType()

DtEntityType makVre::DtStreamReader::readEntityType ( )

Reads an entity type.

Returns
The entity type read from the stream

◆ readSimulationAddress()

DtSimulationAddress makVre::DtStreamReader::readSimulationAddress ( )

Reads a simulation address.

Returns
The simulation address read from the stream

◆ readBytes()

char * makVre::DtStreamReader::readBytes ( int length)

Reads a byte array of specified length.

Parameters
lengthNumber of bytes to read
Returns
Pointer to the read bytes (caller must manage memory)

◆ decodeStringSize()

int makVre::DtStreamReader::decodeStringSize ( )
protected

Determines the size of a string from a variable length encoded integer.

Returns
The decoded string size

Member Data Documentation

◆ myBuffer

char* makVre::DtStreamReader::myBuffer
protected

Pointer to the buffer being read from.

◆ myReadHead

char* makVre::DtStreamReader::myReadHead
protected

Current position in the buffer.

◆ myLength

int makVre::DtStreamReader::myLength
protected

Total length of the buffer.

◆ myShouldDelete

bool makVre::DtStreamReader::myShouldDelete
protected

Flag indicating if the buffer should be deleted on destruction.


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