libXDispatch 0.3.1
Public Member Functions
xdispatch::group Class Reference

A group is a group of operations dispatched on queues. More...

Inheritance diagram for xdispatch::group:

List of all members.

Public Member Functions

 group ()
 Creates a new group.
 group (dispatch_group_t)
 Creates a new group out of the existing dispatch_group_t.
 group (const group &)
 ~group ()
void async (operation *r, const queue &q=global_queue())
 Dispatches an operation on the given Queue.
void async (dispatch_block_t b, const queue &q=global_queue())
 Same as dispatch(operation* r, ...) Will wrap the given block in an operation and put it on the queue.
bool wait (dispatch_time_t=DISPATCH_TIME_FOREVER)
 Waits until the given time has passed or all dispatched operations in the group were executed.
bool wait (struct tm *t)
 Waits until the given time has passed or all dispatched operations in the group were executed.
void notify (operation *r, const queue &q=global_queue())
 This function schedules a notification operation to be submitted to the specified queue once all operations associated with the dispatch group have completed.
void notify (dispatch_block_t b, const queue &q=global_queue())
 This function schedules a notification block to be submitted to the specified queue once all blocks associated with the dispatch group have completed.
const dispatch_group_t native () const

Detailed Description

A group is a group of operations dispatched on queues.

This class provides a way to track all these operations and notify you if all of them finished executing.

See also Apple's Documentation of Dispatch Groups


Constructor & Destructor Documentation

xdispatch::group::group ( )

Creates a new group.

xdispatch::group::group ( dispatch_group_t  )

Creates a new group out of the existing dispatch_group_t.

xdispatch::group::group ( const group )
xdispatch::group::~group ( )

Member Function Documentation

void xdispatch::group::async ( operation r,
const queue q = global_queue() 
)

Dispatches an operation on the given Queue.

Parameters:
rThe operation to be dispatched
qThe Queue to use. If no Queue is given, the system default queue will be used

Reimplemented in QDispatchGroup.

void xdispatch::group::async ( dispatch_block_t  b,
const queue q = global_queue() 
)

Same as dispatch(operation* r, ...) Will wrap the given block in an operation and put it on the queue.

Reimplemented in QDispatchGroup.

const dispatch_group_t xdispatch::group::native ( ) const
Returns:
The dispatch_group_t object associated with this C++ object. Use this, if you need to use the plain C Interface of libdispatch.
void xdispatch::group::notify ( operation r,
const queue q = global_queue() 
)

This function schedules a notification operation to be submitted to the specified queue once all operations associated with the dispatch group have completed.

If no operations are associated with the dispatch group (i.e. the group is empty) then the notification operation will be submitted immediately.

The operation will be empty at the time the notification block is submitted to the target queue immediately. The group may either be deleted or reused for additional operations.

See also:
dispatch() for more information.

Reimplemented in QDispatchGroup.

void xdispatch::group::notify ( dispatch_block_t  b,
const queue q = global_queue() 
)

This function schedules a notification block to be submitted to the specified queue once all blocks associated with the dispatch group have completed.

If no blocks are associated with the dispatch group (i.e. the group is empty) then the notification block will be submitted immediately.

The group will be empty at the time the notification block is submitted to the target queue. The group may either be deleted or reused for additional operations.

See also:
dispatch() for more information.

Reimplemented in QDispatchGroup.

bool xdispatch::group::wait ( dispatch_time_t  = DISPATCH_TIME_FOREVER)

Waits until the given time has passed or all dispatched operations in the group were executed.

Parameters:
tgive a time here or a DISPATCH_TIME_FOREVER to wait until all operations are done
Returns:
false if the timeout occured or true if all operations were executed
bool xdispatch::group::wait ( struct tm *  t)

Waits until the given time has passed or all dispatched operations in the group were executed.

Parameters:
timeoutgive a timeout here
Returns:
false if the timeout occured or true if all operations were executed

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

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