North State Framework in C#  V3.0.0
An object-oriented framework for implementing UML state machines.
Public Member Functions | Public Attributes | Properties | List of all members
NSFState Class Reference

Represents a state machine state. More...

Inheritance diagram for NSFState:
NSFTaggedObject NSFUniquelyNumberedObject INSFNamedObject NSFChoiceState NSFCompositeState NSFDeepHistory NSFForkJoin NSFInitialState NSFShallowHistory NSFStateMachine

Public Member Functions

 NSFState (NSFString name, NSFRegion parentRegion, NSFVoidAction< NSFStateMachineContext > entryAction, NSFVoidAction< NSFStateMachineContext > exitAction)
 Creates a state. More...
 
 NSFState (NSFString name, NSFCompositeState parentState, NSFVoidAction< NSFStateMachineContext > entryAction, NSFVoidAction< NSFStateMachineContext > exitAction)
 Creates a state. More...
 
bool isActive ()
 Indicates if the state is currently active. More...
 
virtual bool isInState (NSFState state)
 Indicates if the specified state is active, i.e. is "in" the specified state. More...
 
virtual bool isInState (NSFString stateName)
 Indicates if the specified state is active, i.e. is "in" the specified state. More...
 
- Public Member Functions inherited from NSFTaggedObject
 NSFTaggedObject (NSFString name)
 Creates an object with a unique id and a name. More...
 
- Public Member Functions inherited from NSFUniquelyNumberedObject
 NSFUniquelyNumberedObject ()
 Creates a uniquely numbered object. More...
 
bool isSameObject (NSFUniquelyNumberedObject other)
 Checks if this object is the same as another object. More...
 

Public Attributes

NSFVoidActions
< NSFStateMachineContext
EntryActions = new NSFVoidActions<NSFStateMachineContext>()
 Actions to be executed whenever the state is entered. More...
 
NSFVoidActions
< NSFStateMachineContext
ExitActions = new NSFVoidActions<NSFStateMachineContext>()
 Actions to be executed whenever the state is exited. More...
 

Properties

bool LogEntry [get, set]
 Gets or sets the flag indicating if trace logging is enabled or disabled for the state. More...
 
virtual NSFStateMachine TopStateMachine [get]
 Gets the top state machine encompassing the state. More...
 
- Properties inherited from NSFTaggedObject
NSFString Name [get, set]
 
- Properties inherited from NSFUniquelyNumberedObject
NSFId UniqueId [get]
 Gets or sets the unique id of the object. More...
 
- Properties inherited from INSFNamedObject
NSFString Name [get]
 Gets the name of the object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from NSFUniquelyNumberedObject
static NSFId getNextUniqueId ()
 Gets the next unique id. More...
 

Detailed Description

Represents a state machine state.

This class is used by the North State Framework as a base class for all state types. It is rarely used by external applications. They should use NSFCompositeState rather than NSFState, for greater flexibility and extensibility.

Constructor & Destructor Documentation

NSFState ( NSFString  name,
NSFRegion  parentRegion,
NSFVoidAction< NSFStateMachineContext entryAction,
NSFVoidAction< NSFStateMachineContext exitAction 
)

Creates a state.

Parameters
nameThe name of the state.
parentRegionThe parent region of the state.
entryActionThe actions to be performed upon entry to the state.
exitActionThe actions to be performed upon exit of the state.
NSFState ( NSFString  name,
NSFCompositeState  parentState,
NSFVoidAction< NSFStateMachineContext entryAction,
NSFVoidAction< NSFStateMachineContext exitAction 
)

Creates a state.

Parameters
nameThe name of the state.
parentStateThe parent state of the state.
entryActionThe actions to be performed upon entry to the state.
exitActionThe actions to be performed upon exit of the state.

Member Function Documentation

bool isActive ( )

Indicates if the state is currently active.

Returns
True if the state is active, otherwise false.

When this method returns true, the state machine is said to be "in" this state.

virtual bool isInState ( NSFState  state)
virtual

Indicates if the specified state is active, i.e. is "in" the specified state.

Parameters
stateState in question.
Returns
True if the specified state is active, otherwise false.

Reimplemented in NSFCompositeState.

virtual bool isInState ( NSFString  stateName)
virtual

Indicates if the specified state is active, i.e. is "in" the specified state.

Parameters
stateNameName of state in question. Assumes unique names.
Returns
True if the specified state is active, otherwise false.

Reimplemented in NSFCompositeState.

Member Data Documentation

NSFVoidActions<NSFStateMachineContext> EntryActions = new NSFVoidActions<NSFStateMachineContext>()

Actions to be executed whenever the state is entered.

NSFVoidActions<NSFStateMachineContext> ExitActions = new NSFVoidActions<NSFStateMachineContext>()

Actions to be executed whenever the state is exited.

Property Documentation

bool LogEntry
getset

Gets or sets the flag indicating if trace logging is enabled or disabled for the state.

If this flag and the state machine's logging enabled flag are set true, then entry into the state is logged in the trace log.

virtual NSFStateMachine TopStateMachine
get

Gets the top state machine encompassing the state.

Returns
The top state machine.



Copyright 2004-2014, North State Software, LLC. All rights reserved.