XDispatch 0.6.1
Public Slots | Public Member Functions
QDispatchQueue Class Reference

Provides an interface for representing a dispatch queue and methods that can be called to modify or use the queue. More...

#include <QtDispatch/qdispatchqueue.h>

Inheritance diagram for QDispatchQueue:

List of all members.

Public Slots

void suspend ()
 Suspends the invocation of work items on this queue.
void resume ()
 Resumes the invocation of work items on this queue.

Public Member Functions

 QDispatchQueue (const QString &label)
 QDispatchQueue (const char *)
 QDispatchQueue (dispatch_queue_t)
 QDispatchQueue (const xdispatch::queue &)
 QDispatchQueue (const QDispatchQueue &)
 ~QDispatchQueue ()
virtual void async (QRunnable *)
 Applies the given QRunnable for async execution in this queue and returns immediately.
virtual void apply (QIterationRunnable *, int times)
 Applies the given QRunnable for async execution in this queue and returns immediately.
virtual void after (QRunnable *, const QTime &time)
 Applies the given QRunnable for async execution in this queue after the given time and returns immediately.
virtual void after (QRunnable *, dispatch_time_t time)
virtual void after (dispatch_block_t, const QTime &time)
 Same as after().
virtual void sync (QRunnable *)
 Applies the given QRunnable for execution int his queue and blocks until the QRunnable was executed.
virtual void setFinalizer (QRunnable *, const xdispatch::queue &=xdispatch::global_queue())
 Sets the given runnable as finalizer for this queue.
virtual void setFinalizer (xdispatch::operation *, const xdispatch::queue &=xdispatch::global_queue())
virtual void setFinalizer (dispatch_block_t, const xdispatch::queue &=xdispatch::global_queue())
virtual void setTarget (const xdispatch::queue &)
 Sets the target queue of this queue, i.e.
QDispatchQueueoperator= (const QDispatchQueue &)
virtual void async (operation *)
 Will dispatch the given operation for async execution on the queue and return immediately.
virtual void async (dispatch_block_t)
 Same as async(operation*).
virtual void apply (iteration_operation *, size_t times)
 Applies the given iteration_operation for async execution in this queue and returns immediately.
virtual void apply (dispatch_iteration_block_t, size_t times)
 Same as apply(iteration_operation*, size_t times).
virtual void after (operation *, struct tm *time)
 Applies the given operation for async execution in this queue after the given time and returns immediately.
virtual void after (operation *, dispatch_time_t time)
virtual void after (dispatch_block_t, struct tm *time)
 Same as dispatch_after(operation*, time_t).
virtual void after (dispatch_block_t, dispatch_time_t time)
virtual void sync (operation *)
 Applies the given operation for execution in this queue and blocks until the operation was executed.
virtual void sync (dispatch_block_t)
 Same as dispatch_sync(operation*).
virtual void finalizer (operation *, const queue &=global_queue())
 Sets the given operation as finalizer for this queue.
virtual void finalizer (dispatch_block_t, const queue &=global_queue())
 Same as set_finalizer(operation*, queue*).
virtual const std::string label () const
virtual dispatch_object_t native () const
virtual void target_queue (const queue &)
 Sets the target queue of this queue, i.e.
bool operator== (const object &)
bool operator== (const dispatch_object_t &)
bool operator!= (const object &)
bool operator!= (const dispatch_object_t &)

Detailed Description

Provides an interface for representing a dispatch queue and methods that can be called to modify or use the queue.

Read Apple's documentation of libDispatch to understand the concept of tasks and queues.

See also:
QDispatch for creating QDispatchQueues

Definition at line 50 of file qdispatchqueue.h.


Constructor & Destructor Documentation

QDispatchQueue::QDispatchQueue ( const QString &  label)
QDispatchQueue::QDispatchQueue ( const char *  )
QDispatchQueue::QDispatchQueue ( dispatch_queue_t  )
QDispatchQueue::QDispatchQueue ( const xdispatch::queue )
QDispatchQueue::QDispatchQueue ( const QDispatchQueue )
QDispatchQueue::~QDispatchQueue ( )

Member Function Documentation

virtual void QDispatchQueue::after ( QRunnable *  ,
const QTime &  time 
) [virtual]

Applies the given QRunnable for async execution in this queue after the given time and returns immediately.

Parameters:
timeThe time to wait until the QRunnable is applied to the queue.
virtual void QDispatchQueue::after ( QRunnable *  ,
dispatch_time_t  time 
) [virtual]
virtual void xdispatch::queue::after ( operation ,
struct tm *  time 
) [virtual, inherited]

Applies the given operation for async execution in this queue after the given time and returns immediately.

The queue will take possession of the operation and handle the deletion. To change this behaviour, set the auto_delete flag of the operation.

See also:
operation::auto_delete();
Parameters:
timeThe time to wait until the operation is applied to the queue.
virtual void xdispatch::queue::after ( operation ,
dispatch_time_t  time 
) [virtual, inherited]
virtual void QDispatchQueue::after ( dispatch_block_t  ,
const QTime &  time 
) [virtual]

Same as after().

Will wrap the given block in a QRunnable and put it on the queue.

virtual void xdispatch::queue::after ( dispatch_block_t  ,
struct tm *  time 
) [virtual, inherited]

Same as dispatch_after(operation*, time_t).

Will wrap the given block in an operation and put it on the queue.

virtual void xdispatch::queue::after ( dispatch_block_t  ,
dispatch_time_t  time 
) [virtual, inherited]
virtual void xdispatch::queue::apply ( dispatch_iteration_block_t  ,
size_t  times 
) [virtual, inherited]

Same as apply(iteration_operation*, size_t times).

Will wrap the given block in an operation and put it on the queue.

See also:
apply(iteration_operation*, size_t times)
virtual void xdispatch::queue::apply ( iteration_operation ,
size_t  times 
) [virtual, inherited]

Applies the given iteration_operation for async execution in this queue and returns immediately.

The operation will be deleted as soon as it was executed the requested number of times. To change this behaviour, set the auto_delete flag of the operation.

See also:
operation::auto_delete()
Parameters:
timesThe number of times the operation will be executed
virtual void QDispatchQueue::apply ( QIterationRunnable ,
int  times 
) [virtual]

Applies the given QRunnable for async execution in this queue and returns immediately.

In case the autoDelete() flag of the passed QIterationRunnable is set to true it is ensured that the runnable will be deleted after being executed the requested number of times

Parameters:
timesThe number of times the QRunnable will be executed
virtual void QDispatchQueue::async ( QRunnable *  ) [virtual]

Applies the given QRunnable for async execution in this queue and returns immediately.

virtual void xdispatch::queue::async ( operation ) [virtual, inherited]

Will dispatch the given operation for async execution on the queue and return immediately.

The operation will be deleted as soon as it was executed. To change this behaviour, set the auto_delete flag of the operation.

See also:
operation::auto_delete()
virtual void xdispatch::queue::async ( dispatch_block_t  ) [virtual, inherited]

Same as async(operation*).

Will put the given block on the queue.

virtual void xdispatch::queue::finalizer ( operation ,
const queue = global_queue() 
) [virtual, inherited]

Sets the given operation as finalizer for this queue.

A finalizer is called before destroying a queue, i.e. if all queue objects representing the queue were deleted and all pending work on a queue was dispatched. The queue will take possession of the operation and handle the deletion. To change this behaviour, set the auto_delete flag of the operation.

See also:
operation::auto_delete();

When not passing a queue, the finalizer operation will be executed on the queue itself.

virtual void xdispatch::queue::finalizer ( dispatch_block_t  ,
const queue = global_queue() 
) [virtual, inherited]

Same as set_finalizer(operation*, queue*).

Will wrap the given block in an operation and store it as finalizer.

virtual const std::string xdispatch::queue::label ( ) const [virtual, inherited]
Returns:
The label of the queue that was used while creating it
virtual dispatch_object_t xdispatch::queue::native ( ) const [virtual, inherited]
Returns:
The dispatch_queue_t object associated with this C++ object. Use this, if you need to use the plain C Interface of libdispatch.

Implements xdispatch::object.

bool xdispatch::object::operator!= ( const dispatch_object_t ) [inherited]
bool xdispatch::object::operator!= ( const object ) [inherited]
QDispatchQueue& QDispatchQueue::operator= ( const QDispatchQueue )
bool xdispatch::object::operator== ( const dispatch_object_t ) [inherited]
bool xdispatch::object::operator== ( const object ) [inherited]
void QDispatchQueue::resume ( ) [virtual, slot]

Resumes the invocation of work items on this queue.

Calls to suspend() must be balanced with calls to resume().

Reimplemented from xdispatch::queue.

virtual void QDispatchQueue::setFinalizer ( QRunnable *  ,
const xdispatch::queue = xdispatch::global_queue() 
) [virtual]

Sets the given runnable as finalizer for this queue.

A finalizer is called before destroying a queue, i.e. if all QDispatchQueue objects representing the queue were deleted and all pending work on a queue was dispatched.

Remarks:
Finalizers will never be called on the global queues or the main queue.
virtual void QDispatchQueue::setFinalizer ( xdispatch::operation ,
const xdispatch::queue = xdispatch::global_queue() 
) [virtual]
virtual void QDispatchQueue::setFinalizer ( dispatch_block_t  ,
const xdispatch::queue = xdispatch::global_queue() 
) [virtual]
virtual void QDispatchQueue::setTarget ( const xdispatch::queue ) [virtual]

Sets the target queue of this queue, i.e.

the queue all items of this queue will be dispatched on in turn.

Remarks:
This has no effect on the global queues and the main queue.
void QDispatchQueue::suspend ( ) [virtual, slot]

Suspends the invocation of work items on this queue.

A suspended queue will not invoke any blocks associated with it. The suspension of a queue will occur after any running work item associated with the queue completes.

Calls to suspend() must be balanced with calls to resume().

Reimplemented from xdispatch::queue.

virtual void QDispatchQueue::sync ( QRunnable *  ) [virtual]

Applies the given QRunnable for execution int his queue and blocks until the QRunnable was executed.

virtual void xdispatch::queue::sync ( dispatch_block_t  ) [virtual, inherited]

Same as dispatch_sync(operation*).

Will wrap the given block in an operation and put it on the queue.

virtual void xdispatch::queue::sync ( operation ) [virtual, inherited]

Applies the given operation for execution in this queue and blocks until the operation was executed.

The queue will take possession of the operation and handle the deletion. To change this behaviour, set the auto_delete flag of the operation.

See also:
operation::auto_delete();
virtual void xdispatch::queue::target_queue ( const queue ) [virtual, inherited]

Sets the target queue of this queue, i.e.

the queue all items of this queue will be dispatched on in turn.

Remarks:
This has no effect on the global queues and the main queue.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Thu Apr 12 2012 09:50:43 for XDispatch by Doxygen 1.7.4
© 2010-2012 MLBA (about | privacy) All Rights reserved.