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 "dispatch.h"
00031 #include <iostream>
00032
00033 __XDISPATCH_BEGIN_NAMESPACE
00034
00046 class XDISPATCH_EXPORT queue {
00047
00048 public:
00053 queue(dispatch_queue_t);
00058 queue(const char* label);
00059 queue(const std::string&);
00060 queue(const queue&);
00061 ~queue();
00062
00073 virtual void async(operation*);
00074 #ifdef XDISPATCH_HAS_BLOCKS
00075
00079 virtual void async(dispatch_block_t);
00080 #endif
00081
00093 virtual void apply(iteration_operation*, size_t times);
00094 #ifdef XDISPATCH_HAS_BLOCKS
00095
00103 virtual void apply(dispatch_iteration_block_t, size_t times);
00104 #endif
00105
00112 virtual void after(operation*, struct tm* time);
00113 virtual void after(operation*, dispatch_time_t time);
00114 #ifdef XDISPATCH_HAS_BLOCKS
00115
00120 virtual void after(dispatch_block_t, struct tm* time);
00121 virtual void after(dispatch_block_t, dispatch_time_t time);
00122 #endif
00123
00128 virtual void sync(operation*);
00129 #ifdef XDISPATCH_HAS_BLOCKS
00130
00135 virtual void sync(dispatch_block_t);
00136 #endif
00137
00147 virtual void set_finalizer(operation*, const queue& = global_queue());
00148 #ifdef XDISPATCH_HAS_BLOCKS
00149
00154 virtual void set_finalizer(dispatch_block_t, const queue& = global_queue());
00155 #endif
00156
00159 virtual const std::string label() const;
00169 virtual void suspend();
00175 virtual void resume();
00181 virtual const dispatch_queue_t native() const;
00182
00183 private:
00184 class data;
00185 data* d;
00186
00187 };
00188
00189 XDISPATCH_EXPORT std::ostream& operator<<(std::ostream& stream, const queue* q);
00190 XDISPATCH_EXPORT std::ostream& operator<<(std::ostream& stream, const queue& q);
00191
00192 bool operator ==(const queue& a, const queue& b);
00193 bool operator ==(const queue& a, const dispatch_queue_t& b);
00194 bool operator ==(const dispatch_queue_t& a, const queue& b);
00195
00196 __XDISPATCH_END_NAMESPACE
00197
00198 #endif