Panda3D
Public Member Functions | Protected Member Functions
DCSwitchParameter Class Reference

This represents a switch object used as a parameter itself, which packs the appropriate fields of the switch into the message. More...

#include "dcSwitchParameter.h"

Inheritance diagram for DCSwitchParameter:
DCParameter DCField DCPackerInterface DCKeywordList

List of all members.

Public Member Functions

 DCSwitchParameter (const DCSwitch *dswitch)
 DCSwitchParameter (const DCSwitchParameter &copy)
const DCPackerInterfaceapply_switch (const char *value_data, size_t length) const
 Returns the DCPackerInterface that presents the alternative fields for the case indicated by the given packed value string, or NULL if the value string does not match one of the expected cases.
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.
virtual DCPackerInterfaceget_nested_field (int n) const
 Returns the DCPackerInterface object that represents the nth nested field.
const DCSwitchget_switch () const
 Returns the switch object this parameter represents.
virtual bool is_valid () const
 Returns false if the type is an invalid type (e.g.
virtual DCParametermake_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.
virtual bool pack_default_value (DCPackData &pack_data, bool &pack_error) const
 Packs the switchParameter's specified default value (or a sensible default if no value is specified) into the stream.
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.

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_switch_parameter (const DCSwitchParameter *other) const
 Returns true if this field matches the indicated switch parameter, false otherwise.

Detailed Description

This represents a switch object used as a parameter itself, which packs the appropriate fields of the switch into the message.

Definition at line 29 of file dcSwitchParameter.h.


Member Function Documentation

const DCPackerInterface * DCSwitchParameter::apply_switch ( const char *  value_data,
size_t  length 
) const

Returns the DCPackerInterface that presents the alternative fields for the case indicated by the given packed value string, or NULL if the value string does not match one of the expected cases.

Definition at line 169 of file dcSwitchParameter.cxx.

bool DCSwitchParameter::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 247 of file dcSwitchParameter.cxx.

References DCPackerInterface::do_check_match_switch_parameter().

bool DCSwitchParameter::do_check_match_switch_parameter ( const DCSwitchParameter other) const [protected, virtual]

Returns true if this field matches the indicated switch parameter, false otherwise.

Reimplemented from DCPackerInterface.

Definition at line 258 of file dcSwitchParameter.cxx.

void DCSwitchParameter::generate_hash ( HashGenerator hashgen) const [virtual]

Accumulates the properties of this type into the hash.

Reimplemented from DCParameter.

Definition at line 215 of file dcSwitchParameter.cxx.

References DCSwitch::generate_hash().

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 156 of file dcSwitchParameter.cxx.

Returns the switch object this parameter represents.

Definition at line 143 of file dcSwitchParameter.cxx.

bool DCSwitchParameter::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 133 of file dcSwitchParameter.cxx.

void DCSwitchParameter::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 180 of file dcSwitchParameter.cxx.

bool DCSwitchParameter::pack_default_value ( DCPackData pack_data,
bool &  pack_error 
) const [virtual]

Packs the switchParameter's specified default value (or a sensible default if no value is specified) into the stream.

Returns true if the default value is packed, false if the switchParameter doesn't know how to pack its default value.

Reimplemented from DCField.

Definition at line 230 of file dcSwitchParameter.cxx.

References DCSwitch::pack_default_value().

void DCSwitchParameter::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 from DCParameter.

Definition at line 197 of file dcSwitchParameter.cxx.


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