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

Represents the interface for classes that can queue and handle events. More...

Inheritance diagram for INSFEventHandler:
INSFNamedObject NSFEventHandler NSFStateMachine

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...
 

Detailed Description

Represents the interface for classes that can queue and handle events.

Member Function Documentation

NSFEventStatus handleEvent ( NSFEvent  nsfEvent)

Handles an event.

Parameters
nsfEventThe event to handle.
Returns
Status indicating if the event was handled or not.

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.

Parameters
nsfEventThe event to queue.

Implemented in NSFStateMachine, and NSFEventHandler.

void queueEvent ( NSFEvent  nsfEvent,
INSFNamedObject  source 
)

Queues an event for the handler.

Parameters
nsfEventThe event to queue.
sourceThe 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.

Parameters
waitForTerminatedFlag 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.

Property Documentation

NSFEventHandlerRunStatus RunStatus
get

Gets the run status of the event handler.

Returns
The run status.

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.

NSFEventHandlerTerminationStatus TerminationStatus
get

Gets the termination status of the event handler.

Returns
The termination status.

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.




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