Panda3D
Public Member Functions | Protected Member Functions

DCParameter Class Reference

Represents the type specification for a single parameter within a field specification. More...

#include "dcParameter.h"

Inheritance diagram for DCParameter:
DCField DCPackerInterface DCKeywordList DCArrayParameter DCClassParameter DCSimpleParameter DCSwitchParameter

List of all members.

Public Member Functions

virtual DCParameterappend_array_specification (const DCUnsignedIntRange &size)
 Returns the type represented by this_type[size].
virtual DCArrayParameteras_array_parameter ()
virtual const DCArrayParameteras_array_parameter () const
virtual DCClassParameteras_class_parameter ()
virtual const DCClassParameteras_class_parameter () const
virtual DCParameteras_parameter ()
virtual const DCParameteras_parameter () const
virtual DCSimpleParameteras_simple_parameter ()
virtual const DCSimpleParameteras_simple_parameter () const
virtual DCSwitchParameteras_switch_parameter ()
virtual const DCSwitchParameteras_switch_parameter () const
virtual void generate_hash (HashGenerator &hashgen) const
 Accumulates the properties of this type into the hash.
const DCTypedefget_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 DCParametermake_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 &copy)

Detailed Description

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.


Member Function Documentation

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().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations