Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #ifndef XDISPATCH_GROUP_H_
00023 #define XDISPATCH_GROUP_H_
00024 
00025 #ifndef __XDISPATCH_INDIRECT__
00026 #error "Please #include <xdispatch/dispatch.h> instead of this file directly."
00027 #endif
00028 
00029 #include <iostream>
00030 
00031 __XDISPATCH_BEGIN_NAMESPACE
00032 
00043 class XDISPATCH_EXPORT group : public object {
00044 
00045 public:
00049     group();
00053     group(dispatch_group_t);
00054     group(const group&);
00055     ~group();
00056 
00062     void async(operation* r, const queue& q = global_queue());
00063 #ifdef XDISPATCH_HAS_BLOCKS
00064 
00068     void async(dispatch_block_t b, const queue& q = global_queue());
00069 #endif
00070 
00076     bool wait(dispatch_time_t = DISPATCH_TIME_FOREVER);
00083     bool wait(struct tm* t);
00096     void notify(operation* r, const queue& q = global_queue());
00097 #ifdef XDISPATCH_HAS_BLOCKS
00098 
00110     void notify(dispatch_block_t b, const queue& q = global_queue());
00111 #endif
00112 
00121     virtual void suspend();
00127     virtual void resume();
00133     dispatch_object_t native() const;
00134 
00135        group& operator=(const group&);
00136 
00137 private:
00138     class data;
00139     data* d;
00140 };
00141 
00142 XDISPATCH_EXPORT std::ostream& operator<<(std::ostream&, const group* );
00143 XDISPATCH_EXPORT std::ostream& operator<<(std::ostream&, const group& );
00144 
00145 __XDISPATCH_END_NAMESPACE
00146 
00147 #endif