libXDispatch 0.4
include/xdispatch/queue.h
Go to the documentation of this file.
00001 
00002 /*
00003 * Copyright (c) 2011 MLBA. All rights reserved.
00004 *
00005 * @MLBA_OPEN_LICENSE_HEADER_START@
00006 *
00007 * Licensed under the Apache License, Version 2.0 (the "License");
00008 * you may not use this file except in compliance with the License.
00009 * You may obtain a copy of the License at
00010 *
00011 *     http://www.apache.org/licenses/LICENSE-2.0
00012 *
00013 * Unless required by applicable law or agreed to in writing, software
00014 * distributed under the License is distributed on an "AS IS" BASIS,
00015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016 * See the License for the specific language governing permissions and
00017 * limitations under the License.
00018 *
00019 * @MLBA_OPEN_LICENSE_HEADER_END@
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 /* XDISPATCH_QUEUE_H_ */

Generated on Wed Feb 22 2012 19:51:17 for libXDispatch by Doxygen 1.7.4
Content © 2011-2012 MLBA (about | privacy) – Design © 2010-2012 Emzeat. All Rights reserved.