North State Framework in C#
V3.0.0
An object-oriented framework for implementing UML state machines.
|
Represents a timer thread. More...
Public Member Functions | |
NSFTimerThread (NSFString name) | |
Creates a timer thread. More... | |
bool | isScheduled (NSFTimerAction action) |
Checks if an action is scheduled. More... | |
void | scheduleAction (NSFTimerAction action) |
Schedules an action to execute at its previously designated execution time. More... | |
void | scheduleAction (NSFTimerAction action, NSFTime delayTime, NSFTime repeatTime) |
Schedules an action with the timer. More... | |
override void | terminate (bool waitForTerminated) |
Terminates the thread by causing the execution method to return. More... | |
void | unscheduleAction (NSFTimerAction action) |
Unschedules a previously scheduled action. 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< NSFContext > | TimeGapActions = new NSFVoidActions<NSFContext>() |
Actions to be executed whenever the timer encounters delay greater than MaxAllowableTimeGap in processing actions. More... | |
Public Attributes inherited from NSFThread | |
NSFVoidActions < NSFExceptionContext > | ExceptionActions = new NSFVoidActions<NSFExceptionContext>() |
Actions to execute if an exception is encountered while the thread is executing. More... | |
Protected Member Functions | |
override void | threadLoop () |
Implements the main timer processing loop. More... | |
Protected Member Functions inherited from NSFThread | |
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... | |
Properties | |
NSFTime | CurrentTime [get] |
Gets the current time. More... | |
int | MaxAllowableTimeGap [get, set] |
Gets or sets the maximum allowable delay the timer can see before firing the TimeGapActions. More... | |
NSFTime | MaxObservedTimeGap [get, set] |
Gets or sets the maximum observed delay in executing timer actions. More... | |
NSFOSTimer | Timer [get] |
Gets the underlying timer. More... | |
static NSFTimerThread | PrimaryTimerThread [get] |
Gets the primary timer thread of the North State Framework. More... | |
Properties inherited from NSFThread | |
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... | |
Protected Attributes inherited from NSFThread | |
object | threadMutex = new object() |
Represents a timer thread.
A timer thread contains a list of timer actions to execute at specified times.
NSFTimerThread | ( | NSFString | name | ) |
Creates a timer thread.
name | User specified name for timer. |
bool isScheduled | ( | NSFTimerAction | action | ) |
Checks if an action is scheduled.
action | The action in question. |
void scheduleAction | ( | NSFTimerAction | action | ) |
Schedules an action to execute at its previously designated execution time.
action | The action to schedule. |
void scheduleAction | ( | NSFTimerAction | action, |
NSFTime | delayTime, | ||
NSFTime | repeatTime | ||
) |
Schedules an action with the timer.
action | The action to schedule. |
delayTime | The delay time before the action should execute. |
repeatTime | The repeat time if the action is periodic, or 0 if the action is non-periodic. |
|
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 from NSFThread.
|
protectedvirtual |
Implements the main timer processing loop.
Implements NSFThread.
void unscheduleAction | ( | NSFTimerAction | action | ) |
Unschedules a previously scheduled action.
action | The action to unschedule. |
Unscheduling an action that is not currently scheduled has no effect.
NSFVoidActions<NSFContext> TimeGapActions = new NSFVoidActions<NSFContext>() |
Actions to be executed whenever the timer encounters delay greater than MaxAllowableTimeGap in processing actions.
In a well behaved system this event should not fire. It is provided for diagnostic purposes.
|
get |
Gets the current time.
|
getset |
Gets or sets the maximum allowable delay the timer can see before firing the TimeGapActions.
This property specifies the time in milli-seconds. Set to zero to disable.
|
getset |
Gets or sets the maximum observed delay in executing timer actions.
|
staticget |
Gets the primary timer thread of the North State Framework.
Although it is possible to create additional timers, this is very rare and should be carefully considered if it is necessary.
|
get |
Gets the underlying timer.