libXDispatch 0.3.1
include/xdispatch/group.h
Go to the documentation of this file.
00001 /*
00002 * Copyright (c) 2011 MLBA. All rights reserved.
00003 *
00004 * @MLBA_OPEN_LICENSE_HEADER_START@
00005 *
00006 * Licensed under the Apache License, Version 2.0 (the "License");
00007 * you may not use this file except in compliance with the License.
00008 * You may obtain a copy of the License at
00009 *
00010 *     http://www.apache.org/licenses/LICENSE-2.0
00011 *
00012 * Unless required by applicable law or agreed to in writing, software
00013 * distributed under the License is distributed on an "AS IS" BASIS,
00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015 * See the License for the specific language governing permissions and
00016 * limitations under the License.
00017 *
00018 * @MLBA_OPEN_LICENSE_HEADER_END@
00019 */
00020 
00021 
00022 #ifndef XDISPATCH_GROUP_H_
00023 #define XDISPATCH_GROUP_H_
00024 
00025 #ifndef __XDISPATCH_INDIRECT__
00026 #error "Please #include <xdispatch/dispatch.h> instead of this file directly."
00027 #endif
00028 
00029 #include "dispatch.h"
00030 #include <iostream>
00031 
00032 __XDISPATCH_BEGIN_NAMESPACE
00033 
00044 class XDISPATCH_EXPORT group {
00045 
00046 public:
00050     group();
00054     group(dispatch_group_t);
00055     group(const group&);
00056     ~group();
00057 
00063     void async(operation* r, const queue& q = global_queue());
00064 #ifdef XDISPATCH_HAS_BLOCKS
00065 
00069     void async(dispatch_block_t b, const queue& q = global_queue());
00070 #endif
00071 
00077     bool wait(dispatch_time_t = DISPATCH_TIME_FOREVER);
00084     bool wait(struct tm* t);
00097     void notify(operation* r, const queue& q = global_queue());
00098 #ifdef XDISPATCH_HAS_BLOCKS
00099 
00111     void notify(dispatch_block_t b, const queue& q = global_queue());
00112 #endif
00113 
00118     const dispatch_group_t native() const;
00119 
00120 private:
00121     class data;
00122     data* d;
00123 };
00124 
00125 XDISPATCH_EXPORT std::ostream& operator<<(std::ostream& stream, const group* );
00126 XDISPATCH_EXPORT std::ostream& operator<<(std::ostream& stream, const group& );
00127 
00128 __XDISPATCH_END_NAMESPACE
00129 
00130 #endif /* XDISPATCH_GROUP_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.