vtkKWStateMachine Class Reference

a state machine. More...

#include <vtkKWStateMachine.h>

Inheritance diagram for vtkKWStateMachine:
Inheritance graph
[legend]
Collaboration diagram for vtkKWStateMachine:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkKWObject Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual int IsRunning ()
virtual void PushInput (vtkKWStateMachineInput *input)
virtual void ProcessInputs ()

Static Public Member Functions

static vtkKWStateMachineNew ()
static int IsTypeOf (const char *type)
static vtkKWStateMachineSafeDownCast (vtkObject *o)

Protected Member Functions

 vtkKWStateMachine ()
 ~vtkKWStateMachine ()
virtual void ProcessInput (vtkKWStateMachineInput *input)
virtual void PushTransitionToHistory (vtkKWStateMachineTransition *)

Protected Attributes

vtkKWStateMachineStateInitialState
vtkKWStateMachineStateCurrentState
vtkKWStateMachineInternals * Internals
char * CurrentStateChangedCommand



enum  { CurrentStateChangedEvent = 10000 }
virtual int AddState (vtkKWStateMachineState *state)
virtual int HasState (vtkKWStateMachineState *state)
virtual int GetNumberOfStates ()
virtual vtkKWStateMachineStateGetNthState (int rank)
virtual int AddInput (vtkKWStateMachineInput *input)
virtual int HasInput (vtkKWStateMachineInput *input)
virtual int GetNumberOfInputs ()
virtual vtkKWStateMachineInputGetNthInput (int rank)
virtual int AddTransition (vtkKWStateMachineTransition *transition)
virtual int HasTransition (vtkKWStateMachineTransition *transition)
virtual int GetNumberOfTransitions ()
virtual
vtkKWStateMachineTransition
GetNthTransition (int rank)
virtual
vtkKWStateMachineTransition
CreateTransition (vtkKWStateMachineState *origin, vtkKWStateMachineInput *input, vtkKWStateMachineState *destination)
virtual
vtkKWStateMachineTransition
FindTransition (vtkKWStateMachineState *origin, vtkKWStateMachineInput *input)
virtual
vtkKWStateMachineTransition
FindTransition (vtkKWStateMachineState *origin, vtkKWStateMachineInput *input, vtkKWStateMachineState *destination)
virtual vtkKWStateMachineStateGetInitialState ()
virtual int SetInitialState (vtkKWStateMachineState *)
virtual vtkKWStateMachineStateGetCurrentState ()
vtkKWStateMachineStateGetPreviousState ()
virtual int GetNumberOfTransitionsInHistory ()
virtual
vtkKWStateMachineTransition
GetNthTransitionInHistory (int rank)
virtual int AddCluster (vtkKWStateMachineCluster *cluster)
virtual int HasCluster (vtkKWStateMachineCluster *cluster)
virtual int GetNumberOfClusters ()
virtual vtkKWStateMachineClusterGetNthCluster (int rank)
virtual void SetCurrentStateChangedCommand (vtkObject *object, const char *method)
virtual void InvokeCurrentStateChangedCommand ()
virtual int HasCurrentStateChangedCommand ()
virtual void RemoveState (vtkKWStateMachineState *state)
virtual void RemoveAllStates ()
virtual void RemoveInput (vtkKWStateMachineInput *input)
virtual void RemoveAllInputs ()
virtual void RemoveTransition (vtkKWStateMachineTransition *transition)
virtual void RemoveAllTransitions ()
virtual void RemoveCluster (vtkKWStateMachineCluster *cluster)
virtual void RemoveAllClusters ()

Detailed Description

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.

Thanks:
This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Information on the National Centers for Biomedical Computing can be obtained from http://nihroadmap.nih.gov/bioinformatics.
See also:
vtkKWStateMachineInput vtkKWStateMachineState vtkKWStateMachineTransition

Definition at line 42 of file vtkKWStateMachine.h.


Member Typedef Documentation

Reimplemented from vtkKWObject.

Reimplemented in vtkKWWizardWorkflow.

Definition at line 47 of file vtkKWStateMachine.h.


Member Enumeration Documentation

anonymous enum

Events. The CurrentStateChangedCommand is invoked when the state machine current state has changed. BTX

Enumerator:
CurrentStateChangedEvent 

Definition at line 171 of file vtkKWStateMachine.h.


Constructor & Destructor Documentation

vtkKWStateMachine::vtkKWStateMachine (  )  [protected]
vtkKWStateMachine::~vtkKWStateMachine (  )  [protected]

Member Function Documentation

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.


Member Data Documentation

Definition at line 184 of file vtkKWStateMachine.h.

Definition at line 185 of file vtkKWStateMachine.h.

vtkKWStateMachineInternals* vtkKWStateMachine::Internals [protected]

Reimplemented in vtkKWWizardWorkflow.

Definition at line 213 of file vtkKWStateMachine.h.

Definition at line 219 of file vtkKWStateMachine.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Tue Apr 27 02:37:48 2010 for KWWidgets by  doxygen 1.6.1