diff options
Diffstat (limited to 'src/concurrent')
-rw-r--r-- | src/concurrent/qtconcurrentexception.h | 4 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentfilter.h | 59 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentfilterkernel.h | 4 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentfunctionwrappers.h | 6 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentiteratekernel.cpp | 50 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentiteratekernel.h | 4 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentmap.cpp | 40 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentmap.h | 50 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentmapkernel.h | 4 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentmedian.h | 4 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentreducekernel.h | 20 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentrun.cpp | 9 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentrun.h | 7 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentthreadengine.cpp | 2 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentthreadengine.h | 5 |
15 files changed, 129 insertions, 139 deletions
diff --git a/src/concurrent/qtconcurrentexception.h b/src/concurrent/qtconcurrentexception.h index 03dd7ec498..3ed4ac2cf5 100644 --- a/src/concurrent/qtconcurrentexception.h +++ b/src/concurrent/qtconcurrentexception.h @@ -42,7 +42,7 @@ #include <QtConcurrent/qtconcurrent_global.h> -#ifndef QT_NO_QFUTURE +#if !defined(QT_NO_QFUTURE) || defined(Q_CLANG_QDOC) #include <QtCore/qexception.h> @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE namespace QtConcurrent { -#ifndef QT_NO_EXCEPTIONS +#if !defined(QT_NO_EXCEPTIONS) || defined(Q_CLANG_QDOC) typedef Q_DECL_DEPRECATED QException Exception; typedef Q_DECL_DEPRECATED QUnhandledException UnhandledException; diff --git a/src/concurrent/qtconcurrentfilter.h b/src/concurrent/qtconcurrentfilter.h index 5f4148091e..acc794fad8 100644 --- a/src/concurrent/qtconcurrentfilter.h +++ b/src/concurrent/qtconcurrentfilter.h @@ -42,60 +42,13 @@ #include <QtConcurrent/qtconcurrent_global.h> -#ifndef QT_NO_CONCURRENT +#if !defined(QT_NO_CONCURRENT) || defined(Q_CLANG_QDOC) #include <QtConcurrent/qtconcurrentfilterkernel.h> #include <QtConcurrent/qtconcurrentfunctionwrappers.h> QT_BEGIN_NAMESPACE - -#ifdef Q_QDOC - -namespace QtConcurrent { - - QFuture<void> filter(Sequence &sequence, FilterFunction filterFunction); - - template <typename T> - QFuture<T> filtered(const Sequence &sequence, FilterFunction filterFunction); - template <typename T> - QFuture<T> filtered(ConstIterator begin, ConstIterator end, FilterFunction filterFunction); - - template <typename T> - QFuture<T> filteredReduced(const Sequence &sequence, - FilterFunction filterFunction, - ReduceFunction reduceFunction, - QtConcurrent::ReduceOptions reduceOptions = UnorderedReduce | SequentialReduce); - template <typename T> - QFuture<T> filteredReduced(ConstIterator begin, - ConstIterator end, - FilterFunction filterFunction, - ReduceFunction reduceFunction, - QtConcurrent::ReduceOptions reduceOptions = UnorderedReduce | SequentialReduce); - - void blockingFilter(Sequence &sequence, FilterFunction filterFunction); - - template <typename Sequence> - Sequence blockingFiltered(const Sequence &sequence, FilterFunction filterFunction); - template <typename Sequence> - Sequence blockingFiltered(ConstIterator begin, ConstIterator end, FilterFunction filterFunction); - - template <typename T> - T blockingFilteredReduced(const Sequence &sequence, - FilterFunction filterFunction, - ReduceFunction reduceFunction, - QtConcurrent::ReduceOptions reduceOptions = UnorderedReduce | SequentialReduce); - template <typename T> - T blockingFilteredReduced(ConstIterator begin, - ConstIterator end, - FilterFunction filterFunction, - ReduceFunction reduceFunction, - QtConcurrent::ReduceOptions reduceOptions = UnorderedReduce | SequentialReduce); - -} // namespace QtConcurrent - -#else - namespace QtConcurrent { //! [QtConcurrent-1] @@ -123,6 +76,7 @@ QFuture<ResultType> filteredReduced(const Sequence &sequence, return startFilteredReduced<ResultType>(sequence, QtPrivate::createFunctionWrapper(keep), QtPrivate::createFunctionWrapper(reduce), options); } +#ifndef Q_CLANG_QDOC template <typename Sequence, typename KeepFunctor, typename ReduceFunctor> QFuture<typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType> filteredReduced(const Sequence &sequence, KeepFunctor keep, @@ -135,6 +89,7 @@ QFuture<typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType> filtere QtPrivate::createFunctionWrapper(reduce), options); } +#endif // filteredReduced() on iterators template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor> @@ -147,6 +102,7 @@ QFuture<ResultType> filteredReduced(Iterator begin, return startFilteredReduced<ResultType>(begin, end, QtPrivate::createFunctionWrapper(keep), QtPrivate::createFunctionWrapper(reduce), options); } +#ifndef Q_CLANG_QDOC template <typename Iterator, typename KeepFunctor, typename ReduceFunctor> QFuture<typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType> filteredReduced(Iterator begin, Iterator end, @@ -160,6 +116,7 @@ QFuture<typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType> filtere QtPrivate::createFunctionWrapper(reduce), options); } +#endif // filtered() on sequences template <typename Sequence, typename KeepFunctor> @@ -193,6 +150,7 @@ ResultType blockingFilteredReduced(const Sequence &sequence, .startBlocking(); } +#ifndef Q_CLANG_QDOC template <typename Sequence, typename KeepFunctor, typename ReduceFunctor> typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType blockingFilteredReduced(const Sequence &sequence, KeepFunctor keep, @@ -205,6 +163,7 @@ typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType blockingFiltered QtPrivate::createFunctionWrapper(reduce), options); } +#endif // blocking filteredReduced() on iterators template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor> @@ -222,6 +181,7 @@ ResultType blockingFilteredReduced(Iterator begin, .startBlocking(); } +#ifndef Q_CLANG_QDOC template <typename Iterator, typename KeepFunctor, typename ReduceFunctor> typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType blockingFilteredReduced(Iterator begin, Iterator end, @@ -236,6 +196,7 @@ typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType blockingFiltered options) .startBlocking(); } +#endif // blocking filtered() on sequences template <typename Sequence, typename KeepFunctor> @@ -256,8 +217,6 @@ OutputSequence blockingFiltered(Iterator begin, Iterator end, KeepFunctor keep) } // namespace QtConcurrent -#endif // Q_QDOC - QT_END_NAMESPACE #endif // QT_NO_CONCURRENT diff --git a/src/concurrent/qtconcurrentfilterkernel.h b/src/concurrent/qtconcurrentfilterkernel.h index 4500bd4f8a..4ef5ac0cee 100644 --- a/src/concurrent/qtconcurrentfilterkernel.h +++ b/src/concurrent/qtconcurrentfilterkernel.h @@ -42,7 +42,7 @@ #include <QtConcurrent/qtconcurrent_global.h> -#ifndef QT_NO_CONCURRENT +#if !defined(QT_NO_CONCURRENT) || defined (Q_CLANG_QDOC) #include <QtConcurrent/qtconcurrentiteratekernel.h> #include <QtConcurrent/qtconcurrentmapkernel.h> @@ -51,7 +51,6 @@ QT_BEGIN_NAMESPACE -#ifndef Q_QDOC namespace QtConcurrent { @@ -341,7 +340,6 @@ inline ThreadEngineStarter<ResultType> startFilteredReduced(Iterator begin, Iter } // namespace QtConcurrent -#endif // Q_QDOC QT_END_NAMESPACE diff --git a/src/concurrent/qtconcurrentfunctionwrappers.h b/src/concurrent/qtconcurrentfunctionwrappers.h index 111933410b..0f9eb46999 100644 --- a/src/concurrent/qtconcurrentfunctionwrappers.h +++ b/src/concurrent/qtconcurrentfunctionwrappers.h @@ -43,13 +43,10 @@ #include <QtConcurrent/qtconcurrentcompilertest.h> #include <QtCore/QStringList> -#ifndef QT_NO_CONCURRENT +#if !defined(QT_NO_CONCURRENT) || defined(Q_CLANG_QDOC) QT_BEGIN_NAMESPACE - -#ifndef Q_QDOC - namespace QtConcurrent { template <typename T> @@ -375,7 +372,6 @@ struct MapResultType<QStringList, U(C::*)() const noexcept> } // namespace QtPrivate. -#endif //Q_QDOC QT_END_NAMESPACE diff --git a/src/concurrent/qtconcurrentiteratekernel.cpp b/src/concurrent/qtconcurrentiteratekernel.cpp index 52218f794b..11bdb7e8cd 100644 --- a/src/concurrent/qtconcurrentiteratekernel.cpp +++ b/src/concurrent/qtconcurrentiteratekernel.cpp @@ -43,7 +43,7 @@ #include "private/qfunctions_p.h" -#ifndef QT_NO_CONCURRENT +#if !defined(QT_NO_CONCURRENT) || defined(Q_CLANG_QDOC) QT_BEGIN_NAMESPACE @@ -64,6 +64,54 @@ static double elapsed(qint64 after, qint64 before) namespace QtConcurrent { +/*! + \class QtConcurrent::Median + \inmodule QtConcurrent + \internal + */ + +/*! + \class QtConcurrent::MedianDouble + \inmodule QtConcurrent + \internal + */ + +/*! + \class QtConcurrent::BlockSizeManager + \inmodule QtConcurrent + \internal + */ + +/*! + \class QtConcurrent::BlockSizeManagerV2 + \inmodule QtConcurrent + \internal + */ + +/*! + \class QtConcurrent::ResultReporter + \inmodule QtConcurrent + \internal + */ + +/*! \fn bool QtConcurrent::selectIteration(std::bidirectional_iterator_tag) + \internal + */ + +/*! \fn bool QtConcurrent::selectIteration(std::forward_iterator_tag) + \internal + */ + +/*! \fn bool QtConcurrent::selectIteration(std::random_access_iterator_tag) + \internal + */ + +/*! + \class QtConcurrent::IterateKernel + \inmodule QtConcurrent + \internal + */ + /*! \internal */ diff --git a/src/concurrent/qtconcurrentiteratekernel.h b/src/concurrent/qtconcurrentiteratekernel.h index 082fa9e838..b543833776 100644 --- a/src/concurrent/qtconcurrentiteratekernel.h +++ b/src/concurrent/qtconcurrentiteratekernel.h @@ -42,7 +42,7 @@ #include <QtConcurrent/qtconcurrent_global.h> -#ifndef QT_NO_CONCURRENT +#if !defined(QT_NO_CONCURRENT) || defined(Q_CLANG_QDOC) #include <QtCore/qatomic.h> #include <QtConcurrent/qtconcurrentmedian.h> @@ -53,7 +53,6 @@ QT_BEGIN_NAMESPACE -#ifndef Q_QDOC namespace QtConcurrent { @@ -323,7 +322,6 @@ public: } // namespace QtConcurrent -#endif //Q_QDOC QT_END_NAMESPACE diff --git a/src/concurrent/qtconcurrentmap.cpp b/src/concurrent/qtconcurrentmap.cpp index 9c01b65611..a8f1d6496e 100644 --- a/src/concurrent/qtconcurrentmap.cpp +++ b/src/concurrent/qtconcurrentmap.cpp @@ -386,8 +386,8 @@ /*! \fn template <typename OutputSequence, typename InputSequence, typename MapFunctor> OutputSequence QtConcurrent::blockingMapped(const InputSequence &sequence, MapFunctor function) - Calls \a function once for each item in \a sequence and returns a Sequence containing - the results. The type of the results will match the type returned my the MapFunction. + Calls \a function once for each item in \a sequence and returns an OutputSequence containing + the results. The type of the results will match the type returned my the MapFunctor. \note This function will block until all items in the sequence have been processed. @@ -441,3 +441,39 @@ \sa blockingMappedReduced(), {Concurrent Map and Map-Reduce} */ + +/*! + \class QtConcurrent::FunctionWrapper0 + \inmodule QtConcurrent + \internal +*/ + +/*! + \class QtConcurrent::FunctionWrapper1 + \inmodule QtConcurrent + \internal +*/ + +/*! + \class QtConcurrent::FunctionWrapper2 + \inmodule QtConcurrent + \internal +*/ + +/*! + \class QtConcurrent::MemberFunctionWrapper + \inmodule QtConcurrent + \internal +*/ + +/*! + \class QtConcurrent::MemberFunctionWrapper1 + \inmodule QtConcurrent + \internal +*/ + +/*! + \class QtConcurrent::ConstMemberFunctionWrapper + \inmodule QtConcurrent + \internal +*/ diff --git a/src/concurrent/qtconcurrentmap.h b/src/concurrent/qtconcurrentmap.h index f8acf31f1d..ed1f7cedd1 100644 --- a/src/concurrent/qtconcurrentmap.h +++ b/src/concurrent/qtconcurrentmap.h @@ -42,7 +42,7 @@ #include <QtConcurrent/qtconcurrent_global.h> -#ifndef QT_NO_CONCURRENT +#if !defined(QT_NO_CONCURRENT) || defined(Q_CLANG_QDOC) #include <QtConcurrent/qtconcurrentmapkernel.h> #include <QtConcurrent/qtconcurrentreducekernel.h> @@ -52,53 +52,6 @@ QT_BEGIN_NAMESPACE -#ifdef Q_QDOC - -namespace QtConcurrent { - - QFuture<void> map(Sequence &sequence, MapFunction function); - QFuture<void> map(Iterator begin, Iterator end, MapFunction function); - - template <typename T> - QFuture<T> mapped(const Sequence &sequence, MapFunction function); - template <typename T> - QFuture<T> mapped(ConstIterator begin, ConstIterator end, MapFunction function); - - template <typename T> - QFuture<T> mappedReduced(const Sequence &sequence, - MapFunction function, - ReduceFunction function, - QtConcurrent::ReduceOptions options = UnorderedReduce | SequentialReduce); - template <typename T> - QFuture<T> mappedReduced(ConstIterator begin, - ConstIterator end, - MapFunction function, - ReduceFunction function, - QtConcurrent::ReduceOptions options = UnorderedReduce | SequentialReduce); - - void blockingMap(Sequence &sequence, MapFunction function); - void blockingMap(Iterator begin, Iterator end, MapFunction function); - - template <typename T> - T blockingMapped(const Sequence &sequence, MapFunction function); - template <typename T> - T blockingMapped(ConstIterator begin, ConstIterator end, MapFunction function); - - template <typename T> - T blockingMappedReduced(const Sequence &sequence, - MapFunction function, - ReduceFunction function, - QtConcurrent::ReduceOptions options = UnorderedReduce | SequentialReduce); - template <typename T> - T blockingMappedReduced(ConstIterator begin, - ConstIterator end, - MapFunction function, - ReduceFunction function, - QtConcurrent::ReduceOptions options = UnorderedReduce | SequentialReduce); - -} // namespace QtConcurrent - -#else namespace QtConcurrent { @@ -306,7 +259,6 @@ typename QtPrivate::MapResultType<Iterator, MapFunctor>::ResultType blockingMapp } // namespace QtConcurrent -#endif // Q_QDOC QT_END_NAMESPACE diff --git a/src/concurrent/qtconcurrentmapkernel.h b/src/concurrent/qtconcurrentmapkernel.h index 26e755c819..e8df668791 100644 --- a/src/concurrent/qtconcurrentmapkernel.h +++ b/src/concurrent/qtconcurrentmapkernel.h @@ -42,7 +42,7 @@ #include <QtConcurrent/qtconcurrent_global.h> -#ifndef QT_NO_CONCURRENT +#if !defined(QT_NO_CONCURRENT) || defined (Q_CLANG_QDOC) #include <QtConcurrent/qtconcurrentiteratekernel.h> #include <QtConcurrent/qtconcurrentreducekernel.h> @@ -50,7 +50,6 @@ QT_BEGIN_NAMESPACE -#ifndef Q_QDOC namespace QtConcurrent { // map kernel, works with both parallel-for and parallel-while @@ -264,7 +263,6 @@ inline ThreadEngineStarter<ResultType> startMappedReduced(Iterator begin, Iterat } // namespace QtConcurrent -#endif //Q_QDOC QT_END_NAMESPACE diff --git a/src/concurrent/qtconcurrentmedian.h b/src/concurrent/qtconcurrentmedian.h index d0f832812c..87e6b2935d 100644 --- a/src/concurrent/qtconcurrentmedian.h +++ b/src/concurrent/qtconcurrentmedian.h @@ -42,7 +42,7 @@ #include <QtConcurrent/qtconcurrent_global.h> -#ifndef QT_NO_CONCURRENT +#if !defined(QT_NO_CONCURRENT) ||defined(Q_CLANG_QDOC) #include <QtCore/qvector.h> @@ -51,7 +51,6 @@ QT_BEGIN_NAMESPACE -#ifndef Q_QDOC namespace QtConcurrent { @@ -195,7 +194,6 @@ private: } // namespace QtConcurrent -#endif //Q_QDOC QT_END_NAMESPACE diff --git a/src/concurrent/qtconcurrentreducekernel.h b/src/concurrent/qtconcurrentreducekernel.h index c5003a2a0e..d1a283eb53 100644 --- a/src/concurrent/qtconcurrentreducekernel.h +++ b/src/concurrent/qtconcurrentreducekernel.h @@ -42,7 +42,7 @@ #include <QtConcurrent/qtconcurrent_global.h> -#ifndef QT_NO_CONCURRENT +#if !defined(QT_NO_CONCURRENT) || defined(Q_CLANG_QDOC) #include <QtCore/qatomic.h> #include <QtCore/qlist.h> @@ -57,8 +57,6 @@ QT_BEGIN_NAMESPACE namespace QtConcurrent { -#ifndef Q_QDOC - /* The ReduceQueueStartLimit and ReduceQueueThrottleLimit constants limit the reduce queue size for MapReduce. When the number of @@ -66,10 +64,17 @@ namespace QtConcurrent { MapReduce won't start any new threads, and when it exceeds ReduceQueueThrottleLimit running threads will be stopped. */ +#ifdef Q_CLANG_QDOC +enum ReduceQueueLimits { + ReduceQueueStartLimit = 20, + ReduceQueueThrottleLimit = 30 +}; +#else enum { ReduceQueueStartLimit = 20, ReduceQueueThrottleLimit = 30 }; +#endif // IntermediateResults holds a block of intermediate results from a // map or filter functor. The begin/end offsets indicates the origin @@ -82,8 +87,6 @@ public: QVector<T> vector; }; -#endif // Q_QDOC - enum ReduceOption { UnorderedReduce = 0x1, OrderedReduce = 0x2, @@ -91,10 +94,9 @@ enum ReduceOption { // ParallelReduce = 0x8 }; Q_DECLARE_FLAGS(ReduceOptions, ReduceOption) +#ifndef Q_CLANG_QDOC Q_DECLARE_OPERATORS_FOR_FLAGS(ReduceOptions) - -#ifndef Q_QDOC - +#endif // supports both ordered and out-of-order reduction template <typename ReduceFunctor, typename ReduceResultType, typename T> class ReduceKernel @@ -239,8 +241,6 @@ struct SequenceHolder2 : public Base } }; -#endif //Q_QDOC - } // namespace QtConcurrent QT_END_NAMESPACE diff --git a/src/concurrent/qtconcurrentrun.cpp b/src/concurrent/qtconcurrentrun.cpp index 1d8f7afe85..e2e3b3f3af 100644 --- a/src/concurrent/qtconcurrentrun.cpp +++ b/src/concurrent/qtconcurrentrun.cpp @@ -115,6 +115,15 @@ */ /*! + \typedef Function + \internal + + This typedef is a dummy required to make the \c Function + type name known so that clang doesn't reject functions + that use it. +*/ + +/*! \fn QFuture<T> QtConcurrent::run(Function function, ...); Equivalent to diff --git a/src/concurrent/qtconcurrentrun.h b/src/concurrent/qtconcurrentrun.h index c0c0e66913..7963294ebf 100644 --- a/src/concurrent/qtconcurrentrun.h +++ b/src/concurrent/qtconcurrentrun.h @@ -43,15 +43,16 @@ #include <QtConcurrent/qtconcurrentcompilertest.h> -#ifndef QT_NO_CONCURRENT +#if !defined(QT_NO_CONCURRENT) || defined(Q_CLANG_QDOC) #include <QtConcurrent/qtconcurrentrunbase.h> #include <QtConcurrent/qtconcurrentstoredfunctioncall.h> QT_BEGIN_NAMESPACE +#ifdef Q_CLANG_QDOC -#ifdef Q_QDOC +typedef int Function; namespace QtConcurrent { @@ -919,7 +920,7 @@ QFuture<T> run(QThreadPool *pool, const Class *object, T (Class::*fn)(Param1, Pa } //namespace QtConcurrent -#endif // Q_QDOC +#endif // Q_CLANG_QDOC QT_END_NAMESPACE diff --git a/src/concurrent/qtconcurrentthreadengine.cpp b/src/concurrent/qtconcurrentthreadengine.cpp index 2e27e0e83c..8d6bd0efb2 100644 --- a/src/concurrent/qtconcurrentthreadengine.cpp +++ b/src/concurrent/qtconcurrentthreadengine.cpp @@ -39,7 +39,7 @@ #include "qtconcurrentthreadengine.h" -#ifndef QT_NO_CONCURRENT +#if !defined(QT_NO_CONCURRENT) || defined(Q_CLANG_QDOC) QT_BEGIN_NAMESPACE diff --git a/src/concurrent/qtconcurrentthreadengine.h b/src/concurrent/qtconcurrentthreadengine.h index 0941f559f2..69e42018e6 100644 --- a/src/concurrent/qtconcurrentthreadengine.h +++ b/src/concurrent/qtconcurrentthreadengine.h @@ -42,7 +42,7 @@ #include <QtConcurrent/qtconcurrent_global.h> -#ifndef QT_NO_CONCURRENT +#if !defined(QT_NO_CONCURRENT) ||defined(Q_CLANG_QDOC) #include <QtCore/qthreadpool.h> #include <QtCore/qfuture.h> @@ -55,8 +55,6 @@ QT_BEGIN_NAMESPACE -#ifndef Q_QDOC - namespace QtConcurrent { // The ThreadEngineBarrier counts worker threads, and allows one @@ -268,7 +266,6 @@ inline ThreadEngineStarter<typename ThreadEngine::ResultType> startThreadEngine( } // namespace QtConcurrent -#endif //Q_QDOC QT_END_NAMESPACE |