North State Framework in C#
V3.0.0
An object-oriented framework for implementing UML state machines.
|
Represents the interface for classes that can queue and handle events. More...
Public Member Functions | |
NSFEventStatus | handleEvent (NSFEvent nsfEvent) |
Handles an event. More... | |
void | queueEvent (NSFEvent nsfEvent) |
Queues an event for the handler. More... | |
void | queueEvent (NSFEvent nsfEvent, INSFNamedObject source) |
Queues an event for the handler. More... | |
void | startEventHandler () |
Starts event processing. More... | |
void | stopEventHandler () |
Stops event processing. More... | |
void | terminate (bool waitForTerminated) |
Terminates the event handler, so that it can be garbage collected. More... | |
Properties | |
NSFEventHandlerRunStatus | RunStatus [get] |
Gets the run status of the event handler. More... | |
NSFEventHandlerTerminationStatus | TerminationStatus [get] |
Gets the termination status of the event handler. More... | |
Properties inherited from INSFNamedObject | |
NSFString | Name [get] |
Gets the name of the object. More... | |
Represents the interface for classes that can queue and handle events.
NSFEventStatus handleEvent | ( | NSFEvent | nsfEvent | ) |
Handles an event.
nsfEvent | The event to handle. |
This method is for use only by the North State Framework's internal logic.
Implemented in NSFEventHandler, and NSFStateMachine.
void queueEvent | ( | NSFEvent | nsfEvent | ) |
Queues an event for the handler.
nsfEvent | The event to queue. |
Implemented in NSFStateMachine, and NSFEventHandler.
void queueEvent | ( | NSFEvent | nsfEvent, |
INSFNamedObject | source | ||
) |
Queues an event for the handler.
nsfEvent | The event to queue. |
source | The source of the event. |
Implemented in NSFEventHandler, and NSFStateMachine.
void startEventHandler | ( | ) |
Starts event processing.
When stopped, events queued prior to calling the method startEventHandler() will be dropped. Events queued after calling the method startEventHandler() will be processed, until the next call to stopEventHandler(). When started, events queued prior to calling the method stopEventHandler() will be processed. Events queued after calling the method stopEventHandler() will be dropped, until the next call to startEventHandler().
Implemented in NSFEventHandler, and NSFStateMachine.
void stopEventHandler | ( | ) |
Stops event processing.
When stopped, events queued prior to calling the method startEventHandler() will be dropped. Events queued after calling the method startEventHandler() will be processed, until the next call to stopEventHandler(). When started, events queued prior to calling the method stopEventHandler() will be processed. Events queued after calling the method stopEventHandler() will be dropped, until the next call to startEventHandler().
Implemented in NSFEventHandler, and NSFStateMachine.
void terminate | ( | bool | waitForTerminated | ) |
Terminates the event handler, so that it can be garbage collected.
waitForTerminated | Flag indicating if the method should wait until the event handler is terminated (true), or if it should return immediately (false). |
This method terminates the event handler in a coordinated fashion, making sure all remaining events are cleared, so that it can be garbage collected. After calling this method, the event handler cannot be restarted. This method should only be called if the event handler should be garbage collected. If the waitForTerminated flag is set true, this method must not be called from the event handler's thread of execution.
Implemented in NSFStateMachine, and NSFEventHandler.
|
get |
Gets the run status of the event handler.
The run status indicates if the event handler is processing events in its queue. When the method getRunStatus() returns EventHandlerStarted, the event handler is processing events. Use the methods startEventHandler() and stopEventHandler() control event processing.
|
get |
Gets the termination status of the event handler.
The termination status of an event handler can be used to determine when it is safe to delete. When the method getTerminationStatus() returns EventHandlerTerminated, it is safe to delete the event handler. Use the method terminate(...) to initiate the termination process.