libXDispatch 0.4
Classes | Enumerations | Functions | Variables
xdispatch Namespace Reference

Classes

class  operation
 An operation is a functor used to define single portions of work to be dispatched to a single queue. More...
class  iteration_operation
class  ptr_operation
 Provides a template functor to wrap a function pointer to a memberfunction of an object as operation. More...
class  ptr_iteration_operation
 Provides a template functor to wrap a function pointer to a memberfunction of an object as iteration_operation. More...
class  block_operation
 A simple operation for wrapping the given block as an xdispatch::operation. More...
class  group
 A group is a group of operations dispatched on queues. More...
class  queue
 Provides an interface for representing a dispatch queue and methods that can be called to modify or use the queue. More...
class  semaphore
 Wraps dispatch semaphores as provided by libDispatch. More...
class  synclock
 Provides an easy locking mechanism used to ensure the threadsafety of a code area. More...
class  timer
 Provides a timer executing a block or an operation on a specific queue when a timeout occurs. More...

Enumerations

enum  queue_priority { HIGH = 2, DEFAULT = 1, LOW = 0 }
 Three priority classes used for the three standard global queues. More...

Functions

XDISPATCH_EXPORT queue main_queue ()
 Returns the main queue.
XDISPATCH_EXPORT queue global_queue (queue_priority p=DEFAULT)
 Returns the global queue associated to the given Priority p.
XDISPATCH_EXPORT queue current_queue ()
XDISPATCH_EXPORT dispatch_time_t as_dispatch_time (struct tm *)
XDISPATCH_EXPORT struct tm as_struct_tm (dispatch_time_t t)
XDISPATCH_EXPORT dispatch_time_t as_delayed_time (uint64_t delay, dispatch_time_t base=DISPATCH_TIME_NOW)
XDISPATCH_EXPORT void exec ()
 Enters the dispatching loop for the main thread.
XDISPATCH_EXPORT std::ostream & operator<< (std::ostream &stream, const group *)
XDISPATCH_EXPORT std::ostream & operator<< (std::ostream &stream, const group &)
XDISPATCH_EXPORT std::ostream & operator<< (std::ostream &stream, const queue *q)
XDISPATCH_EXPORT std::ostream & operator<< (std::ostream &stream, const queue &q)
bool operator== (const queue &a, const queue &b)
bool operator== (const queue &a, const dispatch_queue_t &b)
bool operator== (const dispatch_queue_t &a, const queue &b)
XDISPATCH_EXPORT std::ostream & operator<< (std::ostream &stream, const semaphore *)
XDISPATCH_EXPORT std::ostream & operator<< (std::ostream &stream, const semaphore &)
XDISPATCH_EXPORT synclock get_lock_for_key (unsigned int key)
 Returns the synclock used to protect the area identified by the given key.
XDISPATCH_EXPORT std::ostream & operator<< (std::ostream &stream, const timer *)
XDISPATCH_EXPORT std::ostream & operator<< (std::ostream &stream, const timer &)

Variables

class XDISPATCH_EXPORT synclock

Enumeration Type Documentation

Three priority classes used for the three standard global queues.

Enumerator:
HIGH 
DEFAULT 
LOW 

Function Documentation

XDISPATCH_EXPORT dispatch_time_t xdispatch::as_delayed_time ( uint64_t  delay,
dispatch_time_t  base = DISPATCH_TIME_NOW 
)
Returns:
A dispatch_time_t representing the given delay
Parameters:
delayThe delay in nanoseconds
baseThe base to add the delay to, defaults to the current time
XDISPATCH_EXPORT dispatch_time_t xdispatch::as_dispatch_time ( struct tm *  )
Returns:
The given QTime converted to a dispatch_time_t
XDISPATCH_EXPORT struct tm xdispatch::as_struct_tm ( dispatch_time_t  t) [read]
Returns:
The given dispatch_time_t as time_t
XDISPATCH_EXPORT queue xdispatch::current_queue ( )
Returns:
The queue the current operation is executed on.
XDISPATCH_EXPORT void xdispatch::exec ( )

Enters the dispatching loop for the main thread.

Call this somewhere within the main thread to enable dispatching operations to the main queue. Will never return.

XDISPATCH_EXPORT synclock xdispatch::get_lock_for_key ( unsigned int  key)

Returns the synclock used to protect the area identified by the given key.

See also:
synchronized
XDISPATCH_EXPORT queue xdispatch::global_queue ( queue_priority  p = DEFAULT)

Returns the global queue associated to the given Priority p.

Runnables submitted to these global concurrent queues may be executed concurrently with respect to each other.

Remarks:
Never delete the returned queue!
Returns:
NULL if something went wrong
XDISPATCH_EXPORT queue xdispatch::main_queue ( )

Returns the main queue.

This is the queue running within the main thread. Thus normally only items put on this queue can change the GUI.

Remarks:
Never delete the returned queue!
Returns:
NULL if something went wrong
XDISPATCH_EXPORT std::ostream& xdispatch::operator<< ( std::ostream &  stream,
const semaphore *   
)
XDISPATCH_EXPORT std::ostream& xdispatch::operator<< ( std::ostream &  stream,
const queue q 
)
XDISPATCH_EXPORT std::ostream& xdispatch::operator<< ( std::ostream &  stream,
const queue q 
)
XDISPATCH_EXPORT std::ostream& xdispatch::operator<< ( std::ostream &  stream,
const group *   
)
XDISPATCH_EXPORT std::ostream& xdispatch::operator<< ( std::ostream &  stream,
const group &   
)
XDISPATCH_EXPORT std::ostream& xdispatch::operator<< ( std::ostream &  stream,
const timer &   
)
XDISPATCH_EXPORT std::ostream& xdispatch::operator<< ( std::ostream &  stream,
const timer *   
)
XDISPATCH_EXPORT std::ostream& xdispatch::operator<< ( std::ostream &  stream,
const semaphore &   
)
bool xdispatch::operator== ( const queue a,
const queue b 
)
bool xdispatch::operator== ( const queue a,
const dispatch_queue_t &  b 
)
bool xdispatch::operator== ( const dispatch_queue_t &  a,
const queue b 
)

Variable Documentation

class XDISPATCH_EXPORT xdispatch::synclock

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