Panda3D
|
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...
Public Member Functions | |
DCPackerInterface | getCase (int n) |
Returns the DCPackerInterface that packs the nth case. More... | |
int | getCaseByValue (str case_value) |
Returns the index number of the case with the indicated packed value, or -1 if no case has this value. More... | |
DCPackerInterface | getDefaultCase () |
Returns the DCPackerInterface that packs the default case, or NULL if there is no default case. More... | |
DCField | getField (int case_index, int n) |
Returns the nth field in the indicated case. More... | |
DCField | getFieldByName (int case_index, str name) |
Returns the field with the given name from the indicated case, or NULL if no field has this name. More... | |
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. More... | |
str | getName () |
Returns the name of this switch. More... | |
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. More... | |
int | getNumFields (int case_index) |
Returns the number of fields in the indicated case. More... | |
str | getValue (int case_index) |
Returns the packed value associated with the indicated case. More... | |
![]() | |
DCClass | asClass () |
const DCClass | asClass () |
DCSwitch | asSwitch () |
const DCSwitch | asSwitch () |
output (Ostream out) | |
Write a string representation of this instance to <out>. More... | |
write (Ostream out, int indent_level) | |
Write a string representation of this instance to <out>. More... | |
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.
DCPackerInterface getCase | ( | int | n | ) |
Returns the DCPackerInterface that packs the nth case.
int getCaseByValue | ( | str | 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, |
str | 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.
str 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.
str getValue | ( | int | case_index | ) |
Returns the packed value associated with the indicated case.