XDispatch 0.6.1
Public Member Functions | Static Public Member Functions
xdispatch::source Class Reference

Provides a source implementation. More...

#include <xdispatch/source.h>

Inheritance diagram for xdispatch::source:

List of all members.

Public Member Functions

 source (sourcetype *)
 Creates a new source waiting for the given source type.
 ~source ()
void resume ()
 Resumes the invocation of operations or blocks assigned to the object.
void suspend ()
 Suspends the invocation of operations or blocks assigned to the object.
void handler (xdispatch::operation *)
 Sets the handler to dispatch each time the source becomes ready.
void handler (dispatch_block_t)
 Sets the handler to dispatch each time the source becomes ready.
void target_queue (const xdispatch::queue &)
 Sets the queue the handler will be executed on.
xdispatch::queue target_queue () const
virtual dispatch_object_t native () const
bool operator== (const object &)
bool operator== (const dispatch_object_t &)
bool operator!= (const object &)
bool operator!= (const dispatch_object_t &)

Static Public Member Functions

template<typename T >
static T data ()

Detailed Description

Provides a source implementation.

A dispatch source will wait for a specific ressource or operation (as defined by the given type) to complete and dispatch a given handler on completion.

Definition at line 152 of file source.h.


Constructor & Destructor Documentation

xdispatch::source::source ( sourcetype )

Creates a new source waiting for the given source type.

xdispatch::source::~source ( )

Member Function Documentation

template<typename T >
static T xdispatch::source::data ( ) [inline, static]
Returns:
the data that is associated with the currently dispatched and executed handler. The returned data is defined by the sourcetype used.

Pass the type of the data to retrieve as template parameter. If the requested datatype cannot be provided, a bad_cast exception will be thrown.

Remarks:
Calling this method from outside of a handler is undefined

Definition at line 198 of file source.h.

void xdispatch::source::handler ( dispatch_block_t  )

Sets the handler to dispatch each time the source becomes ready.

You can use data() to obtain a pointer to data provided by the source and possibly being the reason for the handler to be dispatched.

void xdispatch::source::handler ( xdispatch::operation )

Sets the handler to dispatch each time the source becomes ready.

You can use data() to obtain a pointer to data provided by the source and possibly being the reason for the handler to be dispatched.

virtual dispatch_object_t xdispatch::source::native ( ) const [virtual]
Returns:
the native dispatch_object_t associated with this source. This depends on the sourcetype used and will normally return NULL

Implements xdispatch::object.

bool xdispatch::object::operator!= ( const object ) [inherited]
bool xdispatch::object::operator!= ( const dispatch_object_t ) [inherited]
bool xdispatch::object::operator== ( const object ) [inherited]
bool xdispatch::object::operator== ( const dispatch_object_t ) [inherited]
void xdispatch::source::resume ( ) [virtual]

Resumes the invocation of operations or blocks assigned to the object.

Implements xdispatch::object.

void xdispatch::source::suspend ( ) [virtual]

Suspends the invocation of operations or blocks assigned to the object.

The object will be suspended as soon as the currently executed operation or block finished.

Remarks:
Calls to suspend() should be balanced with calls to resume() to continue an object

Implements xdispatch::object.

xdispatch::queue xdispatch::source::target_queue ( ) const
Returns:
the queue the handler will be executed on
void xdispatch::source::target_queue ( const xdispatch::queue )

Sets the queue the handler will be executed on.


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.