DCSwitch¶
-
class DCSwitch¶
Bases:
DCDeclarationThis 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
digraph inheritance083ae77f69 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DCDeclaration" [URL="acron.direct.DCDeclaration.html#acron.direct.DCDeclaration",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "DCDeclaration" [arrowsize=0.75,style=""]; "DCSwitch" [URL="acron.direct.DCSwitch.html#acron.direct.DCSwitch",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DCDeclaration" -> "DCSwitch" [arrowsize=0.75,style=""]; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; }- DCSwitch.get_case()¶
Returns the
DCPackerInterfacethat packs the nth case.
- DCSwitch.get_case_by_value()¶
Returns the index number of the case with the indicated packed value, or -1 if no case has this value.
- DCSwitch.get_default_case()¶
Returns the
DCPackerInterfacethat packs the default case, or NULL if there is no default case.
- DCSwitch.get_field()¶
Returns the nth field in the indicated case.
- DCSwitch.get_field_by_name()¶
Returns the field with the given name from the indicated case, or NULL if no field has this name.
- DCSwitch.get_key_parameter()¶
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.
- DCSwitch.get_name()¶
Returns the name of this switch.
- DCSwitch.get_num_cases()¶
Returns the number of different cases within the switch. The legal values for case_index range from 0 to get_num_cases() - 1.
- DCSwitch.get_num_fields()¶
Returns the number of fields in the indicated case.
- DCSwitch.get_value()¶
Returns the packed value associated with the indicated case.