XDispatch 0.7.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Member Functions | Friends
xdispatch::once Class Reference

Provides a mean to execute some job exactly once during the lifetime of a programm and using multiple threads. More...

#include <xdispatch/once.h>

List of all members.

Classes

class  once_block

Public Member Functions

 once ()
 Creates a new once object, marked as not having been executed yet.
 once (dispatch_once_t *)
 Creates a new once object, the execution state is shared with the given dispatch_once_t object.
dispatch_once_tnative_once () const
void operator() (operation &)
 Executes the given operation when the once object has not executed any operation on before and on the current or any other thread.
void operator() (dispatch_block_t b)
 Similar to operator()(operation&)

Friends

std::ostream & operator<< (std::ostream &, const once &)

Detailed Description

Provides a mean to execute some job exactly once during the lifetime of a programm and using multiple threads.

This can be very handy when e.g. allocating resources.

See also:
dispatch_once

Definition at line 51 of file once.h.


Constructor & Destructor Documentation

Creates a new once object, marked as not having been executed yet.

Creates a new once object, the execution state is shared with the given dispatch_once_t object.


Member Function Documentation

Returns:
the native dispatch object associated to the xdispatch object
void xdispatch::once::operator() ( operation )

Executes the given operation when the once object has not executed any operation on before and on the current or any other thread.

Remarks:
In constrast to the other xdispatch classes, this method receives heap allocated operations and will not take posession of the operation
void xdispatch::once::operator() ( dispatch_block_t  b) [inline]

Similar to operator()(operation&)

Will wrap the given block as operation and try to execute it on the once object

See also:
operator()(operation&)

Definition at line 93 of file once.h.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const once  
) [friend]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Sun Oct 28 2012 22:12:47 for XDispatch by Doxygen 1.7.6.1
© 2010-2012 MLBA (about | privacy) All Rights reserved.