XDispatch 0.6.1
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 : public object {
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 finalizer(operation*, const queue& = global_queue());
00157 #ifdef XDISPATCH_HAS_BLOCKS
00158 
00163     virtual void 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 dispatch_object_t native() const;
00197     virtual void target_queue(const queue&);
00198 
00199        queue& operator= (const queue&);
00200     
00201 private:
00202     class data;
00203     data* d;
00204 
00205 };
00206 
00207 XDISPATCH_EXPORT std::ostream& operator<<(std::ostream&, const queue*);
00208 XDISPATCH_EXPORT std::ostream& operator<<(std::ostream&, const queue&);
00209 
00210 __XDISPATCH_END_NAMESPACE
00211 
00212 #endif /* XDISPATCH_QUEUE_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Thu Apr 12 2012 09:50:43 for XDispatch by Doxygen 1.7.4
© 2010-2012 MLBA (about | privacy) All Rights reserved.