Main Page   Namespace List   Class Hierarchy   Compound List   Compound Members  

ZThread::TimerThread Class Template Reference

#include <TimerThread.h>

Inheritance diagram for ZThread::TimerThread::

ZThread::Timer ZThread::Thread ZThread::Cancelable ZThread::Runnable ZThread::Observable ZThread::Runnable List of all members.

Public Methods

 TimerThread () throw (Synchronization_Exception)
virtual ~TimerThread () throw ()
virtual void cancel () throw (Synchronization_Exception)
virtual bool isCanceled () throw (Synchronization_Exception)
virtual void run () throw ()

Detailed Description

template<bool DAEMON> class ZThread::TimerThread

Author:
Eric Crahen
Version:
1.5.0
Date:
07-31-2001

This is a Timer object that is based on a Thread. This template can be used to manage the lifetime of the thread correctly. A static TimerThread should be labeled as a daemon thread using the parameter template. This is very similar to how the Executor templates work.

Also, like Executors, static TimerThreads do no need to be joined while a non-static or local TimerThread should be joined.


Constructor & Destructor Documentation

TimerThread ( ) throw (Synchronization_Exception) [inline]
 

Create a new TimerThread

~TimerThread ( ) throw () [inline, virtual]
 

Destroy this TimerThread


Member Function Documentation

void cancel ( ) throw (Synchronization_Exception) [inline, virtual]
 

Cancel the timer altogether. No further notifications are issued from the timer thread.

Exceptions:
Synchronization_Exception  

Reimplemented from ZThread::Cancelable.

bool isCanceled ( ) throw (Synchronization_Exception) [inline, virtual]
 

Check if the Timer has been Canceled

Returns:
bool - cancelation status
Exceptions:
Synchronization_Exception  

Reimplemented from ZThread::Cancelable.

void run ( ) throw () [inline, virtual]
 

Delegate to timer

Reimplemented from ZThread::Thread.


The documentation for this class was generated from the following file:
Generated at Fri Aug 31 09:08:03 2001 for ZThread by doxygen1.2.8 written by Dimitri van Heesch, © 1997-2001