DVTk API
Thread Class
DVTkDvtkHighLevelInterface.Common.ThreadsThread
DVTk API

[This is preliminary documentation and is subject to change.]

This class contains the shared threading functionality of a DicomThread and Hl7Thread. To create a descendant class, do at least the following (DicomThread class may be used as an example): - Implement the StopCurrentThread method. - Implement the WriteError, WriteInformation and WriteWarning methods. - Implement the method ThreadEntryPoint. Within this method, the method Execute must be called. - Call the methods TriggerErrorOutputEvent, TriggerInformationOutputEvent and TriggerWarningOutputEvent whenever some Error, Information or Warning output is available (this is needed whenever some UserInface like the HliConsole or HliForm needs to be attached to the descendant class). The user of the descendant class on its turn at least needs to implement the Execute method.
Declaration Syntax
C#Visual BasicVisual C++
public abstract class Thread
Public MustInherit Class Thread
public ref class Thread abstract
Members
All MembersConstructorsMethodsPropertiesFieldsEvents



IconMemberDescription
Thread()()()
Initializes a new instance of the Thread class

AfterHandlingException(Exception)
Called after the HandleException method has been called.

alreadyInitializedErrorText
BeforeHandlingException(Exception)
Called before the HandleException method will be called.

childs
The child Threads.

ClearMessages()()()
Clears the list of received and send messages.

CurrentThread
Gets the current HLI Thread that is (indirectly) calling this property. If no HLI thread is (indirectly) calling this property, null is returned.

DetermineIdentifier()()()
Determines the Identifier (property of the Options of this Thread).

DetermineName()()()
Determines the Name of the instance.

DetermineResultsFileNameOnlyWithoutExtension()()()
DisplayException(Exception)
Displays information about an unhandled exception occuring in this instance.

dotNetThread
The .Net thread that performs the actual execution in a seperate thread.

Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Execute()()()
The actual test code should be placed in this overriden method.

Finalize()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetHashCode()()()
Serves as a hash function for a particular type. GetHashCode()()() is suitable for use in hashing algorithms and data structures like a hash table.
(Inherited from Object.)
GetType()()()
Gets the Type of the current instance.
(Inherited from Object.)
HandleExeption(Exception)
Handles an unhandled exception in the Execute method. When the Stop method (which also indirectly causes an exception) was not called, information about the exception will be logged in the results.

HasBeenStarted
Indicates if this Thread has been started.

hasExceptionOccured
See property HasExceptionOccured.

HasExceptionOccured
Indicates if an unhandled exception has occured during execution of the Thread.

Initialize(Thread)
Initializes this instance.

Initialize(ThreadManager)
Initializes this instance.

initialMillisecondsToWait
Initial number of milliseconds to wait before executing code in the thread.

isInitialized
Boolean indicating if one of the Initialize methods has already been called.

IsStopCalled
Indicates if the Stop method of this object has been called.

MemberwiseClone()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
messages
All messages that have been send or received. When needed, messages may be removed using the RemoveMessage or ClearMessages methods. When using this private field within this class, always lock the MessageLock of the ThreadManager first.

notInitializedErrorText
parent
The parent thread if existing. Otherwise null.

Parent
Gets the parent Thread.

RemoveMessage(Message)
Removes this message from the list of received and send messages.

ResultsGatheringStarted
Indicates if results gathering has started.

Sleep(Int32)
Makes the thread sleep for a specified number of milliseconds.

Start()()()
Starts the Thread without an initial number of milliseconds to wait.

Start(Int32)
Start the Thread and wait an initial number of milleseconds before executing the code that is defined in the overriden Execute method.

StartResultsGathering()()()
Starts the results gathering.

Stop()()()
Stops this object and all child threads.

StopCurrentThread()()()
A descendant class must override this method and do the following to stop the current thread only: - Terminate any open connecten (e.g. TCP/IP connection) - If that doesn't work, Abort the .netThread associated with this object. This method will be called in a seperate .Net thread (not in the .Net thread of this object). A seperate thread is used to make sure other threads are not waiting while this code is executed.

StopResultsGathering()()()
Stops the results gathering.

threadLock
Use this object to lock fields that may be accessed simultaniously by multiple .Net threads.

ThreadManager
Gets the ThreadManager that manages this Thread.

threadOptions
This field must be set by a descendant of this class,

ThreadState
Gets the current ThreadState of this object.

ThreadStateChangeEvent
This event is triggered whenever the ThreadState changes for this object.

TopmostThread
Gets the topmost Thread, considering the parent relation. If this thread does not have a parent, this object itself is the topmost thread.

ToString()()()
Returns a String that represents the current Object.
(Inherited from Object.)
TriggerErrorOutputEvent(String)
Call this method when this object should output an error. Must be called by a descendant of this class when some error output is available.

TriggerInformationOutputEvent(String)
Call this method when this object should output information. Must be called by a descendant of this class when some information output is available.

TriggerWarningOutputEvent(String)
Call this method when this object should output a warning. Must be called by a descendant of this class when some warning output is available.

WaitForCompletion()()()
Waits until this object has the ThreadState UnStarted or Stopped.

WaitForCompletionChildThreads()()()
Waits until all child Threads are either unstarted or stopped.

WriteError(String)
Writes an error text to the results and triggers an ErrorOutputEvent.

WriteErrorCurrentThread(String)
If called within a HLI Thread, calls the WriteError method of this Thread. Otherwise, writes the text to the console.

WriteInformation(String)
Writes an information text to the results and triggers an InformationOutputEvent.

WriteInformationCurrentThread(String)
If called within a HLI Thread, calls the WriteInformation method of this Thread. Otherwise, writes the text to the console.

WriteWarning(String)
Writes a warning text to the results and triggers a WarningOutputEvent.

WriteWarningCurrentThread(String)
If called within a HLI Thread, calls the WriteWarning method of this Thread. Otherwise, writes the text to the console.

Inheritance Hierarchy
Object
Thread
 DicomThread
 Hl7Thread

Assembly: DvtkHighLevelInterface (Module: DvtkHighLevelInterface) Version: 0.0.0.0