North State Framework in C#
V3.0.0
An object-oriented framework for implementing UML state machines.
|
Represents the common framework thread functionality. More...
Public Member Functions | |
virtual void | terminate (bool waitForTerminated) |
Terminates the thread by causing the execution method to return. 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 < NSFExceptionContext > | ExceptionActions = new NSFVoidActions<NSFExceptionContext>() |
Actions to execute if an exception is encountered while the thread is executing. More... | |
Protected Member Functions | |
NSFThread (NSFString name) | |
Creates a thread. More... | |
NSFThread (NSFString name, int priority) | |
Creates an event thread. More... | |
void | handleException (Exception exception) |
Handles exceptions caught by main event processing loop. More... | |
void | startThread () |
Starts the thread by calling its execution action. More... | |
abstract void | threadLoop () |
Implements the main thread processing loop. More... | |
Protected Attributes | |
object | threadMutex = new object() |
Properties | |
NSFOSThread | OSThread [get, set] |
Gets the underlying OS thread. More... | |
NSFThreadTerminationStatus | TerminationStatus [get, set] |
Gets the thread termination status. More... | |
static uint | TerminationSleepTime [get, set] |
Gets the amount of time (mS) the terminate method sleeps between checks for thread termination. More... | |
static int | TerminationTimeout [get, set] |
The amount of time the terminate method will wait for event processing to complete. 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... | |
Represents the common framework thread functionality.
Creates a thread.
name | The name of the thread. |
The thread is created with medium priority. To change the priority, use the getOSThread() method to access the underlying thread object.
Creates an event thread.
name | The name of the thread. |
priority | The priority of the thread. |
|
protected |
Handles exceptions caught by main event processing loop.
exception | The exception caught. |
|
protected |
Starts the thread by calling its execution action.
|
virtual |
Terminates the thread by causing the execution method to return.
waitForTerminated | Flag indicating if the method should wait until the thread is terminated (true), or if it should return immediately (false). |
This method is useful to guarantee that a thread is no longer active, so that it can be garbage collected. If the waitForTerminated flag is set true, this method must not be called from its thread of execution.
Reimplemented in NSFEventThread, and NSFTimerThread.
|
protectedpure virtual |
Implements the main thread processing loop.
Implemented in NSFEventThread, and NSFTimerThread.
NSFVoidActions<NSFExceptionContext> ExceptionActions = new NSFVoidActions<NSFExceptionContext>() |
Actions to execute if an exception is encountered while the thread is executing.
|
protected |
|
getset |
Gets the underlying OS thread.
|
staticgetset |
Gets the amount of time (mS) the terminate method sleeps between checks for thread termination.
|
getset |
Gets the thread termination status.
|
staticgetset |
The amount of time the terminate method will wait for event processing to complete.