42 #ifndef QTCONCURRENT_ITERATEKERNEL_H
43 #define QTCONCURRENT_ITERATEKERNEL_H
47 #ifndef QT_NO_CONCURRENT
69 template <
typename It,
typename T>
70 void advance(It &it, T
value)
88 void timeBeforeUser();
92 inline bool blockSizeMaxed()
94 return (m_blockSize >= maxBlockSize);
97 const int maxBlockSize;
105 template <
typename T>
123 const int useVectorThreshold = 4;
170 template <
typename T>
177 template <
typename Iterator,
typename T>
184 #if defined (QT_NO_STL)
192 #if defined (QT_NO_STL)
203 { Q_UNUSED(it); Q_UNUSED(index); Q_UNUSED(result);
return false; }
204 virtual bool runIterations(Iterator _begin,
int beginIndex,
int endIndex, T *results)
205 { Q_UNUSED(_begin); Q_UNUSED(beginIndex); Q_UNUSED(endIndex); Q_UNUSED(results);
return false; }
239 const int currentBlockSize = blockSizeManager.
blockSize();
246 const int endIndex = qMin(beginIndex + currentBlockSize,
iterationCount);
248 if (beginIndex >= endIndex) {
258 const int finalBlockSize = endIndex - beginIndex;
266 if (resultsAvailable)
304 if (resultAavailable)
338 #endif // QT_NO_CONCURRENT
bool testAndSetRelease(int expectedValue, int newValue)
void reserveSpace(int resultCount)
ResultReporter(ThreadEngine< T > *_threadEngine)
void setProgressValue(int progress)
ResultReporter(ThreadEngine< void > *)
IterateKernel(Iterator _begin, Iterator _end)
int fetchAndAddRelaxed(int valueToAdd)
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
virtual bool runIteration(Iterator it, int index, T *result)
void setProgressRange(int minimum, int maximum)
int fetchAndAddAcquire(int valueToAdd)
ThreadEngine< T > * threadEngine
bool testAndSetAcquire(int expectedValue, int newValue)
#define QT_BEGIN_NAMESPACE
bool selectIteration(std::bidirectional_iterator_tag)
bool progressReportingEnabled
GLsizei const GLfloat * value
void reportResults(int begin)
QAtomicInt iteratorThreads
virtual bool shouldThrottleThread()
ThreadFunctionResult whileThreadFunction()
bool isProgressReportingEnabled()
virtual bool runIterations(Iterator _begin, int beginIndex, int endIndex, T *results)
ThreadFunctionResult threadFunction()
ThreadFunctionResult forThreadFunction()
int fetchAndAddRelease(int valueToAdd)