Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions

# DatagramIterator Class Reference

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

List of all members.

## Public Member Functions
| DatagramIterator ()
| DatagramIterator (Datagram const datagram, unsigned int offset)
| DatagramIterator (DatagramIterator const copy)
| DatagramIterator (Datagram const datagram)
string | extractBytes (unsigned int size)
| Extracts the indicated number of bytes in the datagram and returns them as a string.
float | getBeFloat32 ()
| Extracts a 32-bit big-endian single-precision floating-point number.
double | getBeFloat64 ()
| Extracts a 64-bit big-endian floating-point number.
short int | getBeInt16 ()
| Extracts a signed 16-bit big-endian integer.
int | getBeInt32 ()
| Extracts a signed 32-bit big-endian integer.
long long int | getBeInt64 ()
| Extracts a signed 64-bit big-endian integer.
unsigned short int | getBeUint16 ()
| Extracts an unsigned 16-bit big-endian integer.
unsigned int | getBeUint32 ()
| Extracts an unsigned 32-bit big-endian integer.
unsigned long long int | getBeUint64 ()
| Extracts an unsigned 64-bit big-endian integer.
bool | getBool ()
| Extracts a boolean value.
unsigned int | getCurrentIndex ()
| Returns the current position within the datagram of the next piece of data to extract.
Datagram const | getDatagram ()
| Return the datagram of this iterator.
string | getFixedString (unsigned int size)
| Extracts a fixed-length string.
float | getFloat32 ()
| Extracts a 32-bit single-precision floating-point number.
double | getFloat64 ()
| Extracts a 64-bit floating-point number.
short int | getInt16 ()
| Extracts a signed 16-bit integer.
int | getInt32 ()
| Extracts a signed 32-bit integer.
long long int | getInt64 ()
| Extracts a signed 64-bit integer.
signed char | getInt8 ()
| Extracts a signed 8-bit integer.
string | 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().
string | getString ()
| Extracts a variable-length string.
string | getString32 ()
| Extracts a variable-length string with a 32-bit length field.
unsigned short int | getUint16 ()
| Extracts an unsigned 16-bit integer.
unsigned int | getUint32 ()
| Extracts an unsigned 32-bit integer.
unsigned long long int | getUint64 ()
| Extracts an unsigned 64-bit integer.
unsigned char | getUint8 ()
| Extracts an unsigned 8-bit integer.
string | getWstring ()
| Extracts a variable-length wstring (with a 32-bit length field).
string | getZString ()
| Extracts a variable-length string, as a NULL-terminated string.
DatagramIterator | operator= (DatagramIterator const copy)
| output (ostream out)
| Write a string representation of this instance to <out>.
| skipBytes (unsigned int size)
| Skips over the indicated number of bytes in the datagram.
| write (ostream out)
| Write a string representation of this instance to <out>.
| write (ostream out, unsigned int indent)
| Write a string representation of this instance to <out>.

## 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.

## Constructor & Destructor Documentation

DatagramIterator | ( |  | ) |

DatagramIterator | ( | Datagram const | datagram,
|  | unsigned int | offset
| ) |  |

DatagramIterator | ( | Datagram const | datagram | ) |

DatagramIterator | ( | DatagramIterator const | copy | ) |

## Member Function Documentation

string extractBytes | ( | unsigned int | size | ) |

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

float getBeFloat32 | ( |  | ) |

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

double getBeFloat64 | ( |  | ) |

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

short int getBeInt16 | ( |  | ) |

Extracts a signed 16-bit big-endian integer.

int getBeInt32 | ( |  | ) |

Extracts a signed 32-bit big-endian integer.

long long int getBeInt64 | ( |  | ) |

Extracts a signed 64-bit big-endian integer.

unsigned short int getBeUint16 | ( |  | ) |

Extracts an unsigned 16-bit big-endian integer.

unsigned int getBeUint32 | ( |  | ) |

Extracts an unsigned 32-bit big-endian integer.

unsigned long long int getBeUint64 | ( |  | ) |

Extracts an unsigned 64-bit big-endian integer.

bool getBool | ( |  | ) |

Extracts a boolean value.

unsigned int getCurrentIndex | ( |  | ) |

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

Datagram const getDatagram | ( |  | ) |

Return the datagram of this iterator.

string getFixedString | ( | unsigned int | size | ) |

Extracts a fixed-length string.

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

float getFloat32 | ( |  | ) |

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

double getFloat64 | ( |  | ) |

Extracts a 64-bit floating-point number.

short int getInt16 | ( |  | ) |

Extracts a signed 16-bit integer.

int getInt32 | ( |  | ) |

Extracts a signed 32-bit integer.

long long int getInt64 | ( |  | ) |

Extracts a signed 64-bit integer.

signed char getInt8 | ( |  | ) |

Extracts a signed 8-bit integer.

string 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().

string getString | ( |  | ) |

Extracts a variable-length string.

string getString32 | ( |  | ) |

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

unsigned short int getUint16 | ( |  | ) |

Extracts an unsigned 16-bit integer.

unsigned int getUint32 | ( |  | ) |

Extracts an unsigned 32-bit integer.

unsigned long long int getUint64 | ( |  | ) |

Extracts an unsigned 64-bit integer.

unsigned char getUint8 | ( |  | ) |

Extracts an unsigned 8-bit integer.

string getWstring | ( |  | ) |

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

string getZString | ( |  | ) |

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

DatagramIterator operator= | ( | DatagramIterator const | copy | ) |

output | ( | ostream | out | ) |

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

skipBytes | ( | unsigned int | size | ) |

Skips over the indicated number of bytes in the datagram.

write | ( | ostream | out | ) |

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

write | ( | ostream | out,
|  | unsigned int | indent
| ) |  |

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

All Classes Namespaces Functions Variables Enumerations Enumerator Properties