DCSwitch

from panda3d.direct import DCSwitch
class DCSwitch

Bases: DCDeclaration

This represents a switch statement, which can appear inside a class body and represents two or more alternative unpacking schemes based on the first field read.

Inheritance diagram

Inheritance diagram of DCSwitch

__init__(*args, **kwargs)
getCase()

C++ Interface: get_case(DCSwitch self, int n)

/**
  • Returns the DCPackerInterface that packs the nth case.

*/

getCaseByValue()

C++ Interface: get_case_by_value(DCSwitch self, bytes case_value)

/**
  • Returns the index number of the case with the indicated packed value, or -1

  • if no case has this value.

*/

getDefaultCase()

C++ Interface: get_default_case(DCSwitch self)

/**
  • Returns the DCPackerInterface that packs the default case, or NULL if there

  • is no default case.

*/

getField()

C++ Interface: get_field(DCSwitch self, int case_index, int n)

/**
  • Returns the nth field in the indicated case.

*/

getFieldByName()

C++ Interface: get_field_by_name(DCSwitch self, int case_index, str name)

/**
  • Returns the field with the given name from the indicated case, or NULL if

  • no field has this name.

*/

getKeyParameter()

C++ Interface: get_key_parameter(DCSwitch self)

/**
  • Returns the key parameter on which the switch is based. The value of this

  • parameter in the record determines which one of the several cases within

  • the switch will be used.

*/

getName()

C++ Interface: get_name(DCSwitch self)

/**
  • Returns the name of this switch.

*/

getNumCases()

C++ Interface: get_num_cases(DCSwitch self)

/**
  • Returns the number of different cases within the switch. The legal values

  • for case_index range from 0 to get_num_cases() - 1.

*/

getNumFields()

C++ Interface: get_num_fields(DCSwitch self, int case_index)

/**
  • Returns the number of fields in the indicated case.

*/

getValue()

C++ Interface: get_value(DCSwitch self, int case_index)

/**
  • Returns the packed value associated with the indicated case.

*/

get_case()

C++ Interface: get_case(DCSwitch self, int n)

/**
  • Returns the DCPackerInterface that packs the nth case.

*/

get_case_by_value()

C++ Interface: get_case_by_value(DCSwitch self, bytes case_value)

/**
  • Returns the index number of the case with the indicated packed value, or -1

  • if no case has this value.

*/

get_default_case()

C++ Interface: get_default_case(DCSwitch self)

/**
  • Returns the DCPackerInterface that packs the default case, or NULL if there

  • is no default case.

*/

get_field()

C++ Interface: get_field(DCSwitch self, int case_index, int n)

/**
  • Returns the nth field in the indicated case.

*/

get_field_by_name()

C++ Interface: get_field_by_name(DCSwitch self, int case_index, str name)

/**
  • Returns the field with the given name from the indicated case, or NULL if

  • no field has this name.

*/

get_key_parameter()

C++ Interface: get_key_parameter(DCSwitch self)

/**
  • Returns the key parameter on which the switch is based. The value of this

  • parameter in the record determines which one of the several cases within

  • the switch will be used.

*/

get_name()

C++ Interface: get_name(DCSwitch self)

/**
  • Returns the name of this switch.

*/

get_num_cases()

C++ Interface: get_num_cases(DCSwitch self)

/**
  • Returns the number of different cases within the switch. The legal values

  • for case_index range from 0 to get_num_cases() - 1.

*/

get_num_fields()

C++ Interface: get_num_fields(DCSwitch self, int case_index)

/**
  • Returns the number of fields in the indicated case.

*/

get_value()

C++ Interface: get_value(DCSwitch self, int case_index)

/**
  • Returns the packed value associated with the indicated case.

*/