Panda3D
|
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a data file. More...
#include "datagram.h"
Public Member Functions | |
Datagram () | |
Constructs an empty datagram. | |
Datagram (const void *data, size_t size) | |
Constructs a datagram from an existing block of data. | |
Datagram (const Datagram ©) | |
Datagram (const string &data) | |
Constructs a datagram from an existing block of data. | |
void | add_be_float32 (float value) |
Adds a 32-bit single-precision big-endian floating-point number to the datagram. | |
void | add_be_float64 (PN_float64 value) |
Adds a 64-bit big-endian floating-point number to the datagram. | |
void | add_be_int16 (PN_int16 value) |
Adds a signed 16-bit big-endian integer to the datagram. | |
void | add_be_int32 (PN_int32 value) |
Adds a signed 32-bit big-endian integer to the datagram. | |
void | add_be_int64 (PN_int64 value) |
Adds a signed 64-bit big-endian integer to the datagram. | |
void | add_be_uint16 (PN_uint16 value) |
Adds an unsigned 16-bit big-endian integer to the datagram. | |
void | add_be_uint32 (PN_uint32 value) |
Adds an unsigned 32-bit big-endian integer to the datagram. | |
void | add_be_uint64 (PN_uint64 value) |
Adds an unsigned 64-bit big-endian integer to the datagram. | |
void | add_bool (bool value) |
Adds a boolean value to the datagram. | |
void | add_fixed_string (const string &str, size_t size) |
Adds a fixed-length string to the datagram. | |
void | add_float32 (float value) |
Adds a 32-bit single-precision floating-point number to the datagram. | |
void | add_float64 (PN_float64 value) |
Adds a 64-bit floating-point number to the datagram. | |
void | add_int16 (PN_int16 value) |
Adds a signed 16-bit integer to the datagram. | |
void | add_int32 (PN_int32 value) |
Adds a signed 32-bit integer to the datagram. | |
void | add_int64 (PN_int64 value) |
Adds a signed 64-bit integer to the datagram. | |
void | add_int8 (PN_int8 value) |
Adds a signed 8-bit integer to the datagram. | |
void | add_string (const string &str) |
Adds a variable-length string to the datagram. | |
void | add_string32 (const string &str) |
Adds a variable-length string to the datagram, using a 32-bit length field to allow very long strings. | |
void | add_uint16 (PN_uint16 value) |
Adds an unsigned 16-bit integer to the datagram. | |
void | add_uint32 (PN_uint32 value) |
Adds an unsigned 32-bit integer to the datagram. | |
void | add_uint64 (PN_uint64 value) |
Adds an unsigned 64-bit integer to the datagram. | |
void | add_uint8 (PN_uint8 value) |
Adds an unsigned 8-bit integer to the datagram. | |
void | add_wstring (const wstring &str) |
Adds a variable-length wstring to the datagram. | |
void | add_z_string (string str) |
Adds a variable-length string to the datagram, as a NULL-terminated string. | |
void | append_data (const void *data, size_t size) |
Appends some more raw data to the end of the datagram. | |
void | append_data (const string &data) |
Appends some more raw data to the end of the datagram. | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
void | assign (const void *data, size_t size) |
virtual void | clear () |
Resets the datagram to empty, in preparation for building up a new datagram. | |
void | copy_array (CPTA_uchar data) |
Replaces the data in the Datagram with a copy of the data in the indicated CPTA_uchar. | |
void | dump_hex (ostream &out, unsigned int indent=0) const |
Writes a representation of the entire datagram contents, as a sequence of hex (and ASCII) values. | |
virtual TypeHandle | force_init_type () |
CPTA_uchar | get_array () const |
Returns a const pointer to the actual data in the Datagram. | |
int | get_best_parent_from_Set (const std::set< int > &) const |
const void * | get_data () const |
Returns a pointer to the beginning of the datagram's data. | |
size_t | get_length () const |
Returns the number of bytes in the datagram. | |
string | get_message () const |
Returns the datagram's data as a string. | |
virtual TypeHandle | get_type () const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
PTA_uchar | modify_array () |
Returns a modifiable pointer to the actual data in the Datagram. | |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr) |
void | operator delete[] (void *, void *) |
void | operator delete[] (void *ptr) |
void * | operator new (size_t size, void *ptr) |
void * | operator new (size_t size) |
void * | operator new[] (size_t size, void *ptr) |
void * | operator new[] (size_t size) |
bool | operator!= (const Datagram &other) const |
bool | operator< (const Datagram &other) const |
void | operator= (const Datagram ©) |
bool | operator== (const Datagram &other) const |
void | output (ostream &out) const |
Write a string representation of this instance to <out>. | |
void | pad_bytes (size_t size) |
Adds the indicated number of zero bytes to the datagram. | |
void | set_array (PTA_uchar data) |
Replaces the data in the Datagram with the data in the indicated PTA_uchar. | |
void | write (ostream &out, unsigned int indent=0) const |
Write a string representation of this instance to <out>. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. |
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a data file.
Data elements should be added one at a time, in order, to the Datagram. The nature and contents of the data elements are totally up to the user. When a Datagram has been transmitted and received, its data elements may be extracted using a DatagramIterator; it is up to the caller to know the correct type of each data element in order.
A Datagram is itself headerless; it is simply a collection of data elements.
Definition at line 43 of file datagram.h.
Datagram::Datagram | ( | ) | [inline] |
Constructs an empty datagram.
Definition at line 21 of file datagram.I.
Datagram::Datagram | ( | const void * | data, |
size_t | size | ||
) | [inline] |
Constructs a datagram from an existing block of data.
Definition at line 30 of file datagram.I.
References append_data().
Datagram::Datagram | ( | const string & | data | ) | [inline] |
Constructs a datagram from an existing block of data.
Definition at line 40 of file datagram.I.
References append_data().
void Datagram::add_be_float32 | ( | float | value | ) | [inline] |
Adds a 32-bit single-precision big-endian floating-point number to the datagram.
Since this kind of float is not necessarily portable across different architectures, special care is required.
Definition at line 271 of file datagram.I.
References append_data(), and ReversedNumericData::get_data().
Referenced by FltMaterial::build_14_record(), FltVertex::build_record(), FltVectorRecord::build_record(), FltTransformScale::build_record(), FltTransformRotateScale::build_record(), FltTransformRotateAboutPoint::build_record(), FltTransformRotateAboutEdge::build_record(), FltTransformGeneralMatrix::build_record(), FltMaterial::build_record(), FltLocalVertexPool::build_record(), and FltLightSourceDefinition::build_record().
void Datagram::add_be_float64 | ( | PN_float64 | value | ) | [inline] |
Adds a 64-bit big-endian floating-point number to the datagram.
Definition at line 287 of file datagram.I.
References append_data(), and ReversedNumericData::get_data().
Referenced by FltVertex::build_record(), FltTransformTranslate::build_record(), FltTransformScale::build_record(), FltTransformRotateScale::build_record(), FltTransformRotateAboutPoint::build_record(), FltTransformRotateAboutEdge::build_record(), FltTransformPut::build_record(), FltLOD::build_record(), FltLocalVertexPool::build_record(), FltHeader::build_record(), and FltCurve::build_record().
void Datagram::add_be_int16 | ( | PN_int16 | value | ) | [inline] |
Adds a signed 16-bit big-endian integer to the datagram.
Definition at line 197 of file datagram.I.
References append_data(), and ReversedNumericData::get_data().
Referenced by FltRecordWriter::advance(), FltVertex::build_record(), FltObject::build_record(), FltMeshPrimitive::build_record(), FltLOD::build_record(), FltInstanceRef::build_record(), FltInstanceDefinition::build_record(), FltHeader::build_record(), FltGroup::build_record(), and FltGeometry::build_record().
void Datagram::add_be_int32 | ( | PN_int32 | value | ) | [inline] |
Adds a signed 32-bit big-endian integer to the datagram.
Definition at line 209 of file datagram.I.
References append_data(), and ReversedNumericData::get_data().
Referenced by FltTexture::build_record(), FltMeshPrimitive::build_record(), FltMaterial::build_record(), FltLocalVertexPool::build_record(), FltLightSourceDefinition::build_record(), FltHeader::build_record(), FltGeometry::build_record(), and FltCurve::build_record().
void Datagram::add_be_int64 | ( | PN_int64 | value | ) | [inline] |
Adds a signed 64-bit big-endian integer to the datagram.
Definition at line 221 of file datagram.I.
References append_data(), and ReversedNumericData::get_data().
void Datagram::add_be_uint16 | ( | PN_uint16 | value | ) | [inline] |
Adds an unsigned 16-bit big-endian integer to the datagram.
Definition at line 233 of file datagram.I.
References append_data(), and ReversedNumericData::get_data().
Referenced by FltVertex::build_record(), FltMeshPrimitive::build_record(), and FltGeometry::build_record().
void Datagram::add_be_uint32 | ( | PN_uint32 | value | ) | [inline] |
Adds an unsigned 32-bit big-endian integer to the datagram.
Definition at line 245 of file datagram.I.
References append_data(), and ReversedNumericData::get_data().
Referenced by FltMaterial::build_14_record(), FltVertexList::build_record(), FltVertex::build_record(), FltObject::build_record(), FltMaterial::build_record(), FltLOD::build_record(), FltHeader::build_record(), FltGroup::build_record(), FltGeometry::build_record(), and FltExternalReference::build_record().
void Datagram::add_be_uint64 | ( | PN_uint64 | value | ) | [inline] |
Adds an unsigned 64-bit big-endian integer to the datagram.
Definition at line 257 of file datagram.I.
References append_data(), and ReversedNumericData::get_data().
void Datagram::add_bool | ( | bool | value | ) | [inline] |
Adds a boolean value to the datagram.
Definition at line 71 of file datagram.I.
References add_uint8().
Referenced by MouseRecorder::record_frame(), TextureReference::write_datagram(), TextureProperties::write_datagram(), TexturePlacement::write_datagram(), TextureImage::write_datagram(), Palettizer::write_datagram(), PaletteImage::write_datagram(), PaletteGroup::write_datagram(), ImageFile::write_datagram(), EggFile::write_datagram(), RecorderFrame::write_datagram(), SparseArray::write_datagram(), LightLensNode::write_datagram(), TextureAttrib::write_datagram(), ShowBoundsEffect::write_datagram(), ScissorEffect::write_datagram(), RenderModeAttrib::write_datagram(), LightAttrib::write_datagram(), CullFaceAttrib::write_datagram(), ColorScaleAttrib::write_datagram(), ClipPlaneAttrib::write_datagram(), Camera::write_datagram(), BillboardEffect::write_datagram(), AudioVolumeAttrib::write_datagram(), CubicCurveseg::write_datagram(), TextureStage::write_datagram(), Texture::write_datagram(), GeomVertexAnimationSpec::write_datagram(), AnimChannelScalarTable::write_datagram(), AnimChannelMatrixXfmTable::write_datagram(), and FFTCompressor::write_reals().
void Datagram::add_fixed_string | ( | const string & | str, |
size_t | size | ||
) | [inline] |
Adds a fixed-length string to the datagram.
If the string given is less than the requested size, this will pad the string out with zeroes; if it is greater than the requested size, this will silently truncate the string.
Definition at line 352 of file datagram.I.
References append_data(), and pad_bytes().
Referenced by FltMaterial::build_14_record(), FltTexture::build_record(), FltMaterial::build_record(), FltLightSourceDefinition::build_record(), FltHeader::build_record(), FltExternalReference::build_record(), and FltBeadID::build_record().
void Datagram::add_float32 | ( | float | value | ) | [inline] |
Adds a 32-bit single-precision floating-point number to the datagram.
Since this kind of float is not necessarily portable across different architectures, special care is required.
Definition at line 170 of file datagram.I.
References append_data(), and NativeNumericData::get_data().
Referenced by TimedCycle::write_datagram(), PStatFrameData::write_datagram(), PStatCollectorDef::write_datagram(), LODNode::Switch::write_datagram(), UvScrollNode::write_datagram(), RenderModeAttrib::write_datagram(), PolylightNode::write_datagram(), LightRampAttrib::write_datagram(), Fog::write_datagram(), BillboardEffect::write_datagram(), AudioVolumeAttrib::write_datagram(), AlphaTestAttrib::write_datagram(), TransformBlend::write_datagram(), Material::write_datagram(), Lens::write_datagram(), CollisionTube::write_datagram(), CollisionSphere::write_datagram(), CollisionParabola::write_datagram(), CollisionFloorMesh::write_datagram(), CollisionDSSolid::write_datagram(), CollisionBox::write_datagram(), AnimPreloadTable::write_datagram(), AnimChannelScalarTable::write_datagram(), AnimChannelScalarDynamic::write_datagram(), AnimChannelMatrixXfmTable::write_datagram(), AnimBundle::write_datagram(), and FFTCompressor::write_reals().
void Datagram::add_float64 | ( | PN_float64 | value | ) | [inline] |
Adds a 64-bit floating-point number to the datagram.
Definition at line 185 of file datagram.I.
References append_data(), and NativeNumericData::get_data().
Referenced by TextureReference::write_datagram(), TexturePosition::write_datagram(), TextureImage::write_datagram(), Palettizer::write_datagram(), RecorderFrame::write_datagram(), PiecewiseCurve::write_datagram(), NurbsCurve::write_datagram(), and FFTCompressor::write_header().
void Datagram::add_int16 | ( | PN_int16 | value | ) | [inline] |
Adds a signed 16-bit integer to the datagram.
Definition at line 101 of file datagram.I.
References append_data(), and NativeNumericData::get_data().
Referenced by MovieAudioCursor::read_samples(), TextureImage::write_datagram(), PaletteGroup::write_datagram(), PStatCollectorDef::write_datagram(), Texture::write_datagram(), and ButtonEvent::write_datagram().
void Datagram::add_int32 | ( | PN_int32 | value | ) | [inline] |
Adds a signed 32-bit integer to the datagram.
Definition at line 112 of file datagram.I.
References append_data(), and NativeNumericData::get_data().
Referenced by NodePath::encode_to_bam_stream(), TextureReference::write_datagram(), TextureProperties::write_datagram(), TexturePosition::write_datagram(), TexturePlacement::write_datagram(), Palettizer::write_datagram(), PaletteGroup::write_datagram(), ImageFile::write_datagram(), RecorderHeader::write_datagram(), SparseArray::write_datagram(), AnimInterface::write_datagram(), LightLensNode::write_datagram(), TextureAttrib::write_datagram(), TexMatrixAttrib::write_datagram(), StencilAttrib::write_datagram(), RenderState::write_datagram(), PlaneNode::write_datagram(), Light::write_datagram(), DepthOffsetAttrib::write_datagram(), CullBinAttrib::write_datagram(), AuxBitplaneAttrib::write_datagram(), TextureStage::write_datagram(), Texture::write_datagram(), Material::write_datagram(), AnimPreloadTable::write_datagram(), DownloadDb::Db::write_header(), and FFTCompressor::write_reals().
void Datagram::add_int64 | ( | PN_int64 | value | ) | [inline] |
Adds a signed 64-bit integer to the datagram.
Definition at line 123 of file datagram.I.
References append_data(), and NativeNumericData::get_data().
void Datagram::add_int8 | ( | PN_int8 | value | ) | [inline] |
Adds a signed 8-bit integer to the datagram.
Definition at line 81 of file datagram.I.
References append_data().
Referenced by FltHeader::build_record(), FltGroup::build_record(), FltGeometry::build_record(), CConnectionRepository::send_message_bundle(), TransparencyAttrib::write_datagram(), ShadeModelAttrib::write_datagram(), RescaleNormalAttrib::write_datagram(), RenderModeAttrib::write_datagram(), LightRampAttrib::write_datagram(), Fog::write_datagram(), DepthWriteAttrib::write_datagram(), DepthTestAttrib::write_datagram(), CullFaceAttrib::write_datagram(), ColorAttrib::write_datagram(), AlphaTestAttrib::write_datagram(), ParametricCurve::write_datagram(), NurbsCurve::write_datagram(), HermiteCurveCV::write_datagram(), and FFTCompressor::write_header().
void Datagram::add_string | ( | const string & | str | ) | [inline] |
Adds a variable-length string to the datagram.
This actually adds a count followed by n bytes.
Definition at line 299 of file datagram.I.
References add_uint16(), and append_data().
Referenced by PStatServerControlMessage::encode(), PStatClientControlMessage::encode(), CConnectionRepository::send_message_bundle(), TextureReference::write_datagram(), TextureImage::write_datagram(), Palettizer::write_datagram(), PalettePage::write_datagram(), PaletteImage::write_datagram(), PaletteGroup::write_datagram(), ImageFile::write_datagram(), EggFile::write_datagram(), RecorderTable::write_datagram(), BamCacheRecord::write_datagram(), PStatCollectorDef::write_datagram(), PandaNode::write_datagram(), CullBinAttrib::write_datagram(), HermiteCurveCV::write_datagram(), TextureStage::write_datagram(), Texture::write_datagram(), Material::write_datagram(), Lens::write_datagram(), InternalName::write_datagram(), GeomVertexData::write_datagram(), ButtonEvent::write_datagram(), PartGroup::write_datagram(), AnimPreloadTable::write_datagram(), AnimGroup::write_datagram(), BamWriter::write_handle(), and PandaNode::write_recorder().
void Datagram::add_string32 | ( | const string & | str | ) | [inline] |
Adds a variable-length string to the datagram, using a 32-bit length field to allow very long strings.
Definition at line 317 of file datagram.I.
References add_uint32(), and append_data().
void Datagram::add_uint16 | ( | PN_uint16 | value | ) | [inline] |
Adds an unsigned 16-bit integer to the datagram.
Definition at line 134 of file datagram.I.
References append_data(), and NativeNumericData::get_data().
Referenced by add_string(), add_wstring(), DatagramTCPHeader::DatagramTCPHeader(), DatagramUDPHeader::DatagramUDPHeader(), PStatServerControlMessage::encode(), PStatClientControlMessage::encode(), BamWriter::init(), CConnectionRepository::send_message_bundle(), RecorderTable::write_datagram(), TimedCycle::write_datagram(), BamCacheRecord::write_datagram(), PStatFrameData::write_datagram(), TextureAttrib::write_datagram(), TexProjectorEffect::write_datagram(), TexMatrixAttrib::write_datagram(), TexGenAttrib::write_datagram(), ScissorEffect::write_datagram(), RenderState::write_datagram(), RenderEffects::write_datagram(), PortalNode::write_datagram(), ModelNode::write_datagram(), LightAttrib::write_datagram(), CompassEffect::write_datagram(), ClipPlaneAttrib::write_datagram(), AntialiasAttrib::write_datagram(), TransformTable::write_datagram(), TransformBlendTable::write_datagram(), TransformBlend::write_datagram(), SliderTable::write_datagram(), Lens::write_datagram(), GeomVertexFormat::write_datagram(), GeomVertexColumn::write_datagram(), GeomVertexArrayFormat::write_datagram(), GeomVertexAnimationSpec::write_datagram(), ButtonEventList::write_datagram(), ButtonEvent::write_datagram(), DataNodeTransmit::write_datagram(), CollisionPolygon::write_datagram(), CollisionNode::write_datagram(), CollisionFloorMesh::write_datagram(), CollisionBox::write_datagram(), CharacterJoint::write_datagram(), Character::write_datagram(), PartGroup::write_datagram(), PartBundleNode::write_datagram(), AnimPreloadTable::write_datagram(), AnimGroup::write_datagram(), AnimChannelScalarTable::write_datagram(), AnimChannelMatrixXfmTable::write_datagram(), AnimChannelBase::write_datagram(), AnimBundle::write_datagram(), and BamWriter::write_handle().
void Datagram::add_uint32 | ( | PN_uint32 | value | ) | [inline] |
Adds an unsigned 32-bit integer to the datagram.
Definition at line 145 of file datagram.I.
References append_data(), and NativeNumericData::get_data().
Referenced by add_string32(), add_wstring(), DatagramTCPHeader::DatagramTCPHeader(), TextureImage::write_datagram(), PalettePage::write_datagram(), PaletteImage::write_datagram(), PaletteGroups::write_datagram(), PaletteGroup::write_datagram(), EggFile::write_datagram(), RecorderHeader::write_datagram(), RecorderFrame::write_datagram(), SparseArray::write_datagram(), BitArray::write_datagram(), BamCacheRecord::write_datagram(), BamCacheIndex::write_datagram(), TransformState::write_datagram(), Camera::write_datagram(), PiecewiseCurve::write_datagram(), NurbsCurve::write_datagram(), HermiteCurve::write_datagram(), Texture::write_datagram(), CollisionNode::write_datagram(), CollisionFloorMesh::write_datagram(), and DownloadDb::Db::write_header().
void Datagram::add_uint64 | ( | PN_uint64 | value | ) | [inline] |
Adds an unsigned 64-bit integer to the datagram.
Definition at line 156 of file datagram.I.
References append_data(), and NativeNumericData::get_data().
Referenced by CConnectionRepository::send_message_bundle(), and BamCacheRecord::write_datagram().
void Datagram::add_uint8 | ( | PN_uint8 | value | ) | [inline] |
Adds an unsigned 8-bit integer to the datagram.
Definition at line 91 of file datagram.I.
References append_data().
Referenced by add_bool(), add_z_string(), FltMeshPrimitive::build_record(), FltGeometry::build_record(), PStatServerControlMessage::encode(), PStatClientControlMessage::encode(), NodePath::encode_to_bam_stream(), BamWriter::init(), TextureImage::write_datagram(), Palettizer::write_datagram(), ImageFile::write_datagram(), BitArray::write_datagram(), TexGenAttrib::write_datagram(), PlaneNode::write_datagram(), ModelNode::write_datagram(), ColorWriteAttrib::write_datagram(), ColorBlendAttrib::write_datagram(), TextureStage::write_datagram(), Texture::write_datagram(), Lens::write_datagram(), GeomVertexColumn::write_datagram(), GeomVertexArrayFormat::write_datagram(), GeomVertexAnimationSpec::write_datagram(), ButtonEvent::write_datagram(), CollisionSolid::write_datagram(), AnimChannelScalarTable::write_datagram(), BamWriter::write_handle(), and BamWriter::write_object().
void Datagram::add_wstring | ( | const wstring & | str | ) |
Adds a variable-length wstring to the datagram.
Definition at line 92 of file datagram.cxx.
References add_uint16(), and add_uint32().
void Datagram::add_z_string | ( | string | str | ) | [inline] |
Adds a variable-length string to the datagram, as a NULL-terminated string.
Definition at line 332 of file datagram.I.
References add_uint8(), and append_data().
void Datagram::append_data | ( | const void * | data, |
size_t | size | ||
) |
Appends some more raw data to the end of the datagram.
Definition at line 144 of file datagram.cxx.
Referenced by add_be_float32(), add_be_float64(), add_be_int16(), add_be_int32(), add_be_int64(), add_be_uint16(), add_be_uint32(), add_be_uint64(), add_fixed_string(), add_float32(), add_float64(), add_int16(), add_int32(), add_int64(), add_int8(), add_string(), add_string32(), add_uint16(), add_uint32(), add_uint64(), add_uint8(), add_z_string(), FltRecordReader::advance(), append_data(), Datagram(), and Texture::write_datagram().
void Datagram::append_data | ( | const string & | data | ) | [inline] |
Appends some more raw data to the end of the datagram.
Definition at line 369 of file datagram.I.
References append_data().
TypedObject * TypedObject::as_typed_object | ( | ) | [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 99 of file typedObject.I.
const TypedObject * TypedObject::as_typed_object | ( | ) | const [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 110 of file typedObject.I.
void Datagram::clear | ( | ) | [virtual] |
Resets the datagram to empty, in preparation for building up a new datagram.
Reimplemented in NetDatagram.
Definition at line 41 of file datagram.cxx.
Referenced by FltRecordWriter::advance(), PStatServerControlMessage::encode(), PStatClientControlMessage::encode(), and DatagramInputFile::get_datagram().
void Datagram::copy_array | ( | CPTA_uchar | data | ) | [inline] |
Replaces the data in the Datagram with a copy of the data in the indicated CPTA_uchar.
Unlike set_array(), a complete copy is made of the data; subsequent changes to the Datagram will *not* change the source CPTA_uchar.
Definition at line 432 of file datagram.I.
References ConstPointerToArray< Element >::v().
void Datagram::dump_hex | ( | ostream & | out, |
unsigned int | indent = 0 |
||
) | const |
Writes a representation of the entire datagram contents, as a sequence of hex (and ASCII) values.
Definition at line 52 of file datagram.cxx.
References get_data(), and get_length().
Referenced by GeomVertexData::describe_vertex(), Buffered_DatagramConnection::SendMessage(), DatagramIterator::skip_bytes(), DatagramTCPHeader::verify_datagram(), DatagramUDPHeader::verify_datagram(), and write().
CPTA_uchar Datagram::get_array | ( | ) | const [inline] |
Returns a const pointer to the actual data in the Datagram.
Definition at line 444 of file datagram.I.
const void * Datagram::get_data | ( | ) | const [inline] |
Returns a pointer to the beginning of the datagram's data.
Definition at line 395 of file datagram.I.
Referenced by FltRecordWriter::advance(), dump_hex(), DatagramIterator::extract_bytes(), DatagramIterator::get_be_float32(), DatagramIterator::get_be_float64(), DatagramIterator::get_be_int16(), DatagramIterator::get_be_int32(), DatagramIterator::get_be_int64(), DatagramIterator::get_be_uint16(), DatagramIterator::get_be_uint32(), DatagramIterator::get_be_uint64(), DatagramIterator::get_fixed_string(), DatagramIterator::get_float32(), DatagramIterator::get_float64(), IffInputFile::get_id(), DatagramIterator::get_int16(), DatagramIterator::get_int32(), DatagramIterator::get_int64(), DatagramIterator::get_int8(), DatagramIterator::get_remaining_bytes(), DatagramIterator::get_string(), DatagramIterator::get_string32(), DatagramIterator::get_uint16(), DatagramIterator::get_uint32(), DatagramIterator::get_uint64(), DatagramIterator::get_uint8(), DatagramIterator::get_z_string(), DatagramOutputFile::put_datagram(), GeomVertexArrayData::read_raw_data(), EggJointData::score_reparent_to(), Buffered_DatagramConnection::SendMessage(), and FltTexture::write_attr_data().
size_t Datagram::get_length | ( | ) | const [inline] |
Returns the number of bytes in the datagram.
Definition at line 405 of file datagram.I.
Referenced by FltRecordWriter::advance(), FltVertex::build_record(), DatagramTCPHeader::DatagramTCPHeader(), DatagramUDPHeader::DatagramUDPHeader(), dump_hex(), DatagramIterator::get_be_float32(), DatagramIterator::get_be_float64(), DatagramIterator::get_be_int16(), DatagramIterator::get_be_int32(), DatagramIterator::get_be_int64(), DatagramIterator::get_be_uint16(), DatagramIterator::get_be_uint32(), DatagramIterator::get_be_uint64(), DatagramGeneratorNet::get_datagram(), DatagramIterator::get_float32(), DatagramIterator::get_float64(), DatagramIterator::get_int16(), DatagramIterator::get_int32(), DatagramIterator::get_int64(), DatagramIterator::get_remaining_bytes(), DatagramIterator::get_remaining_size(), DatagramIterator::get_uint16(), DatagramIterator::get_uint32(), DatagramIterator::get_uint64(), DatagramIterator::get_wstring(), DatagramIterator::get_z_string(), ConnectionWriter::is_valid_for_udp(), DatagramOutputFile::put_datagram(), RecentConnectionReader::receive_datagram(), EggJointData::score_reparent_to(), ConnectionWriter::send(), Buffered_DatagramConnection::SendMessage(), DatagramIterator::skip_bytes(), DatagramIterator::write(), and FltTexture::write_attr_data().
string Datagram::get_message | ( | ) | const [inline] |
Returns the datagram's data as a string.
Definition at line 379 of file datagram.I.
Referenced by HashVal::as_bin(), DatagramTCPHeader::DatagramTCPHeader(), DatagramUDPHeader::DatagramUDPHeader(), DatagramTCPHeader::get_header(), DatagramUDPHeader::get_header(), DatagramTCPHeader::verify_datagram(), DatagramUDPHeader::verify_datagram(), and DownloadDb::Db::write_header().
int TypedObject::get_type_index | ( | ) | const [inline, inherited] |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
This is equivalent to get_type().get_index().
Definition at line 52 of file typedObject.I.
References TypeHandle::get_index().
static void Datagram::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from TypedObject.
Reimplemented in NetDatagram.
Definition at line 117 of file datagram.h.
References TypedObject::init_type().
Referenced by NetDatagram::init_type().
bool TypedObject::is_exact_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is the indicated type exactly.
Definition at line 74 of file typedObject.I.
References TypeHandle::get_name().
Referenced by GraphicsStateGuardian::async_reload_texture(), PortalNode::combine_with(), PandaNode::combine_with(), GeomNode::combine_with(), CollisionNode::combine_with(), Character::combine_with(), PGItem::cull_callback(), FactoryParams::get_param_of_type(), CollisionHandlerPusher::handle_entries(), SceneGraphReducer::r_flatten(), ConnectionWriter::send(), FltToEggLevelState::set_transform(), and VirtualFileSystem::unmount().
bool TypedObject::is_of_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is or derives from the indicated type.
Definition at line 63 of file typedObject.I.
References TypeHandle::is_derived_from().
Referenced by EggSliderData::add_back_pointer(), EggJointData::add_back_pointer(), CIntervalManager::add_c_interval(), XFileNode::add_child(), CollisionTraverser::add_collider(), CollisionHandlerPhysical::add_collider(), EggXfmSAnim::add_data(), CharacterJointBundle::add_node(), NonlinearImager::add_screen(), EggGroupNode::apply_first_attribute(), EggGroupNode::apply_last_attribute(), DeferredNodeProperty::apply_to_node(), RecorderController::begin_playback(), NodePath::clear_clip_plane(), EggGroupNode::clear_connected_shading(), NodePath::clear_light(), EggBase::convert_paths(), NodePath::decode_from_bam_stream(), VrpnClient::disconnect_device(), PhysicsManager::do_physics(), GraphicsStateGuardian::fetch_specified_part(), EggRenderState::fill_state(), AnimBundleNode::find_anim_bundle(), EggGroupNode::find_coordsys_entry(), XFile::find_data_object(), Character::find_joint(), EggGroupNode::find_materials(), Character::find_slider(), XFile::find_template(), EggGroupNode::find_textures(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggGroupNode::force_filenames(), EggJointData::force_initial_rest_frame(), WindowFramework::get_aspect_2d(), EggPoolUniquifier::get_category(), EggGroupUniquifier::get_category(), EggGroupNode::get_connected_shading(), PandaFramework::get_mouse(), FactoryParams::get_param_of_type(), EggGroupNode::has_absolute_pathnames(), NodePath::has_clip_plane(), NodePath::has_clip_plane_off(), NodePath::has_light(), PandaFramework::hide_collision_solids(), x11GraphicsWindow::open_window(), eglGraphicsWindow::open_window(), EggNode::parse_egg(), CharacterMaker::part_to_node(), EggGroupNode::post_apply_flat_attribute(), EggBinner::prepare_node(), PortalClipper::prepare_portal(), NodePath::project_texture(), EggMatrixTablePointer::quantize_channels(), ParametricCurveCollection::r_add_curves(), SceneGraphReducer::r_collect_vertex_data(), EggGroupNode::r_load_externals(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::remove_invalid_primitives(), EggGroupNode::remove_unused_vertices(), EggLoader::reparent_decals(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggGroupNode::resolve_filenames(), EggGroupNode::reverse_vertex_ordering(), NodePath::set_clip_plane(), NodePath::set_clip_plane_off(), NodePath::set_light(), ProjectionScreen::set_projector(), NonlinearImager::set_source_camera(), EggXfmSAnim::set_value(), NonlinearImager::set_viewer_camera(), PandaFramework::show_collision_solids(), BamCache::store(), XFileToEggConverter::strip_nodes(), EggGroupNode::strip_normals(), DataGraphTraverser::traverse(), DataGraphTraverser::traverse_below(), EggGroupNode::triangulate_polygons(), EggGroupNode::unify_attributes(), EggNameUniquifier::uniquify(), NodeCullCallbackData::upcall(), PhysicsCollisionHandler::validate_target(), EggXfmSAnim::write(), EggGroup::write(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_entities().
PTA_uchar Datagram::modify_array | ( | ) | [inline] |
Returns a modifiable pointer to the actual data in the Datagram.
Definition at line 455 of file datagram.I.
void Datagram::output | ( | ostream & | out | ) | const |
Write a string representation of this instance to <out>.
Definition at line 186 of file datagram.cxx.
void Datagram::pad_bytes | ( | size_t | size | ) |
Adds the indicated number of zero bytes to the datagram.
Definition at line 111 of file datagram.cxx.
Referenced by add_fixed_string(), FltMaterial::build_14_record(), FltVertex::build_record(), FltTransformTranslate::build_record(), FltTransformScale::build_record(), FltTransformRotateScale::build_record(), FltTransformRotateAboutPoint::build_record(), FltTransformRotateAboutEdge::build_record(), FltTransformPut::build_record(), FltObject::build_record(), FltMesh::build_record(), FltMaterial::build_record(), FltLOD::build_record(), FltLightSourceDefinition::build_record(), FltInstanceRef::build_record(), FltInstanceDefinition::build_record(), FltHeader::build_record(), FltGroup::build_record(), FltGeometry::build_record(), FltExternalReference::build_record(), and FltCurve::build_record().
void Datagram::set_array | ( | PTA_uchar | data | ) | [inline] |
Replaces the data in the Datagram with the data in the indicated PTA_uchar.
This is assignment by reference: subsequent changes to the Datagram will also change the source PTA_uchar.
Definition at line 418 of file datagram.I.
void Datagram::write | ( | ostream & | out, |
unsigned int | indent = 0 |
||
) | const |
Write a string representation of this instance to <out>.
Definition at line 199 of file datagram.cxx.
References dump_hex().
Referenced by DatagramIterator::write().