Home C-Bits Package Documentation Project Page

Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

cbits::CallbackTimer_WIN32 Class Reference

Win32 implementation of cbits::CallbackTimer class. More...

#include <CallbackTimer_WIN32.h>

Inheritance diagram for cbits::CallbackTimer_WIN32:

[legend]
Collaboration diagram for cbits::CallbackTimer_WIN32:
[legend]
List of all members.

Public Types

enum  Type { SINGLE = 1, PERIODIC = 2 }
 Timer types. More...


Public Methods

 CallbackTimer_WIN32 (const Type t, const long tm, CallbackTimerListener &cl)
 Constructor. More...

virtual ~CallbackTimer_WIN32 ()
 Destructor. More...

const bool start ()
 Start the timer. More...

const bool stop ()
 Stop the timer. More...

virtual void run ()
 Runnable implementation. More...

const bool isStopped () const
 Test if the timer is stopped or expired. More...

const Thread *const getThread () const
 Accessor for the cbits::Thread object that's executing this timer. More...


Static Public Methods

CallbackTimercreate (const Type t, const long tm, CallbackTimerListener &cl)
 Create a callback timer instance. More...


Protected Methods

virtual const bool impl_lock_obj () const
 Lock the object. More...

virtual const bool impl_unlock_obj () const
 Unlock the object. More...

virtual const bool impl_signal ()
 Abort the timer. More...

virtual const bool impl_wait (const long msec)
 Wait for the timer to expire. More...


Detailed Description

Win32 implementation of cbits::CallbackTimer class.


Member Enumeration Documentation

enum cbits::CallbackTimer::Type [inherited]
 

Timer types.

Enumeration values:
SINGLE  Execute one interval.
PERIODIC  Execute repeatedly.


Constructor & Destructor Documentation

CallbackTimer_WIN32::CallbackTimer_WIN32 const Type    t,
const long    tm,
CallbackTimerListener   cl
 

Constructor.

Parameters:
t  timer type
tm  timer interval
cl  callback

CallbackTimer_WIN32::~CallbackTimer_WIN32   [virtual]
 

Destructor.


Member Function Documentation

CallbackTimer * CallbackTimer::create const Type    t,
const long    tm,
CallbackTimerListener   cl
[static, inherited]
 

Create a callback timer instance.

Create an initialized timer. The timer must not 'run' until the start method is invoked.

Returns:
a new callback timer.
@raises CallbackTimerException if the timer can not be created.
Parameters:
t  Timer type.
tm  interval (msec)
cl  Callback object.

const Thread* const cbits::CallbackTimer::getThread   const [inline, inherited]
 

Accessor for the cbits::Thread object that's executing this timer.

const bool CallbackTimer_WIN32::impl_lock_obj   const [protected, virtual]
 

Lock the object.

The implementation should protect the object against concurrent access by, for instance, locking an instance-scoped mutex.

Returns:
true if the object was successfully locked; otherwise, false.

Implements cbits::CallbackTimer.

const bool CallbackTimer_WIN32::impl_signal   [protected, virtual]
 

Abort the timer.

The implementation must stop the timer, causing the impl_wait method to return with a value of false if the time interval has not expired.

Implements cbits::CallbackTimer.

const bool CallbackTimer_WIN32::impl_unlock_obj   const [protected, virtual]
 

Unlock the object.

The implementation should release the 'lock' that was acquired by the 'lock' method.

Implements cbits::CallbackTimer.

const bool CallbackTimer_WIN32::impl_wait const long    msec [protected, virtual]
 

Wait for the timer to expire.

The implementation must block the current thread for the time interval specified in the method call.

Parameters:
msec  the length of time to block the current thread.
Returns:
true if the time interval has expired, false for any other reason.

Implements cbits::CallbackTimer.

const bool CallbackTimer::isStopped   const [inherited]
 

Test if the timer is stopped or expired.

void CallbackTimer::run   [virtual, inherited]
 

Runnable implementation.

Not for client use.

Implements cbits::Runnable.

const bool CallbackTimer::start   [inherited]
 

Start the timer.

Returns:
true if the timer was successfully started; otherwise, false.

const bool CallbackTimer::stop   [inherited]
 

Stop the timer.

Returns:
true if the timer was stopped; otherwise, false.


The documentation for this class was generated from the following files:
Generated by
doxygen
Hosted by
SourceForge