Provides an interface for representing a dispatch queue and methods that can be called to modify or use the queue. More...
Public Member Functions | |
queue (dispatch_queue_t) | |
Creates a new queue using the given dispatch_queue_t object. | |
queue (const char *label) | |
Creates a new serial queue featuring the given label. | |
queue (const std::string &) | |
queue (const queue &) | |
~queue () | |
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 | set_finalizer (operation *, const queue &=global_queue()) |
Sets the given operation as finalizer for this queue. | |
virtual void | set_finalizer (dispatch_block_t, const queue &=global_queue()) |
Same as set_finalizer(operation*, queue*). | |
virtual const std::string | label () const |
virtual void | suspend () |
Suspends the invocation of work items on this queue. | |
virtual void | resume () |
Resumes the invocation of work items on this queue. | |
virtual const dispatch_queue_t | native () const |
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.
xdispatch::queue::queue | ( | dispatch_queue_t | ) |
Creates a new queue using the given dispatch_queue_t object.
xdispatch::queue::queue | ( | const char * | label | ) |
Creates a new serial queue featuring the given label.
xdispatch::queue::queue | ( | const std::string & | ) |
xdispatch::queue::queue | ( | const queue & | ) |
xdispatch::queue::~queue | ( | ) |
virtual void xdispatch::queue::after | ( | operation * | , |
struct tm * | time | ||
) | [virtual] |
Applies the given operation for async execution in this queue after the given time and returns immediately.
time | The time to wait until the operation is applied to the queue. |
virtual void xdispatch::queue::after | ( | dispatch_block_t | , |
dispatch_time_t | time | ||
) | [virtual] |
virtual void xdispatch::queue::after | ( | operation * | , |
dispatch_time_t | time | ||
) | [virtual] |
virtual void xdispatch::queue::after | ( | dispatch_block_t | , |
struct tm * | time | ||
) | [virtual] |
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::apply | ( | iteration_operation * | , |
size_t | times | ||
) | [virtual] |
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.
times | The number of times the operation will be executed |
virtual void xdispatch::queue::apply | ( | dispatch_iteration_block_t | , |
size_t | times | ||
) | [virtual] |
Same as apply(iteration_operation*, size_t times).
Will wrap the given block in an operation and put it on the queue.
virtual void xdispatch::queue::async | ( | dispatch_block_t | ) | [virtual] |
Same as async(operation*).
Will put the given block on the queue.
virtual void xdispatch::queue::async | ( | operation * | ) | [virtual] |
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.
virtual const std::string xdispatch::queue::label | ( | ) | const [virtual] |
virtual const dispatch_queue_t xdispatch::queue::native | ( | ) | const [virtual] |
virtual void xdispatch::queue::resume | ( | ) | [virtual] |
virtual void xdispatch::queue::set_finalizer | ( | dispatch_block_t | , |
const queue & | = global_queue() |
||
) | [virtual] |
Same as set_finalizer(operation*, queue*).
Will wrap the given block in an operation and store it as finalizer.
virtual void xdispatch::queue::set_finalizer | ( | operation * | , |
const queue & | = global_queue() |
||
) | [virtual] |
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.
When not passing a queue, the finalizer operation will be executed on the queue itself.
virtual void xdispatch::queue::suspend | ( | ) | [virtual] |
virtual void xdispatch::queue::sync | ( | operation * | ) | [virtual] |
Applies the given operation for execution in this queue and blocks until the operation was executed.
virtual void xdispatch::queue::sync | ( | dispatch_block_t | ) | [virtual] |
Same as dispatch_sync(operation*).
Will wrap the given block in an operation and put it on the queue.