FX::FXZeroedWait Class Reference

#include <QThread.h>

List of all members.


Detailed Description

A zero activated wait condition.

A very useful and commonly used form of wait condition is one combined with a count that signals when it reaches zero. You can think of it as similar to an inverse semaphore, but obviously it's not an exact fit because unlike semaphores there is no limit to the count.

By default, there is no checking of the count value for speed - however, you may enable checking for the count falling below zero. The exception is thrown with FXERRH_ISDEBUG and so is not language translated for the user's benefit.

Public Member Functions

 FXZeroedWait (int initcount=0)
 operator int () const
int operator= (int i)
int operator++ (int)
int operator++ ()
int operator+= (int i)
int operator-- (int)
int operator-- ()
int operator-= (int i)
bool wait (FXuint time=FXINFINITE)
void setChecks (bool d)


Constructor & Destructor Documentation

FX::FXZeroedWait::FXZeroedWait ( int  initcount = 0  )  [inline]

Constructs a FXZeroedWait with initial count initcount.


Member Function Documentation

FX::FXZeroedWait::operator int (  )  const [inline]

Returns the count.

int FX::FXZeroedWait::operator= ( int  i  )  [inline]

Sets the value of the count, which if zero frees any waiting threads.

int FX::FXZeroedWait::operator++ ( int   )  [inline]

Post-increments the count.

int FX::FXZeroedWait::operator++ (  )  [inline]

Pre-increments the count.

int FX::FXZeroedWait::operator+= ( int  i  )  [inline]

Increments the count by a given amount.

int FX::FXZeroedWait::operator-- ( int   )  [inline]

Post-decrements the count, which if zero frees any waiting threads.

int FX::FXZeroedWait::operator-- (  )  [inline]

Pre-decrements the count, which if zero frees any waiting threads.

int FX::FXZeroedWait::operator-= ( int  i  )  [inline]

Decrements the count by a given amount, which if zero frees any waiting threads.

bool FX::FXZeroedWait::wait ( FXuint  time = FXINFINITE  )  [inline]

Waits for the count to become zero, returning true if wait succeeds.

void FX::FXZeroedWait::setChecks ( bool  d  )  [inline]

Sets if run-time checks are performed on the count value.


The documentation for this class was generated from the following file:

(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 22:28:55 2008 for TnFOX by doxygen v1.5.6