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
00023 #ifndef XDISPATCH_QUEUE_H_
00024 #define XDISPATCH_QUEUE_H_
00025
00026 #ifndef __XDISPATCH_INDIRECT__
00027 #error "Please #include <xdispatch/dispatch.h> instead of this file directly."
00028 #endif
00029
00030 #include <iostream>
00031
00032 __XDISPATCH_BEGIN_NAMESPACE
00033
00045 class XDISPATCH_EXPORT queue {
00046
00047 public:
00052 queue(dispatch_queue_t);
00057 queue(const char* label);
00058 queue(const std::string&);
00059 queue(const queue&);
00060 ~queue();
00061
00072 virtual void async(operation*);
00073 #ifdef XDISPATCH_HAS_BLOCKS
00074
00078 virtual void async(dispatch_block_t);
00079 #endif
00080
00092 virtual void apply(iteration_operation*, size_t times);
00093 #ifdef XDISPATCH_HAS_BLOCKS
00094
00102 virtual void apply(dispatch_iteration_block_t, size_t times);
00103 #endif
00104
00115 virtual void after(operation*, struct tm* time);
00116 virtual void after(operation*, dispatch_time_t time);
00117 #ifdef XDISPATCH_HAS_BLOCKS
00118
00123 virtual void after(dispatch_block_t, struct tm* time);
00124 virtual void after(dispatch_block_t, dispatch_time_t time);
00125 #endif
00126
00134 virtual void sync(operation*);
00135 #ifdef XDISPATCH_HAS_BLOCKS
00136
00141 virtual void sync(dispatch_block_t);
00142 #endif
00143
00156 virtual void set_finalizer(operation*, const queue& = global_queue());
00157 #ifdef XDISPATCH_HAS_BLOCKS
00158
00163 virtual void set_finalizer(dispatch_block_t, const queue& = global_queue());
00164 #endif
00165
00168 virtual const std::string label() const;
00178 virtual void suspend();
00184 virtual void resume();
00190 virtual const dispatch_queue_t native() const;
00191
00192 private:
00193 class data;
00194 data* d;
00195
00196 };
00197
00198 XDISPATCH_EXPORT std::ostream& operator<<(std::ostream& stream, const queue* q);
00199 XDISPATCH_EXPORT std::ostream& operator<<(std::ostream& stream, const queue& q);
00200
00201 bool operator ==(const queue& a, const queue& b);
00202 bool operator ==(const queue& a, const dispatch_queue_t& b);
00203 bool operator ==(const dispatch_queue_t& a, const queue& b);
00204
00205 __XDISPATCH_END_NAMESPACE
00206
00207 #endif