Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions

# DCSwitch Class Reference

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. More...

Inheritance diagram for DCSwitch:

List of all members.

## Public Member Functions
DCPackerInterface | getCase (int n)
| Returns the DCPackerInterface that packs the nth case.
int | getCaseByValue (string case_value)
| Returns the index number of the case with the indicated packed value, or -1 if no case has this value.
DCPackerInterface | getDefaultCase ()
| Returns the DCPackerInterface that packs the default case, or NULL if there is no default case.
DCField | getField (int case_index, int n)
| Returns the nth field in the indicated case.
DCField | getFieldByName (int case_index, string name)
| Returns the field with the given name from the indicated case, or NULL if no field has this name.
DCField | getKeyParameter ()
| Returns the key parameter on which the switch is based.
string | getName ()
| Returns the name of this switch.
int | getNumCases ()
| Returns the number of different cases within the switch.
int | getNumFields (int case_index)
| Returns the number of fields in the indicated case.
string | getValue (int case_index)
| Returns the packed value associated with the indicated case.

## Detailed Description

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.

## Member Function Documentation

DCPackerInterface getCase | ( | int | n | ) |

Returns the DCPackerInterface that packs the nth case.

int getCaseByValue | ( | string | case_value | ) |

Returns the index number of the case with the indicated packed value, or -1 if no case has this value.

DCPackerInterface getDefaultCase | ( |  | ) |

Returns the DCPackerInterface that packs the default case, or NULL if there is no default case.

DCField getField | ( | int | case_index,
|  | int | n
| ) |  |

Returns the nth field in the indicated case.

DCField getFieldByName | ( | int | case_index,
|  | string | name
| ) |  |

Returns the field with the given name from the indicated case, or NULL if no field has this name.

DCField getKeyParameter | ( |  | ) |

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.

string getName | ( |  | ) |

Returns the name of this switch.

int getNumCases | ( |  | ) |

Returns the number of different cases within the switch.

The legal values for case_index range from 0 to get_num_cases() - 1.

int getNumFields | ( | int | case_index | ) |

Returns the number of fields in the indicated case.

string getValue | ( | int | case_index | ) |

Returns the packed value associated with the indicated case.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties