Panda3D
|
Represents the type specification for a single parameter within a field specification. More...
#include "dcParameter.h"
Public Member Functions | |
virtual DCParameter * | append_array_specification (const DCUnsignedIntRange &size) |
Returns the type represented by this_type[size]. | |
virtual DCArrayParameter * | as_array_parameter () |
virtual const DCArrayParameter * | as_array_parameter () const |
virtual DCClassParameter * | as_class_parameter () |
virtual const DCClassParameter * | as_class_parameter () const |
virtual DCParameter * | as_parameter () |
virtual const DCParameter * | as_parameter () const |
virtual DCSimpleParameter * | as_simple_parameter () |
virtual const DCSimpleParameter * | as_simple_parameter () const |
virtual DCSwitchParameter * | as_switch_parameter () |
virtual const DCSwitchParameter * | as_switch_parameter () const |
virtual void | generate_hash (HashGenerator &hashgen) const |
Accumulates the properties of this type into the hash. | |
const DCTypedef * | get_typedef () const |
If this type has been referenced from a typedef, returns the DCTypedef instance, or NULL if the type was declared on-the-fly. | |
virtual bool | is_valid () const =0 |
virtual DCParameter * | make_copy () const =0 |
virtual void | output (ostream &out, bool brief) const |
virtual void | output_instance (ostream &out, bool brief, const string &prename, const string &name, const string &postname) const =0 |
void | output_typedef_name (ostream &out, bool brief, const string &prename, const string &name, const string &postname) const |
Formats the instance like output_instance, but uses the typedef name instead. | |
void | set_typedef (const DCTypedef *dtypedef) |
Records the DCTypedef object that generated this parameter. | |
virtual void | write (ostream &out, bool brief, int indent_level) const |
virtual void | write_instance (ostream &out, bool brief, int indent_level, const string &prename, const string &name, const string &postname) const |
Formats the parameter in the C++-like dc syntax as a typename and identifier. | |
void | write_typedef_name (ostream &out, bool brief, int indent_level, const string &prename, const string &name, const string &postname) const |
Formats the instance like write_instance, but uses the typedef name instead. | |
Protected Member Functions | |
DCParameter (const DCParameter ©) |
Represents the type specification for a single parameter within a field specification.
This may be a simple type, or it may be a class or an array reference.
This may also be a typedef reference to another type, which has the same properties as the referenced type, but a different name.
Definition at line 39 of file dcParameter.h.
DCParameter * DCParameter::append_array_specification | ( | const DCUnsignedIntRange & | size | ) | [virtual] |
Returns the type represented by this_type[size].
In the case of a generic DCParameter, this means it returns a DCArrayParameter wrapped around this type.
Reimplemented in DCArrayParameter.
Definition at line 188 of file dcParameter.cxx.
Referenced by DCArrayParameter::append_array_specification().
void DCParameter::generate_hash | ( | HashGenerator & | hashgen | ) | const [virtual] |
Accumulates the properties of this type into the hash.
Reimplemented from DCField.
Reimplemented in DCArrayParameter, DCClassParameter, DCSimpleParameter, and DCSwitchParameter.
Definition at line 284 of file dcParameter.cxx.
References DCKeywordList::get_num_keywords().
Referenced by DCSimpleParameter::generate_hash(), and DCArrayParameter::generate_hash().
const DCTypedef * DCParameter::get_typedef | ( | ) | const |
If this type has been referenced from a typedef, returns the DCTypedef instance, or NULL if the type was declared on-the-fly.
Definition at line 163 of file dcParameter.cxx.
Referenced by DCArrayParameter::append_array_specification(), DCArrayParameter::output_instance(), DCClassParameter::output_instance(), output_typedef_name(), and write_typedef_name().
void DCParameter::output_typedef_name | ( | ostream & | out, |
bool | brief, | ||
const string & | prename, | ||
const string & | name, | ||
const string & | postname | ||
) | const |
Formats the instance like output_instance, but uses the typedef name instead.
Definition at line 246 of file dcParameter.cxx.
References DCTypedef::get_name(), and get_typedef().
Referenced by DCArrayParameter::output_instance(), and DCClassParameter::output_instance().
void DCParameter::set_typedef | ( | const DCTypedef * | dtypedef | ) |
Records the DCTypedef object that generated this parameter.
This is normally called only from DCTypedef::make_new_parameter().
Definition at line 175 of file dcParameter.cxx.
Referenced by DCTypedef::make_new_parameter().
void DCParameter::write_instance | ( | ostream & | out, |
bool | brief, | ||
int | indent_level, | ||
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.
Reimplemented in DCSwitchParameter.
Definition at line 226 of file dcParameter.cxx.
void DCParameter::write_typedef_name | ( | ostream & | out, |
bool | brief, | ||
int | indent_level, | ||
const string & | prename, | ||
const string & | name, | ||
const string & | postname | ||
) | const |
Formats the instance like write_instance, but uses the typedef name instead.
Definition at line 261 of file dcParameter.cxx.
References DCTypedef::get_name(), and get_typedef().