![]() |
Belle II Software development
|
Public Member Functions | |
| __init__ (self, name, enter=None, exit=None) | |
| on_enter (self) | |
| on_enter (self, callbacks) | |
| on_exit (self) | |
| on_exit (self, callbacks) | |
| __str__ (self) | |
| __repr__ (self) | |
| __eq__ (self, other) | |
| __hash__ (self) | |
Public Attributes | |
| name = name | |
| Name of the State. | |
| on_enter = enter | |
| Callback list when entering state. | |
| on_exit = exit | |
| Callback list when exiting state. | |
Protected Member Functions | |
| _add_callbacks (self, callback, attribute) | |
| _ (self, callbacks, attribute) | |
Protected Attributes | |
| list | _on_enter = [] |
| set state as empty list when entering it | |
| list | _on_exit = [] |
| set state as empty list when exiting it | |
Basic State object that can take enter and exit state methods and records the state of a machine. You should assign the self.on_enter or self.on_exit attributes to callback functions or lists of them, if you need them.
Definition at line 41 of file state_machines.py.
| __init__ | ( | self, | |
| name, | |||
| enter = None, | |||
| exit = None ) |
Initialise State with a name and optional lists of callbacks.
Definition at line 50 of file state_machines.py.
|
protected |
Alternate method for lists and tuples of function objects.
Definition at line 105 of file state_machines.py.
| __eq__ | ( | self, | |
| other ) |
Definition at line 126 of file state_machines.py.
| __hash__ | ( | self | ) |
Definition at line 134 of file state_machines.py.
| __repr__ | ( | self | ) |
Definition at line 121 of file state_machines.py.
| __str__ | ( | self | ) |
Definition at line 116 of file state_machines.py.
|
protected |
Adds callback to a property.
Definition at line 94 of file state_machines.py.
| on_enter | ( | self | ) |
Runs callbacks when a state is entered.
Definition at line 62 of file state_machines.py.
| on_enter | ( | self, | |
| callbacks ) |
Definition at line 69 of file state_machines.py.
| on_exit | ( | self | ) |
Runs callbacks when a state is exited.
Definition at line 78 of file state_machines.py.
| on_exit | ( | self, | |
| callbacks ) |
Definition at line 85 of file state_machines.py.
|
protected |
set state as empty list when entering it
Definition at line 73 of file state_machines.py.
|
protected |
set state as empty list when exiting it
Definition at line 89 of file state_machines.py.
| name = name |
Name of the State.
Definition at line 55 of file state_machines.py.
| on_enter = enter |
Callback list when entering state.
Definition at line 57 of file state_machines.py.
| on_exit = exit |
Callback list when exiting state.
Definition at line 59 of file state_machines.py.