DatagramIterator

from panda3d.core import DatagramIterator
class DatagramIterator

Bases:

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.

Note that it is the responsibility of the caller to ensure that the datagram object is not destructed while this DatagramIterator is in use.

Inheritance diagram

Inheritance diagram of DatagramIterator

__init__()
__init__(datagram: Datagram, offset: int)
__init__(param0: DatagramIterator)
extractBytes(size: int) bytes

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

getBeFloat32() float

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

getBeFloat64() float

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

getBeInt16() int

Extracts a signed 16-bit big-endian integer.

getBeInt32() int

Extracts a signed 32-bit big-endian integer.

getBeInt64() int

Extracts a signed 64-bit big-endian integer.

getBeUint16() int

Extracts an unsigned 16-bit big-endian integer.

getBeUint32() int

Extracts an unsigned 32-bit big-endian integer.

getBeUint64() int

Extracts an unsigned 64-bit big-endian integer.

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
getCurrentIndex() int

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

getDatagram() Datagram

Return the datagram of this iterator.

getFixedString(size: int) str

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

getFloat32() float

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

getFloat64() float

Extracts a 64-bit floating-point number.

getInt16() int

Extracts a signed 16-bit integer.

getInt32() int

Extracts a signed 32-bit integer.

getInt64() int

Extracts a signed 64-bit integer.

getInt8() int8_t

Extracts a signed 8-bit integer.

getRemainingBytes() bytes

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

getRemainingSize() int

Return the bytes left in the datagram.

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() int

Extracts an unsigned 16-bit integer.

getUint32() int

Extracts an unsigned 32-bit integer.

getUint64() int

Extracts an unsigned 64-bit integer.

getUint8() uint8_t

Extracts an unsigned 8-bit integer.

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)

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

skipBytes(size: int)

Skips over the indicated number of bytes in the datagram.

write(out: ostream, indent: int)

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