libXDispatch 0.3.1
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 "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 /* XDISPATCH_QUEUE_H_ */

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