Panda3D
Public Member Functions | Static Public Attributes | List of all members
PyDatagram Class Reference
Inheritance diagram for PyDatagram:
Datagram TypedObject

Public Member Functions

def addOldServerHeader (self, channel, sender, code)
 
def addServerControlHeader (self, code)
 
def addServerHeader (self, channel, sender, code)
 
def putArg (self, arg, subatomicType, divisor=1)
 
- Public Member Functions inherited from Datagram
object __bytes__ ()
 
 __init__ ()
 
 __init__ (Datagram from)
 
 __init__ (const Datagram copy)
 
 __init__ (VectorUchar data)
 Constructs a datagram from an existing block of data. More...
 
 addBeFloat32 (PNFloat32 value)
 Adds a 32-bit single-precision big-endian floating-point number to the datagram. More...
 
 addBeFloat64 (PNFloat64 value)
 Adds a 64-bit big-endian floating-point number to the datagram. More...
 
 addBeInt16 (int16_t value)
 
 addBeInt32 (int32_t value)
 Adds a signed 32-bit big-endian integer to the datagram. More...
 
 addBeInt64 (int64_t value)
 Adds a signed 64-bit big-endian integer to the datagram. More...
 
 addBeUint16 (uint16_t value)
 Adds an unsigned 16-bit big-endian integer to the datagram. More...
 
 addBeUint32 (uint32_t value)
 Adds an unsigned 32-bit big-endian integer to the datagram. More...
 
 addBeUint64 (uint64_t value)
 Adds an unsigned 64-bit big-endian integer to the datagram. More...
 
 addBlob (VectorUchar)
 Adds a variable-length binary blob to the datagram. More...
 
 addBlob32 (VectorUchar)
 Adds a variable-length binary blob to the datagram, using a 32-bit length field to allow very long blobs. More...
 
 addBool (bool value)
 Adds a boolean value to the datagram. More...
 
 addFixedString (str str, int size)
 Adds a fixed-length string to the datagram. More...
 
 addFloat32 (PNFloat32 value)
 Adds a 32-bit single-precision floating-point number to the datagram. More...
 
 addFloat64 (PNFloat64 value)
 Adds a 64-bit floating-point number to the datagram. More...
 
 addInt16 (int16_t value)
 Adds a signed 16-bit integer to the datagram. More...
 
 addInt32 (int32_t value)
 Adds a signed 32-bit integer to the datagram. More...
 
 addInt64 (int64_t value)
 Adds a signed 64-bit integer to the datagram. More...
 
 addInt8 (int8_t value)
 Adds a signed 8-bit integer to the datagram. More...
 
 addStdfloat (float value)
 Adds either a 32-bit or a 64-bit floating-point number, according to set_stdfloat_double(). More...
 
 addString (str str)
 Adds a variable-length string to the datagram. More...
 
 addString32 (str str)
 Adds a variable-length string to the datagram, using a 32-bit length field to allow very long strings. More...
 
 addUint16 (uint16_t value)
 Adds an unsigned 16-bit integer to the datagram. More...
 
 addUint32 (uint32_t value)
 Adds an unsigned 32-bit integer to the datagram. More...
 
 addUint64 (uint64_t value)
 Adds an unsigned 64-bit integer to the datagram. More...
 
 addUint8 (uint8_t value)
 Adds an unsigned 8-bit integer to the datagram. More...
 
 addWstring (str str)
 Adds a variable-length wstring to the datagram. More...
 
 addZString (str str)
 Adds a variable-length string to the datagram, as a NULL-terminated string. More...
 
 appendData (VectorUchar data)
 Appends some more raw data to the end of the datagram. More...
 
 clear ()
 Resets the datagram to empty, in preparation for building up a new datagram. More...
 
 copyArray (CPTAUchar data)
 Replaces the data in the Datagram with a copy of the data in the indicated CPTA_uchar. More...
 
 dumpHex (Ostream out, unsigned int indent)
 Writes a representation of the entire datagram contents, as a sequence of hex (and ASCII) values. More...
 
CPTAUchar getArray ()
 Returns a const pointer to the actual data in the Datagram. More...
 
int getLength ()
 Returns the number of bytes in the datagram. More...
 
object getMessage ()
 Returns the datagram's data as a string. More...
 
bool getStdfloatDouble ()
 Returns the stdfloat_double flag. More...
 
PTAUchar modifyArray ()
 Returns a modifiable pointer to the actual data in the Datagram. More...
 
bool operator != (const Datagram other)
 
bool operator< (const Datagram other)
 
Datagram operator= (Datagram from)
 
Datagram operator= (const Datagram copy)
 
bool operator== (const Datagram other)
 
 output (Ostream out)
 Write a string representation of this instance to <out>. More...
 
 padBytes (int size)
 Adds the indicated number of zero bytes to the datagram. More...
 
 setArray (PTAUchar data)
 Replaces the data in the Datagram with the data in the indicated PTA_uchar. More...
 
 setStdfloatDouble (bool stdfloat_double)
 Changes the stdfloat_double flag, which defines the operation performed by add_stdfloat() and DatagramIterator::get_stdfloat(). More...
 
 write (Ostream out, unsigned int indent)
 Write a string representation of this instance to <out>. More...
 
- Public Member Functions inherited from TypedObject
TypeHandle getType ()
 
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly. More...
 
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type. More...
 

Static Public Attributes

 addChannel = Datagram.addUint64
 
dictionary FuncDict
 

Additional Inherited Members

- Static Public Member Functions inherited from Datagram
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Public Attributes inherited from TypedObject
TypeHandle type
 Returns the TypeHandle representing this object's type. More...
 

Member Function Documentation

◆ addOldServerHeader()

def addOldServerHeader (   self,
  channel,
  sender,
  code 
)

◆ addServerControlHeader()

def addServerControlHeader (   self,
  code 
)

◆ addServerHeader()

def addServerHeader (   self,
  channel,
  sender,
  code 
)

◆ putArg()

def putArg (   self,
  arg,
  subatomicType,
  divisor = 1 
)

Member Data Documentation

◆ addChannel

addChannel = Datagram.addUint64
static

◆ FuncDict

dictionary FuncDict
static
Initial value:
= {
STInt8: (Datagram.addInt8, int),
STInt16: (Datagram.addInt16, int),
STInt32: (Datagram.addInt32, int),
STInt64: (Datagram.addInt64, int),
STUint8: (Datagram.addUint8, int),
STUint16: (Datagram.addUint16, int),
STUint32: (Datagram.addUint32, int),
STUint64: (Datagram.addUint64, int),
STFloat64: (Datagram.addFloat64, None),
STString: (Datagram.addString, None),
STBlob: (Datagram.addBlob, None),
STBlob32: (Datagram.addBlob32, None),
}