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_TIMER_H_
00024 #define XDISPATCH_TIMER_H_
00025 
00026 #ifndef __XDISPATCH_INDIRECT__
00027 #error "Please #include <xdispatch/dispatch.h> instead of this file directly."
00028 #endif
00029 
00030 __XDISPATCH_BEGIN_NAMESPACE
00031 
00041 class XDISPATCH_EXPORT timer : public object {
00042 
00043 public:
00051     timer(uint64_t interval, const xdispatch::queue& target = global_queue(), dispatch_time_t starting = DISPATCH_TIME_NOW);
00052     timer(const timer&);
00053     timer(dispatch_source_t);
00054     ~timer();
00055 
00061     void interval(uint64_t);
00067     void latency(uint64_t);
00074     void start();
00078        void resume();
00085     void stop();
00089        void suspend();
00096     void handler(xdispatch::operation*);
00097 #ifdef XDISPATCH_HAS_BLOCKS
00098 
00101     void handler(dispatch_block_t);
00102 #endif
00103 
00106     void target_queue(const xdispatch::queue&);
00110     xdispatch::queue target_queue();
00114     dispatch_object_t native() const;
00119     static timer* current();
00124     static void single_shot(dispatch_time_t, const xdispatch::queue&, xdispatch::operation*);
00129     static void single_shot(struct tm*, const xdispatch::queue&, xdispatch::operation*);
00130 #ifdef XDISPATCH_HAS_BLOCKS
00131 
00135     static void single_shot(dispatch_time_t, const xdispatch::queue&, dispatch_block_t);
00140     static void single_shot(struct tm*, const xdispatch::queue&, dispatch_block_t);
00141 #endif
00142 
00143     timer& operator =(const timer&);
00144 
00145 private:
00146     class data;
00147     data* d;
00148 
00149 };
00150 
00151 __XDISPATCH_END_NAMESPACE
00152 
00153 #endif