00001 /* 00002 * Copyright (c) 2011-2013 MLBA-Team. 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 00023 #ifndef QDISPATCH_H_ 00024 #define QDISPATCH_H_ 00025 00026 #include "qdispatchglobal.h" 00027 #include "qdispatchqueue.h" 00028 00034 QT_BEGIN_HEADER 00035 QT_BEGIN_NAMESPACE 00036 00037 class QDispatchQueue; 00038 class QTime; 00039 class QString; 00040 00041 QT_MODULE(Dispatch) 00042 00043 00054 class Q_DISPATCH_EXPORT QDispatch { 00055 00056 public: 00057 00062 static const xdispatch::time TimeNow = xdispatch::time_now; 00067 static const xdispatch::time TimeForever = xdispatch::time_forever; 00071 static const uint64_t NSecPerSec = xdispatch::nsec_per_sec; 00075 static const uint64_t NSecPerMSec = xdispatch::nsec_per_msec; 00079 static const uint64_t NSecPerUSec = xdispatch::nsec_per_usec; 00083 static const uint64_t USecPerSec = xdispatch::usec_per_sec; 00084 00089 enum Priority { HIGH, DEFAULT, LOW }; 00090 00096 static QDispatchQueue mainQueue(); 00105 static QDispatchQueue globalQueue(Priority p = DEFAULT); 00110 static QDispatchQueue currentQueue(); 00114 static xdispatch::time asDispatchTime(const QTime&); 00123 static QTime asQTime(const xdispatch::time& t); 00124 00125 private: 00126 QDispatch(); 00127 00128 }; 00129 00130 QT_END_NAMESPACE 00131 QT_END_HEADER 00132 00135 #endif /* QDISPATCH_H_ */