Panda3D
Public Member Functions | Static Public Member Functions | List of all members
DatagramIterator Class Reference

A class to retrieve the individual data elements previously stored in a Datagram. More...

Inheritance diagram for DatagramIterator:
PyDatagramIterator

Public Member Functions

 __init__ ()
 
 __init__ (const Datagram datagram, int offset)
 
 __init__ (const DatagramIterator)
 
VectorUchar extractBytes (int size)
 Extracts the indicated number of bytes in the datagram and returns them as a string. More...
 
PNFloat32 getBeFloat32 ()
 Extracts a 32-bit big-endian single-precision floating-point number. More...
 
PNFloat64 getBeFloat64 ()
 Extracts a 64-bit big-endian floating-point number. More...
 
int16_t getBeInt16 ()
 Extracts a signed 16-bit big-endian integer. More...
 
int32_t getBeInt32 ()
 Extracts a signed 32-bit big-endian integer. More...
 
int64_t getBeInt64 ()
 Extracts a signed 64-bit big-endian integer. More...
 
uint16_t getBeUint16 ()
 Extracts an unsigned 16-bit big-endian integer. More...
 
uint32_t getBeUint32 ()
 Extracts an unsigned 32-bit big-endian integer. More...
 
uint64_t getBeUint64 ()
 Extracts an unsigned 64-bit big-endian integer. More...
 
VectorUchar getBlob ()
 Extracts a variable-length binary blob. More...
 
VectorUchar getBlob32 ()
 Extracts a variable-length binary blob with a 32-bit size field. More...
 
bool getBool ()
 Extracts a boolean value. More...
 
int getCurrentIndex ()
 Returns the current position within the datagram of the next piece of data to extract. More...
 
const Datagram getDatagram ()
 Return the datagram of this iterator. More...
 
str getFixedString (int size)
 Extracts a fixed-length string. More...
 
PNFloat32 getFloat32 ()
 Extracts a 32-bit single-precision floating-point number. More...
 
PNFloat64 getFloat64 ()
 Extracts a 64-bit floating-point number. More...
 
int16_t getInt16 ()
 Extracts a signed 16-bit integer. More...
 
int32_t getInt32 ()
 Extracts a signed 32-bit integer. More...
 
int64_t getInt64 ()
 Extracts a signed 64-bit integer. More...
 
int8_t getInt8 ()
 Extracts a signed 8-bit integer. More...
 
VectorUchar getRemainingBytes ()
 Returns the remaining bytes in the datagram as a string, but does not extract them from the iterator. More...
 
int getRemainingSize ()
 Return the bytes left in the datagram. More...
 
float getStdfloat ()
 Extracts either a 32-bit or a 64-bit floating-point number, according to Datagram::set_stdfloat_double(). More...
 
str getString ()
 Extracts a variable-length string. More...
 
str getString32 ()
 Extracts a variable-length string with a 32-bit length field. More...
 
uint16_t getUint16 ()
 Extracts an unsigned 16-bit integer. More...
 
uint32_t getUint32 ()
 Extracts an unsigned 32-bit integer. More...
 
uint64_t getUint64 ()
 Extracts an unsigned 64-bit integer. More...
 
uint8_t getUint8 ()
 Extracts an unsigned 8-bit integer. More...
 
str getWstring ()
 Extracts a variable-length wstring (with a 32-bit length field). More...
 
str getZString ()
 Extracts a variable-length string, as a NULL-terminated string. More...
 
 output (Ostream out)
 Write a string representation of this instance to <out>. More...
 
 skipBytes (int size)
 Skips over the indicated number of bytes in the datagram. More...
 
 write (Ostream out, unsigned int indent)
 Write a string representation of this instance to <out>. More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 

Detailed Description

A class to retrieve the individual data elements previously stored in a Datagram.

Elements may be retrieved one at a time; it is up to the caller to know the correct type and order of each element.

Member Function Documentation

◆ __init__() [1/3]

__init__ ( )

◆ __init__() [2/3]

__init__ ( const Datagram  datagram,
int  offset 
)

◆ __init__() [3/3]

__init__ ( const  DatagramIterator)

◆ extractBytes()

VectorUchar extractBytes ( int  size)

Extracts the indicated number of bytes in the datagram and returns them as a string.

◆ getBeFloat32()

PNFloat32 getBeFloat32 ( )

Extracts a 32-bit big-endian single-precision floating-point number.

◆ getBeFloat64()

PNFloat64 getBeFloat64 ( )

Extracts a 64-bit big-endian floating-point number.

◆ getBeInt16()

int16_t getBeInt16 ( )

Extracts a signed 16-bit big-endian integer.

◆ getBeInt32()

int32_t getBeInt32 ( )

Extracts a signed 32-bit big-endian integer.

◆ getBeInt64()

int64_t getBeInt64 ( )

Extracts a signed 64-bit big-endian integer.

◆ getBeUint16()

uint16_t getBeUint16 ( )

Extracts an unsigned 16-bit big-endian integer.

◆ getBeUint32()

uint32_t getBeUint32 ( )

Extracts an unsigned 32-bit big-endian integer.

◆ getBeUint64()

uint64_t getBeUint64 ( )

Extracts an unsigned 64-bit big-endian integer.

◆ getBlob()

VectorUchar getBlob ( )

Extracts a variable-length binary blob.

◆ getBlob32()

VectorUchar getBlob32 ( )

Extracts a variable-length binary blob with a 32-bit size field.

◆ getBool()

bool getBool ( )

Extracts a boolean value.

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getCurrentIndex()

int getCurrentIndex ( )

Returns the current position within the datagram of the next piece of data to extract.

◆ getDatagram()

const Datagram getDatagram ( )

Return the datagram of this iterator.

◆ getFixedString()

str getFixedString ( int  size)

Extracts a fixed-length string.

However, if a zero byte occurs within the string, it marks the end of the string.

◆ getFloat32()

PNFloat32 getFloat32 ( )

Extracts a 32-bit single-precision floating-point number.

◆ getFloat64()

PNFloat64 getFloat64 ( )

Extracts a 64-bit floating-point number.

◆ getInt16()

int16_t getInt16 ( )

Extracts a signed 16-bit integer.

◆ getInt32()

int32_t getInt32 ( )

Extracts a signed 32-bit integer.

◆ getInt64()

int64_t getInt64 ( )

Extracts a signed 64-bit integer.

◆ getInt8()

int8_t getInt8 ( )

Extracts a signed 8-bit integer.

◆ getRemainingBytes()

VectorUchar getRemainingBytes ( )

Returns the remaining bytes in the datagram as a string, but does not extract them from the iterator.

◆ getRemainingSize()

int getRemainingSize ( )

Return the bytes left in the datagram.

◆ getStdfloat()

float getStdfloat ( )

Extracts either a 32-bit or a 64-bit floating-point number, according to Datagram::set_stdfloat_double().

◆ getString()

str getString ( )

Extracts a variable-length string.

◆ getString32()

str getString32 ( )

Extracts a variable-length string with a 32-bit length field.

◆ getUint16()

uint16_t getUint16 ( )

Extracts an unsigned 16-bit integer.

◆ getUint32()

uint32_t getUint32 ( )

Extracts an unsigned 32-bit integer.

◆ getUint64()

uint64_t getUint64 ( )

Extracts an unsigned 64-bit integer.

◆ getUint8()

uint8_t getUint8 ( )

Extracts an unsigned 8-bit integer.

◆ getWstring()

str getWstring ( )

Extracts a variable-length wstring (with a 32-bit length field).

◆ getZString()

str getZString ( )

Extracts a variable-length string, as a NULL-terminated string.

◆ output()

output ( Ostream  out)

Write a string representation of this instance to <out>.

◆ skipBytes()

skipBytes ( int  size)

Skips over the indicated number of bytes in the datagram.

◆ write()

write ( Ostream  out,
unsigned int  indent 
)

Write a string representation of this instance to <out>.