XDispatch 0.7.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Typedefs | Enumerations | Functions | Variables
xdispatch Namespace Reference

Classes

struct  any
 Used for transferring data from a sourcetype to source::data without loosing typesafety. More...
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  block_iteration_operation
 A simple iteration operation needed when applying a block several times. More...
class  object
 The base class of all xdispatch classes. More...
class  group
 A group is a group of operations dispatched on queues. More...
class  once
 Provides a mean to execute some job exactly once during the lifetime of a programm and using multiple threads. More...
struct  pointer
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  sourcetype
 Declares an abstract source type. More...
class  native_source
 Constructs a sourcetype using a dispatch_source_t object as its main source. More...
class  source
 Provides a source implementation. 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...

Typedefs

typedef dispatch_time_t time
 Stores high resolution times used for timers and timeouts throughout xdispatch.

Enumerations

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

Functions

bool operator== (const dispatch_object_t &, const object &)
bool operator!= (const dispatch_object_t &, const object &)
queue main_queue ()
 Returns the main queue.
queue global_queue (queue_priority p=DEFAULT)
 Returns the global queue associated to the given Priority p.
queue current_queue ()
time as_dispatch_time (struct tm *)
dispatch_time_t as_native_dispatch_time (const time &t)
struct tm as_struct_tm (const time &t)
time as_delayed_time (uint64_t delay, time base=time_now)
void exec ()
 Enters the dispatching loop for the main thread.
std::ostream & operator<< (std::ostream &, const group *)
std::ostream & operator<< (std::ostream &, const group &)
std::ostream & operator<< (std::ostream &, const once *)
std::ostream & operator<< (std::ostream &, const once &)
std::ostream & operator<< (std::ostream &, const queue *)
std::ostream & operator<< (std::ostream &, const queue &)
std::ostream & operator<< (std::ostream &, const semaphore *)
std::ostream & operator<< (std::ostream &, const semaphore &)
bool operator== (const dispatch_semaphore_t &, const semaphore &)
bool operator!= (const dispatch_semaphore_t &, const semaphore &)
void init_semaphore_for_synclock (void *)
 XDISPATCH_DEPRECATED (synclock get_lock_for_key(const std::string &key))
 This function will be removed in future versions.
synclock get_lock_for_key (dispatch_semaphore_t sem)
synclock get_lock_for_key (synclock &s)

Variables

static const time time_now = DISPATCH_TIME_NOW
 A constant representing a time that will be elapsed immediately.
static const time time_forever = DISPATCH_TIME_FOREVER
 A constant representing infinite time, i.e.
static const uint64_t nsec_per_sec = NSEC_PER_SEC
 The number of nanoseconds per second.
static const uint64_t nsec_per_msec = NSEC_PER_MSEC
 The number of nanoseconds per millisecond.
static const uint64_t nsec_per_usec = NSEC_PER_USEC
 The number of nanoseconds per microsecond.
static const uint64_t usec_per_sec = USEC_PER_SEC
 The number of microseconds per second.

Typedef Documentation

Stores high resolution times used for timers and timeouts throughout xdispatch.

Definition at line 233 of file base.h.


Enumeration Type Documentation

Three priority classes used for the three standard global queues.

Enumerator:
HIGH 
DEFAULT 
LOW 

Definition at line 270 of file base.h.


Function Documentation

time xdispatch::as_delayed_time ( uint64_t  delay,
time  base = 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
time xdispatch::as_dispatch_time ( struct tm *  )
Returns:
The given tm converted to a time
Returns:
The given time converted to a dispatch time

Definition at line 302 of file base.h.

struct tm xdispatch::as_struct_tm ( const time &  t) [read]
Returns:
The given dispatch_time_t as time_t
Returns:
The queue the current operation is executed on.
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.

Remarks:
Applications that call dispatch_main(), NSApplicationMain(), NSApplicationMain() or call exec() on a QDispatchApplication object do not need to call this.
See also:
dispatch_main()
See also:
synchronized

Definition at line 90 of file synchronized.h.

synclock xdispatch::get_lock_for_key ( synclock &  s) [inline]
See also:
synchronized

Definition at line 94 of file synchronized.h.

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
See also:
synchronized

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
bool xdispatch::operator!= ( const dispatch_semaphore_t ,
const semaphore &   
)
bool xdispatch::operator!= ( const dispatch_object_t ,
const object &   
)
std::ostream& xdispatch::operator<< ( std::ostream &  ,
const once *   
)
std::ostream& xdispatch::operator<< ( std::ostream &  ,
const once &   
)
std::ostream& xdispatch::operator<< ( std::ostream &  ,
const semaphore *   
)
std::ostream& xdispatch::operator<< ( std::ostream &  ,
const semaphore &   
)
std::ostream& xdispatch::operator<< ( std::ostream &  ,
const group *   
)
std::ostream& xdispatch::operator<< ( std::ostream &  ,
const group &   
)
std::ostream& xdispatch::operator<< ( std::ostream &  ,
const queue *   
)
std::ostream& xdispatch::operator<< ( std::ostream &  ,
const queue &   
)
bool xdispatch::operator== ( const dispatch_semaphore_t ,
const semaphore &   
)
bool xdispatch::operator== ( const dispatch_object_t ,
const object &   
)
xdispatch::XDISPATCH_DEPRECATED ( synclock   get_lock_for_keyconst std::string &key)

This function will be removed in future versions.

Deprecated:
Please manage your synclock manually instead or use synchronized
See also:
synchronized

Variable Documentation

const uint64_t xdispatch::nsec_per_msec = NSEC_PER_MSEC [static]

The number of nanoseconds per millisecond.

Definition at line 257 of file base.h.

const uint64_t xdispatch::nsec_per_sec = NSEC_PER_SEC [static]

The number of nanoseconds per second.

Definition at line 253 of file base.h.

const uint64_t xdispatch::nsec_per_usec = NSEC_PER_USEC [static]

The number of nanoseconds per microsecond.

Definition at line 261 of file base.h.

A constant representing infinite time, i.e.

a timeout passed this value will never go by

Definition at line 249 of file base.h.

A constant representing a time that will be elapsed immediately.

Definition at line 244 of file base.h.

const uint64_t xdispatch::usec_per_sec = USEC_PER_SEC [static]

The number of microseconds per second.

Definition at line 265 of file base.h.


Generated on Tue Jun 12 2012 14:11:48 for XDispatch by Doxygen 1.8.0
© 2010-2012 MLBA (about | privacy) All Rights reserved.