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

Provides a dispatch source. More...

List of all members.

Public Slots

void resume ()
void suspend ()

Public Member Functions

 QDispatchSource (QDispatchSourceType *)
 Creates a new source waiting for the given type.
 ~QDispatchSource ()
void setHandler (QRunnable *)
 Sets the given runnable as handler that will be executed each time the source has become ready.
void setHandler (dispatch_block_t)
 Sets the given block as handler that will be executed each time the source has become ready.
QDispatchQueue targetQueue () const
void setTargetQueue (const QDispatchQueue &)
 Sets the target, i.e.

Static Public Member Functions

template<typename T >
static T * data ()

Detailed Description

Provides a dispatch source.

A dispatch source will wait for a specific ressource to become available or some other component to finish a current job and dispatch a specified handler upon completion.

The currently supported QDispatchSourceTypes are:

You can easily add your own by subclassing QDispatchSourceType


Constructor & Destructor Documentation

QDispatchSource::QDispatchSource ( QDispatchSourceType )

Creates a new source waiting for the given type.

The passed type will be deleted as soon as the source is deleted

QDispatchSource::~QDispatchSource ( )

Member Function Documentation

template<typename T >
static T* QDispatchSource::data ( ) [inline, static]
Returns:
the data associated to the current QDispatchSourceType. See the individual type documentations for details on the data available.

Pass the type of the data to retrieve as template parameter. A pointer of the given type will be returned, or NULL if the available data is not of the requested type.

Call this to obtain data from within a handler while executing. Calling this method from somewhere else than an executing handler is undefined.

void QDispatchSource::resume ( ) [slot]
void QDispatchSource::setHandler ( QRunnable *  )

Sets the given runnable as handler that will be executed each time the source has become ready.

See also:
data() and the source type's documentation on how to obtain information about the reason the source has become ready
void QDispatchSource::setHandler ( dispatch_block_t  )

Sets the given block as handler that will be executed each time the source has become ready.

See also:
data() and the source type's documentation on how to obtain information about the reason the source has become ready
void QDispatchSource::setTargetQueue ( const QDispatchQueue )

Sets the target, i.e.

the queue the handler will be dispatched on. Defaults to QDispatch::globalQueue().

void QDispatchSource::suspend ( ) [slot]
QDispatchQueue QDispatchSource::targetQueue ( ) const
Returns:
The queue the handler will be dispatched on. Defaults to QDispatch::globalQueue();

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.