a state machine. More...
#include <vtkKWStateMachine.h>


a state machine.
This class is the basis for a state machine framework. A state machine is defined by a set of states, a set of inputs and a transition matrix that defines for each pair of (state,input) what is the next state to assume.
Definition at line 42 of file vtkKWStateMachine.h.
Reimplemented from vtkKWObject.
Reimplemented in vtkKWWizardWorkflow.
Definition at line 47 of file vtkKWStateMachine.h.
| anonymous enum |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
Definition at line 171 of file vtkKWStateMachine.h.
| vtkKWStateMachine::vtkKWStateMachine | ( | ) | [protected] |
| vtkKWStateMachine::~vtkKWStateMachine | ( | ) | [protected] |
| static vtkKWStateMachine* vtkKWStateMachine::New | ( | ) | [static] |
Reimplemented from vtkKWObject.
Reimplemented in vtkKWWizardWorkflow.
| virtual const char* vtkKWStateMachine::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkKWObject.
Reimplemented in vtkKWWizardWorkflow.
| static int vtkKWStateMachine::IsTypeOf | ( | const char * | type | ) | [static] |
Reimplemented from vtkKWObject.
Reimplemented in vtkKWWizardWorkflow.
| virtual int vtkKWStateMachine::IsA | ( | const char * | type | ) | [virtual] |
Reimplemented from vtkKWObject.
Reimplemented in vtkKWWizardWorkflow.
| static vtkKWStateMachine* vtkKWStateMachine::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkKWObject.
Reimplemented in vtkKWWizardWorkflow.
| void vtkKWStateMachine::PrintSelf | ( | ostream & | os, | |
| vtkIndent | indent | |||
| ) | [virtual] |
Reimplemented from vtkKWObject.
Reimplemented in vtkKWWizardWorkflow.
| virtual int vtkKWStateMachine::AddState | ( | vtkKWStateMachineState * | state | ) | [virtual] |
Add a state. Return 1 on success, 0 otherwise.
| virtual int vtkKWStateMachine::HasState | ( | vtkKWStateMachineState * | state | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual int vtkKWStateMachine::GetNumberOfStates | ( | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual vtkKWStateMachineState* vtkKWStateMachine::GetNthState | ( | int | rank | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual int vtkKWStateMachine::AddInput | ( | vtkKWStateMachineInput * | input | ) | [virtual] |
Add an input. Return 1 on success, 0 otherwise.
| virtual int vtkKWStateMachine::HasInput | ( | vtkKWStateMachineInput * | input | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual int vtkKWStateMachine::GetNumberOfInputs | ( | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual vtkKWStateMachineInput* vtkKWStateMachine::GetNthInput | ( | int | rank | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual int vtkKWStateMachine::AddTransition | ( | vtkKWStateMachineTransition * | transition | ) | [virtual] |
Add a transition. The transition must be complete, i.e. its originating and destination states must be set, as well as its input. Furthermore, said parameters must be known to the state machine, i.e. one should make sure the states and input have been added to the state machine first. Return 1 on success, 0 otherwise.
| virtual int vtkKWStateMachine::HasTransition | ( | vtkKWStateMachineTransition * | transition | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual int vtkKWStateMachine::GetNumberOfTransitions | ( | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual vtkKWStateMachineTransition* vtkKWStateMachine::GetNthTransition | ( | int | rank | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual vtkKWStateMachineTransition* vtkKWStateMachine::CreateTransition | ( | vtkKWStateMachineState * | origin, | |
| vtkKWStateMachineInput * | input, | |||
| vtkKWStateMachineState * | destination | |||
| ) | [virtual] |
Create and add a new transition. If a transition object has already been added with the same parameters, it will be used instead. Return transition on success, NULL otherwise.
| virtual vtkKWStateMachineTransition* vtkKWStateMachine::FindTransition | ( | vtkKWStateMachineState * | origin, | |
| vtkKWStateMachineInput * | input | |||
| ) | [virtual] |
Find a transition. Return transition on success, NULL otherwise.
| virtual vtkKWStateMachineTransition* vtkKWStateMachine::FindTransition | ( | vtkKWStateMachineState * | origin, | |
| vtkKWStateMachineInput * | input, | |||
| vtkKWStateMachineState * | destination | |||
| ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual vtkKWStateMachineState* vtkKWStateMachine::GetInitialState | ( | ) | [virtual] |
Set/Get the initial state. IMPORTANT: This call bootstraps/starts the state machine, it should therefore be the *last* method you call after setting up the whole state machine. No input, state or transition can be added afterwards. Note that the initial state can not be reset. Note that setting the initial state is actually the same as entering it (i.e. the state's Enter() method will be called). Return 1 on success, 0 otherwise.
| virtual int vtkKWStateMachine::SetInitialState | ( | vtkKWStateMachineState * | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual int vtkKWStateMachine::IsRunning | ( | ) | [virtual] |
Get if the state machine is actually running. At the moment, this is done by checking if InitialState has been set.
| virtual vtkKWStateMachineState* vtkKWStateMachine::GetCurrentState | ( | ) | [virtual] |
Get the current and previous state.
| vtkKWStateMachineState* vtkKWStateMachine::GetPreviousState | ( | ) |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual void vtkKWStateMachine::PushInput | ( | vtkKWStateMachineInput * | input | ) | [virtual] |
Push a new input in the queue of inputs to be processed.
| virtual void vtkKWStateMachine::ProcessInputs | ( | ) | [virtual] |
Perform the state transition and invoke the corresponding action for every pending input stored in the input queue. For each input in the queue: - a transition T is searched accepting the current state C and the input, - if found: - T's Start() method is triggered, - C's Leave() method is triggered, - T is pushed to the history (see GetNthTransitionInHistory), - C becomes T's DestinationState (i.e. current state = new state), - CurrentStateChangedCommand and CurrentStateChangedEvent are invoked, - C (i.e. T's DestinationState)'s Enter() method is triggered, - T's End() method is triggered.
| virtual int vtkKWStateMachine::GetNumberOfTransitionsInHistory | ( | ) | [virtual] |
The state machine keeps an history of all the transitions that were applied so far.
| virtual vtkKWStateMachineTransition* vtkKWStateMachine::GetNthTransitionInHistory | ( | int | rank | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual int vtkKWStateMachine::AddCluster | ( | vtkKWStateMachineCluster * | cluster | ) | [virtual] |
Add a cluster. Clusters are not used by the state machine per se, they are just a convenient way to group states logically together, and can be used by state machine writers (see vtkKWStateMachineDOTWriter) to display clusters as groups. Return 1 on success, 0 otherwise.
| virtual int vtkKWStateMachine::HasCluster | ( | vtkKWStateMachineCluster * | cluster | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual int vtkKWStateMachine::GetNumberOfClusters | ( | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual vtkKWStateMachineCluster* vtkKWStateMachine::GetNthCluster | ( | int | rank | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual void vtkKWStateMachine::SetCurrentStateChangedCommand | ( | vtkObject * | object, | |
| const char * | method | |||
| ) | [virtual] |
Specifies a command to associate with this state machine. This command is invoked when the state machine current state has changed. The 'object' argument is the object that will have the method called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the object is NULL, the method is still evaluated as a simple command.
| virtual void vtkKWStateMachine::InvokeCurrentStateChangedCommand | ( | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
Reimplemented in vtkKWWizardWorkflow.
| virtual int vtkKWStateMachine::HasCurrentStateChangedCommand | ( | ) | [virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual void vtkKWStateMachine::RemoveState | ( | vtkKWStateMachineState * | state | ) | [protected, virtual] |
Remove state(s).
| virtual void vtkKWStateMachine::RemoveAllStates | ( | ) | [protected, virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual void vtkKWStateMachine::RemoveInput | ( | vtkKWStateMachineInput * | input | ) | [protected, virtual] |
Remove input(s).
| virtual void vtkKWStateMachine::RemoveAllInputs | ( | ) | [protected, virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual void vtkKWStateMachine::RemoveTransition | ( | vtkKWStateMachineTransition * | transition | ) | [protected, virtual] |
Remove transition(s).
| virtual void vtkKWStateMachine::RemoveAllTransitions | ( | ) | [protected, virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual void vtkKWStateMachine::RemoveCluster | ( | vtkKWStateMachineCluster * | cluster | ) | [protected, virtual] |
Remove cluster(s).
| virtual void vtkKWStateMachine::RemoveAllClusters | ( | ) | [protected, virtual] |
Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX
| virtual void vtkKWStateMachine::ProcessInput | ( | vtkKWStateMachineInput * | input | ) | [protected, virtual] |
Process one input.
| virtual void vtkKWStateMachine::PushTransitionToHistory | ( | vtkKWStateMachineTransition * | ) | [protected, virtual] |
Push transition to the history.
vtkKWStateMachineState* vtkKWStateMachine::InitialState [protected] |
Definition at line 184 of file vtkKWStateMachine.h.
vtkKWStateMachineState* vtkKWStateMachine::CurrentState [protected] |
Definition at line 185 of file vtkKWStateMachine.h.
vtkKWStateMachineInternals* vtkKWStateMachine::Internals [protected] |
Reimplemented in vtkKWWizardWorkflow.
Definition at line 213 of file vtkKWStateMachine.h.
char* vtkKWStateMachine::CurrentStateChangedCommand [protected] |
Definition at line 219 of file vtkKWStateMachine.h.
1.6.1