VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes

Instances of DtStreamWriter encode values into a byte array. More...

+ Collaboration diagram for DtStreamWriter:

Public Member Functions

 DtStreamWriter (int length=0)
 constructor takes size of internal buffer to create. Care must be taken to allocate enough space. More...
 
 DtStreamWriter (unsigned char *buffer, int length)
 constructor works on a given buffer and it's size. More...
 
virtual ~DtStreamWriter ()
 destructor More...
 
unsigned char * buffer ()
 get a copy of the buffer being written to More...
 
int length ()
 
void writeBool (bool b)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeInt8 (char num)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeUInt8 (unsigned char num)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeInt16 (short num)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeUInt16 (unsigned short num)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeInt32 (int num)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeUInt32 (unsigned int num)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeInt64 (long long num)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeUInt64 (unsigned long long num)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeSingle (float num)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeDouble (double num)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeString (const std::string &str)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeVector (const DtVector &vec)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeTaitBryan (const DtTaitBryan &tb)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeQuaternion (const DtQuaternion &q)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeEntityId (const DtEntityIdentifier &id)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeEntityType (const DtEntityType &type)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 
void writeBytes (unsigned char *bytes, int length)
 value readers return a value and increment the current position in the byte stream based on the size value More...
 

Protected Member Functions

void encodeStringSize (int size)
 encode the size of the string as a variable sized integer More...
 

Protected Attributes

unsigned char * myBuffer
 
unsigned char * myWriteHead
 
int myLength
 
bool myBufferAlloced
 

Detailed Description

Instances of DtStreamWriter encode values into a byte array.

Constructor & Destructor Documentation

DtStreamWriter::DtStreamWriter ( int  length = 0)

constructor takes size of internal buffer to create. Care must be taken to allocate enough space.

DtStreamWriter::DtStreamWriter ( unsigned char *  buffer,
int  length 
)

constructor works on a given buffer and it's size.

Optionally creates a buffer if the input buffer is null

virtual DtStreamWriter::~DtStreamWriter ( )
virtual

destructor

Member Function Documentation

unsigned char* DtStreamWriter::buffer ( )

get a copy of the buffer being written to

void DtStreamWriter::encodeStringSize ( int  size)
protected

encode the size of the string as a variable sized integer

int DtStreamWriter::length ( )
void DtStreamWriter::writeBool ( bool  b)

value readers return a value and increment the current position in the byte stream based on the size value

void DtStreamWriter::writeBytes ( unsigned char *  bytes,
int  length 
)

value readers return a value and increment the current position in the byte stream based on the size value

void DtStreamWriter::writeDouble ( double  num)

value readers return a value and increment the current position in the byte stream based on the size value

Referenced by TransmitterStateMessage::BeamAntennaPattern::serialize().

void DtStreamWriter::writeEntityId ( const DtEntityIdentifier id)

value readers return a value and increment the current position in the byte stream based on the size value

void DtStreamWriter::writeEntityType ( const DtEntityType type)

value readers return a value and increment the current position in the byte stream based on the size value

void DtStreamWriter::writeInt16 ( short  num)

value readers return a value and increment the current position in the byte stream based on the size value

Referenced by EntityStateMessage::AttPart::serialize().

void DtStreamWriter::writeInt32 ( int  num)
void DtStreamWriter::writeInt64 ( long long  num)

value readers return a value and increment the current position in the byte stream based on the size value

void DtStreamWriter::writeInt8 ( char  num)

value readers return a value and increment the current position in the byte stream based on the size value

Referenced by EntityStateMessage::AttPart::serialize().

void DtStreamWriter::writeQuaternion ( const DtQuaternion q)

value readers return a value and increment the current position in the byte stream based on the size value

void DtStreamWriter::writeSingle ( float  num)

value readers return a value and increment the current position in the byte stream based on the size value

Referenced by DetonateMessage::Parameter::serialize(), TransmitterStateMessage::SphericalAntennaPattern::serialize(), EntityStateMessage::Parameter::serialize(), and TransmitterStateMessage::BeamAntennaPattern::serialize().

void DtStreamWriter::writeString ( const std::string &  str)

value readers return a value and increment the current position in the byte stream based on the size value

Referenced by AttributeChangeRequestMessage::AttributePair::serialize().

void DtStreamWriter::writeTaitBryan ( const DtTaitBryan tb)

value readers return a value and increment the current position in the byte stream based on the size value

void DtStreamWriter::writeUInt16 ( unsigned short  num)

value readers return a value and increment the current position in the byte stream based on the size value

Referenced by IffStateMessage::SimulationAddress::serialize(), and TransmitterStateMessage::ModulationType::serialize().

void DtStreamWriter::writeUInt32 ( unsigned int  num)

value readers return a value and increment the current position in the byte stream based on the size value

void DtStreamWriter::writeUInt64 ( unsigned long long  num)

value readers return a value and increment the current position in the byte stream based on the size value

void DtStreamWriter::writeUInt8 ( unsigned char  num)
void DtStreamWriter::writeVector ( const DtVector vec)

value readers return a value and increment the current position in the byte stream based on the size value

Member Data Documentation

unsigned char* DtStreamWriter::myBuffer
protected
bool DtStreamWriter::myBufferAlloced
protected
int DtStreamWriter::myLength
protected
unsigned char* DtStreamWriter::myWriteHead
protected

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

Document ID: Generated on Tue Feb 2 21:02:17 EST 2021 from SVN revision 223668
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)