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