#include <datagramIterator.h>
Public Member Functions | |
DatagramIterator () | |
DatagramIterator (const Datagram &datagram, size_t offset=0) | |
DatagramIterator (const DatagramIterator ©) | |
void | operator= (const DatagramIterator ©) |
~DatagramIterator () | |
bool | get_bool () |
Extracts a boolean value. | |
PN_int8 | get_int8 () |
Extracts a signed 8-bit integer. | |
PN_uint8 | get_uint8 () |
Extracts an unsigned 8-bit integer. | |
PN_int16 | get_int16 () |
Extracts a signed 16-bit integer. | |
PN_int32 | get_int32 () |
Extracts a signed 32-bit integer. | |
PN_int64 | get_int64 () |
Extracts a signed 64-bit integer. | |
PN_uint16 | get_uint16 () |
Extracts an unsigned 16-bit integer. | |
PN_uint32 | get_uint32 () |
Extracts an unsigned 32-bit integer. | |
PN_uint64 | get_uint64 () |
Extracts an unsigned 64-bit integer. | |
float | get_float32 () |
Extracts a 32-bit single-precision floating-point number. | |
PN_float64 | get_float64 () |
Extracts a 64-bit floating-point number. | |
PN_int16 | get_be_int16 () |
Extracts a signed 16-bit big-endian integer. | |
PN_int32 | get_be_int32 () |
Extracts a signed 32-bit big-endian integer. | |
PN_int64 | get_be_int64 () |
Extracts a signed 64-bit big-endian integer. | |
PN_uint16 | get_be_uint16 () |
Extracts an unsigned 16-bit big-endian integer. | |
PN_uint32 | get_be_uint32 () |
Extracts an unsigned 32-bit big-endian integer. | |
PN_uint64 | get_be_uint64 () |
Extracts an unsigned 64-bit big-endian integer. | |
float | get_be_float32 () |
Extracts a 32-bit big-endian single-precision floating-point number. | |
PN_float64 | get_be_float64 () |
Extracts a 64-bit big-endian floating-point number. | |
string | get_string () |
Extracts a variable-length string. | |
string | get_z_string () |
Extracts a variable-length string, as a NULL-terminated string. | |
string | get_fixed_string (size_t size) |
Extracts a fixed-length string. | |
void | skip_bytes (size_t size) |
Skips over the indicated number of bytes in the datagram. | |
string | extract_bytes (size_t size) |
Extracts the indicated number of bytes in the datagram and returns them as a string. | |
string | get_remaining_bytes () const |
Returns the remaining bytes in the datagram as a string, but does not extract them from the iterator. | |
int | get_remaining_size () const |
Return the bytes left in the datagram. | |
const Datagram & | get_datagram () const |
Return the datagram of this iterator. | |
size_t | get_current_index () const |
Returns the current position within the datagram of the next piece of data to extract. | |
Private Attributes | |
const Datagram * | _datagram |
size_t | _current_index |
Elements may be retrieved one at a time; it is up to the caller to know the correct type and order of each element.
Definition at line 43 of file datagramIterator.h.
|
Definition at line 31 of file datagramIterator.I. |
|
Definition at line 45 of file datagramIterator.I. References INLINE. |
|
Definition at line 60 of file datagramIterator.I. References _current_index, _datagram, and INLINE. |
|
Definition at line 87 of file datagramIterator.I. |
|
Extracts the indicated number of bytes in the datagram and returns them as a string.
Definition at line 115 of file datagramIterator.cxx. Referenced by DownloadDb::Db::parse_header(). |
|
Extracts a 32-bit big-endian single-precision floating-point number. Since this kind of float is not necessarily portable across different architectures, special care is required. Definition at line 465 of file datagramIterator.I. |
|
Extracts a 64-bit big-endian floating-point number.
Definition at line 490 of file datagramIterator.I. |
|
Extracts a signed 16-bit big-endian integer.
Definition at line 333 of file datagramIterator.I. References _current_index, _datagram, Datagram::get_data(), INLINE, nassertr, NULL, PN_uint16, and ReversedNumericData::store_value(). |
|
Extracts a signed 32-bit big-endian integer.
Definition at line 354 of file datagramIterator.I. References _current_index, _datagram, and PN_uint32. |
|
Extracts a signed 64-bit big-endian integer.
Definition at line 375 of file datagramIterator.I. References _current_index, _datagram, and PN_uint64. |
|
Extracts an unsigned 16-bit big-endian integer.
Definition at line 396 of file datagramIterator.I. References _current_index, and _datagram. |
|
Extracts an unsigned 32-bit big-endian integer.
Definition at line 417 of file datagramIterator.I. References _current_index, _datagram, and PN_float64. |
|
Extracts an unsigned 64-bit big-endian integer.
Definition at line 438 of file datagramIterator.I. References _current_index, _datagram, Datagram::get_data(), Datagram::get_length(), INLINE, nassertr, and NULL. |
|
Extracts a boolean value.
Definition at line 102 of file datagramIterator.I. References _current_index. Referenced by Camera::register_with_read_factory(), Texture::string_wrap_mode(), and BillboardEffect::write_datagram(). |
|
Returns the current position within the datagram of the next piece of data to extract.
Definition at line 576 of file datagramIterator.I. |
|
Return the datagram of this iterator.
Definition at line 561 of file datagramIterator.I. |
|
Extracts a fixed-length string. However, if a zero byte occurs within the string, it marks the end of the string. Definition at line 91 of file datagramIterator.cxx. References _current_index, _datagram, Datagram::get_data(), nassertr, and NULL. |
|
Extracts a 32-bit single-precision floating-point number. Since this kind of float is not necessarily portable across different architectures, special care is required. Definition at line 287 of file datagramIterator.I. References _current_index. Referenced by GeomLine::make_GeomLine(), GeomLinestrip::make_GeomLinestrip(), GeomPoint::make_GeomPoint(), LODSwitch::operator!=(), ACScalarSwitchType::output_value(), AlphaTestAttrib::register_with_read_factory(), Material::write(), TimedCycle::write_datagram(), PStatCollectorDef::write_datagram(), Spotlight::CData::write_datagram(), Fog::write_datagram(), BillboardEffect::write_datagram(), and AnimBundle::write_datagram(). |
|
Extracts a 64-bit floating-point number.
Definition at line 312 of file datagramIterator.I. References _current_index, _datagram, Datagram::get_data(), INLINE, nassertr, NULL, PN_int64, and ReversedNumericData::store_value(). Referenced by PiecewiseCurve::find_curve(). |
|
Extracts a signed 16-bit integer.
Definition at line 155 of file datagramIterator.I. References _current_index. Referenced by Texture::string_wrap_mode(), and PStatCollectorDef::write_datagram(). |
|
Extracts a signed 32-bit integer.
Definition at line 176 of file datagramIterator.I. Referenced by DownloadDb::insert_new_version(), DownloadDb::Db::parse_header(), CullBinAttrib::register_with_read_factory(), and Material::write(). |
|
Extracts a signed 64-bit integer.
Definition at line 197 of file datagramIterator.I. References _current_index, _datagram, Datagram::get_data(), INLINE, nassertr, NULL, PN_uint32, and NativeNumericData::store_value(). |
|
Extracts a signed 8-bit integer.
Definition at line 115 of file datagramIterator.I. References _current_index, _datagram, and PN_uint8. Referenced by ColorAttrib::make_default_impl(), TransparencyAttrib::register_with_read_factory(), TextureApplyAttrib::register_with_read_factory(), DepthWriteAttrib::register_with_read_factory(), DepthTestAttrib::register_with_read_factory(), ColorWriteAttrib::register_with_read_factory(), ColorBlendAttrib::register_with_read_factory(), AlphaTestAttrib::register_with_read_factory(), ClassicNurbsCurve::write(), and Fog::write_datagram(). |
|
Returns the remaining bytes in the datagram as a string, but does not extract them from the iterator.
Definition at line 530 of file datagramIterator.I. |
|
Return the bytes left in the datagram.
Definition at line 548 of file datagramIterator.I. |
|
Extracts a variable-length string.
Definition at line 35 of file datagramIterator.cxx. Referenced by CullBinAttrib::register_with_read_factory(), PandaNode::reparent(), and PStatCollectorDef::write_datagram(). |
|
Extracts an unsigned 16-bit integer.
Definition at line 218 of file datagramIterator.I. References _current_index, _datagram, Datagram::get_data(), INLINE, nassertr, NULL, PN_uint64, and NativeNumericData::store_value(). Referenced by GeomNode::CData::complete_pointers(), BamReader::read_cdata(), CompassEffect::register_with_read_factory(), TimedCycle::write_datagram(), ComputedVerticesMorphValue4::write_datagram(), ComputedVerticesMorphValue3::write_datagram(), ComputedVerticesMorphValue2::write_datagram(), AnimChannelBase::write_datagram(), AnimBundle::write_datagram(), and FFTCompressor::write_run(). |
|
Extracts an unsigned 32-bit integer.
Definition at line 239 of file datagramIterator.I. References _current_index, _datagram, Datagram::get_data(), INLINE, nassertr, NULL, and NativeNumericData::store_value(). Referenced by DownloadDb::Db::Db(), PiecewiseCurve::find_curve(), Camera::register_with_read_factory(), wrap_hpr(), and ClassicNurbsCurve::write(). |
|
Extracts an unsigned 64-bit integer.
Definition at line 260 of file datagramIterator.I. References _current_index, _datagram, Datagram::get_data(), INLINE, nassertr, NULL, PN_float64, and NativeNumericData::store_value(). |
|
Extracts an unsigned 8-bit integer.
Definition at line 135 of file datagramIterator.I. References _current_index, and _datagram. Referenced by Texture::string_wrap_mode(). |
|
Extracts a variable-length string, as a NULL-terminated string.
Definition at line 61 of file datagramIterator.cxx. |
|
Definition at line 74 of file datagramIterator.I. |
|
Skips over the indicated number of bytes in the datagram.
Definition at line 513 of file datagramIterator.I. |
|
Definition at line 88 of file datagramIterator.h. Referenced by DatagramIterator(), get_be_int16(), get_be_int32(), get_be_int64(), get_be_uint16(), get_be_uint32(), get_be_uint64(), get_bool(), get_fixed_string(), get_float32(), get_float64(), get_int16(), get_int64(), get_int8(), get_uint16(), get_uint32(), get_uint64(), and get_uint8(). |
|
Definition at line 87 of file datagramIterator.h. Referenced by DatagramIterator(), get_be_float32(), get_be_int16(), get_be_int32(), get_be_int64(), get_be_uint16(), get_be_uint32(), get_be_uint64(), get_fixed_string(), get_float64(), get_int64(), get_int8(), get_uint16(), get_uint32(), get_uint64(), and get_uint8(). |