Provides a dispatch source. More...
|Suspends the source, i.e. |
|QDispatchSource (QDispatchSourceType *)|
|Creates a new source waiting for the given type. |
|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 b)|
|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. |
|template<typename T >|
|static T *||data ()|
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
Please note that this class is quite rudimentary currently. When needing sophisticated sources for dispatching, it is recommended to use xdispatch::source instead.
Creates a new source waiting for the given type.
The passed type will be deleted as soon as the source is deleted
|static T* QDispatchSource::data||(||)||
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::setHandler||(||QRunnable *||)|
Sets the given runnable as handler that will be executed each time the source has become ready.
Sets the target, i.e.
the queue the handler will be dispatched on. Defaults to QDispatch::globalQueue().