panda3d.core.DatagramIterator

class DatagramIterator

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.

Inheritance diagram

Inheritance diagram of DatagramIterator

__init__() → None
__init__(datagram: Datagram, offset: size_t) → None
__init__(param0: DatagramIterator) → None
extractBytes(size: size_t) → bytes

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

getBeFloat32() → PN_float32

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

Return type

PN_float32

getBeFloat64() → PN_float64

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

Return type

PN_float64

getBeInt16() → int16_t

Extracts a signed 16-bit big-endian integer.

Return type

int16_t

getBeInt32() → int32_t

Extracts a signed 32-bit big-endian integer.

Return type

int32_t

getBeInt64() → int64_t

Extracts a signed 64-bit big-endian integer.

Return type

int64_t

getBeUint16() → uint16_t

Extracts an unsigned 16-bit big-endian integer.

Return type

uint16_t

getBeUint32() → uint32_t

Extracts an unsigned 32-bit big-endian integer.

Return type

uint32_t

getBeUint64() → uint64_t

Extracts an unsigned 64-bit big-endian integer.

Return type

uint64_t

getBlob() → bytes

Extracts a variable-length binary blob.

getBlob32() → bytes

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

getBool() → bool

Extracts a boolean value.

static getClassType() → TypeHandle
Return type

TypeHandle

getCurrentIndex() → size_t

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

Return type

size_t

getDatagram() → Datagram

Return the datagram of this iterator.

Return type

Datagram

getFixedString(size: size_t) → str

Extracts a fixed-length string. However, if a zero byte occurs within the string, it marks the end of the string.

getFloat32() → PN_float32

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

Return type

PN_float32

getFloat64() → PN_float64

Extracts a 64-bit floating-point number.

Return type

PN_float64

getInt16() → int16_t

Extracts a signed 16-bit integer.

Return type

int16_t

getInt32() → int32_t

Extracts a signed 32-bit integer.

Return type

int32_t

getInt64() → int64_t

Extracts a signed 64-bit integer.

Return type

int64_t

getInt8() → int8_t

Extracts a signed 8-bit integer.

Return type

int8_t

getRemainingBytes() → bytes

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

getRemainingSize() → size_t

Return the bytes left in the datagram.

Return type

size_t

getStdfloat() → float

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

getString() → str

Extracts a variable-length string.

getString32() → str

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

getUint16() → uint16_t

Extracts an unsigned 16-bit integer.

Return type

uint16_t

getUint32() → uint32_t

Extracts an unsigned 32-bit integer.

Return type

uint32_t

getUint64() → uint64_t

Extracts an unsigned 64-bit integer.

Return type

uint64_t

getUint8() → uint8_t

Extracts an unsigned 8-bit integer.

Return type

uint8_t

getWstring() → str

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

getZString() → str

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

output(out: ostream) → None

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

skipBytes(size: size_t) → None

Skips over the indicated number of bytes in the datagram.

write(out: ostream, indent: int) → None

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