libXDispatch 0.6
Public Slots | Public Member Functions | Static Public Member Functions
QDispatchTimer Class Reference

Provides a timer executing a block or runnable each time it fires on a given queue. More...

Inheritance diagram for QDispatchTimer:

List of all members.

Public Slots

void start ()
 Starts the timer.
void stop ()
 Stops the timer.

Public Member Functions

 QDispatchTimer (int msec, QObject *parent=NULL)
 Constructs a new timer firing every msec milliseconds.
 QDispatchTimer (const QDispatchTimer &)
 QDispatchTimer (const xdispatch::timer &, QObject *parent=NULL)
 ~QDispatchTimer ()
void setInterval (int msec)
 Changes the interval of the timer to msec.
void setTargetQueue (const xdispatch::queue &)
 Sets the queue the timer will execute on.
void setHandler (QRunnable *)
 Sets the runnable that will be executed every time the timer fires.
void setHandler (dispatch_block_t)
 Sets a block that will be executed every time the timer fires.
void setLatency (int usec)
 Sets the latency, i.e.
bool operator== (const QDispatchTimer &)

Static Public Member Functions

static void singleShot (dispatch_time_t, const xdispatch::queue &, QRunnable *)
 Creates a single shot timer executing the given runnable on the given queue at the given time.
static void singleShot (const QTime &, const xdispatch::queue &, QRunnable *)
 Creates a single shot timer executing the given runnable on the given queue at the given time.
static void singleShot (dispatch_time_t, const xdispatch::queue &, dispatch_block_t)
 Creates a single shot timer executing the given block on the given queue at the given time.
static void singleShot (const QTime &, const xdispatch::queue &, dispatch_block_t)
 Creates a single shot timer executing the given block on the given queue at the given time.
static QDispatchTimercurrent ()

Detailed Description

Provides a timer executing a block or runnable each time it fires on a given queue.

The default queue for dispatch timers is the global queue.

The timer may have a divergence from the exact interval, the allowed size of this divergence can be influenced by using setLatency().


Constructor & Destructor Documentation

QDispatchTimer::QDispatchTimer ( int  msec,
QObject *  parent = NULL 
)

Constructs a new timer firing every msec milliseconds.

The timer will be constructed in a stopped state, use start() to launch it.

Remarks:
Never pass a value less than zero here
QDispatchTimer::QDispatchTimer ( const QDispatchTimer )
QDispatchTimer::QDispatchTimer ( const xdispatch::timer ,
QObject *  parent = NULL 
)
QDispatchTimer::~QDispatchTimer ( )

Member Function Documentation

static QDispatchTimer* QDispatchTimer::current ( ) [static]
Returns:
The timer responsible for the handler to be executed or NULL if the handler was not executed because of a timer firing

Reimplemented from xdispatch::timer.

bool QDispatchTimer::operator== ( const QDispatchTimer )
void QDispatchTimer::setHandler ( QRunnable *  )

Sets the runnable that will be executed every time the timer fires.

Returns:
The queue the handler will be executed on
void QDispatchTimer::setHandler ( dispatch_block_t  )

Sets a block that will be executed every time the timer fires.

void QDispatchTimer::setInterval ( int  msec)

Changes the interval of the timer to msec.

void QDispatchTimer::setLatency ( int  usec)

Sets the latency, i.e.

the divergence the timer may have. Please note that this can only be regarded as a hint and is not garuanted to be followed strictly.

void QDispatchTimer::setTargetQueue ( const xdispatch::queue )

Sets the queue the timer will execute on.

static void QDispatchTimer::singleShot ( const QTime &  ,
const xdispatch::queue ,
QRunnable *   
) [static]

Creates a single shot timer executing the given runnable on the given queue at the given time.

This is quite similar to using QDispatchQueue::after()

static void QDispatchTimer::singleShot ( dispatch_time_t  ,
const xdispatch::queue ,
dispatch_block_t   
) [static]

Creates a single shot timer executing the given block on the given queue at the given time.

This is quite similar to using QDispatchQueue::after()

static void QDispatchTimer::singleShot ( const QTime &  ,
const xdispatch::queue ,
dispatch_block_t   
) [static]

Creates a single shot timer executing the given block on the given queue at the given time.

This is quite similar to using QDispatchQueue::after()

static void QDispatchTimer::singleShot ( dispatch_time_t  ,
const xdispatch::queue ,
QRunnable *   
) [static]

Creates a single shot timer executing the given runnable on the given queue at the given time.

This is quite similar to using QDispatchQueue::after()

void QDispatchTimer::start ( ) [slot]

Starts the timer.

Remarks:
A new created timer will be stopped.

Reimplemented from xdispatch::timer.

void QDispatchTimer::stop ( ) [slot]

Stops the timer.

Remarks:
Calls to start() and stop() need to be balanced

Reimplemented from xdispatch::timer.


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

Generated on Wed Feb 22 2012 19:57:00 for libXDispatch by Doxygen 1.7.4
Content © 2011-2012 MLBA (about | privacy) – Design © 2010-2012 Emzeat. All Rights reserved.