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 | |
DCClass | asClass () |
DCClass const | asClass () |
DCSwitch | asSwitch () |
DCSwitch const | asSwitch () |
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. | |
output (ostream out) | |
Write a string representation of this instance to <out>. | |
write (ostream out, int indent_level) | |
Write a string representation of this instance to <out>. |
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.
DCClass asClass | ( | ) | [inherited] |
DCClass const asClass | ( | ) | [inherited] |
DCSwitch asSwitch | ( | ) | [inherited] |
DCSwitch const asSwitch | ( | ) | [inherited] |
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.
output | ( | ostream | out | ) | [inherited] |
Write a string representation of this instance to <out>.
Reimplemented in DCClass.
write | ( | ostream | out, |
int | indent_level | ||
) | [inherited] |
Write a string representation of this instance to <out>.