Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions
DCPackerInterface Class Reference

This defines the internal interface for packing values into a DCField. More...

Inheritance diagram for DCPackerInterface:
DCField DCAtomicField DCMolecularField DCParameter DCArrayParameter DCClassParameter DCSimpleParameter DCSwitchParameter

List of all members.

Public Member Functions

DCClassParameter asClassParameter ()
DCClassParameter const asClassParameter ()
DCField asField ()
DCField const asField ()
DCSwitchParameter asSwitchParameter ()
DCSwitchParameter const asSwitchParameter ()
bool checkMatch (DCPackerInterface const other)
 Returns true if the other interface is bitwise the same as this one--that is, a uint32 only matches a uint32, etc.
bool checkMatch (string description, DCFile dcfile)
 Returns true if this interface is bitwise the same as the interface described with the indicated formatted string, e.g.
bool checkMatch (string description)
 Returns true if this interface is bitwise the same as the interface described with the indicated formatted string, e.g.
int findSeekIndex (string name)
 Returns the index number to be passed to a future call to DCPacker::seek() to seek directly to the named field without having to look up the field name in a table later, or -1 if the named field cannot be found.
string getName ()
 Returns the name of this field, or empty string if the field is unnamed.

Detailed Description

This defines the internal interface for packing values into a DCField.

The various different DC objects inherit from this.

Normally these methods are called only by the DCPacker object; the user wouldn't normally call these directly.


Member Function Documentation

Reimplemented in DCField, and DCField.

DCField const asField ( )

Reimplemented in DCField, and DCField.

bool checkMatch ( DCPackerInterface const  other)

Returns true if the other interface is bitwise the same as this one--that is, a uint32 only matches a uint32, etc.

Names of components, and range limits, are not compared.

bool checkMatch ( string  description,
DCFile  dcfile 
)

Returns true if this interface is bitwise the same as the interface described with the indicated formatted string, e.g.

"(uint8, uint8, int16)", or false otherwise.

If DCFile is not NULL, it specifies the DCFile that was previously loaded, from which some predefined structs and typedefs may be referenced in the description string.

bool checkMatch ( string  description)

Returns true if this interface is bitwise the same as the interface described with the indicated formatted string, e.g.

"(uint8, uint8, int16)", or false otherwise.

If DCFile is not NULL, it specifies the DCFile that was previously loaded, from which some predefined structs and typedefs may be referenced in the description string.

int findSeekIndex ( string  name)

Returns the index number to be passed to a future call to DCPacker::seek() to seek directly to the named field without having to look up the field name in a table later, or -1 if the named field cannot be found.

If the named field is nested within a switch or some similar dynamic structure that reveals different fields based on the contents of the data, this mechanism cannot be used to pre-fetch the field index number--you must seek for the field by name.

string getName ( )

Returns the name of this field, or empty string if the field is unnamed.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties