Panda3D
|
This represents a class (or struct) object used as a parameter itself. More...
#include "dcClassParameter.h"
Public Member Functions | |
DCClassParameter (const DCClass *dclass) | |
DCClassParameter (const DCClassParameter ©) | |
virtual DCClassParameter * | as_class_parameter () |
virtual const DCClassParameter * | as_class_parameter () const |
virtual void | generate_hash (HashGenerator &hashgen) const |
Accumulates the properties of this type into the hash. | |
const DCClass * | get_class () const |
Returns the class object this parameter represents. | |
virtual DCPackerInterface * | get_nested_field (int n) const |
Returns the DCPackerInterface object that represents the nth nested field. | |
virtual bool | is_valid () const |
Returns false if the type is an invalid type (e.g. | |
virtual DCParameter * | make_copy () const |
virtual void | output_instance (ostream &out, bool brief, const string &prename, const string &name, const string &postname) const |
Formats the parameter in the C++-like dc syntax as a typename and identifier. | |
Protected Member Functions | |
virtual bool | do_check_match (const DCPackerInterface *other) const |
Returns true if the other interface is bitwise the same as this one--that is, a uint32 only matches a uint32, etc. | |
virtual bool | do_check_match_array_parameter (const DCArrayParameter *other) const |
Returns true if this field matches the indicated array parameter, false otherwise. | |
virtual bool | do_check_match_class_parameter (const DCClassParameter *other) const |
Returns true if this field matches the indicated class parameter, false otherwise. |
This represents a class (or struct) object used as a parameter itself.
This means that all the fields of the class get packed into the message.
Definition at line 29 of file dcClassParameter.h.
bool DCClassParameter::do_check_match | ( | const DCPackerInterface * | other | ) | const [protected, virtual] |
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.
Implements DCPackerInterface.
Definition at line 184 of file dcClassParameter.cxx.
References DCPackerInterface::do_check_match_class_parameter().
bool DCClassParameter::do_check_match_array_parameter | ( | const DCArrayParameter * | other | ) | const [protected, virtual] |
Returns true if this field matches the indicated array parameter, false otherwise.
Reimplemented from DCPackerInterface.
Definition at line 215 of file dcClassParameter.cxx.
References DCPackerInterface::check_match(), DCArrayParameter::get_array_size(), and DCArrayParameter::get_element_type().
bool DCClassParameter::do_check_match_class_parameter | ( | const DCClassParameter * | other | ) | const [protected, virtual] |
Returns true if this field matches the indicated class parameter, false otherwise.
Reimplemented from DCPackerInterface.
Definition at line 195 of file dcClassParameter.cxx.
References DCPackerInterface::check_match().
void DCClassParameter::generate_hash | ( | HashGenerator & | hashgen | ) | const [virtual] |
Accumulates the properties of this type into the hash.
Reimplemented from DCParameter.
Definition at line 170 of file dcClassParameter.cxx.
References DCClass::generate_hash().
const DCClass * DCClassParameter::get_class | ( | ) | const |
Returns the class object this parameter represents.
Reimplemented from DCField.
Definition at line 128 of file dcClassParameter.cxx.
DCPackerInterface * DCClassParameter::get_nested_field | ( | int | n | ) | const [virtual] |
Returns the DCPackerInterface object that represents the nth nested field.
This may return NULL if there is no such field (but it shouldn't do this if n is in the range 0 <= n < get_num_nested_fields()).
Reimplemented from DCPackerInterface.
Definition at line 141 of file dcClassParameter.cxx.
bool DCClassParameter::is_valid | ( | ) | const [virtual] |
Returns false if the type is an invalid type (e.g.
declared from an undefined typedef), true if it is valid.
Implements DCParameter.
Definition at line 118 of file dcClassParameter.cxx.
References DCClass::is_bogus_class().
void DCClassParameter::output_instance | ( | ostream & | out, |
bool | brief, | ||
const string & | prename, | ||
const string & | name, | ||
const string & | postname | ||
) | const [virtual] |
Formats the parameter in the C++-like dc syntax as a typename and identifier.
Implements DCParameter.
Definition at line 153 of file dcClassParameter.cxx.
References DCParameter::get_typedef(), DCClass::output_instance(), and DCParameter::output_typedef_name().