MappedEachKernel< Iterator, MapFunctor > Class Template Reference

MappedEachKernel< Iterator, MapFunctor > Class Template Reference

#include <qtconcurrentmapkernel.h>

Class Description

template<typename Iterator, typename MapFunctor>
class QtConcurrent::MappedEachKernel< Iterator, MapFunctor >

Definition at line 167 of file qtconcurrentmapkernel.h.

+ Inheritance diagram for MappedEachKernel< Iterator, MapFunctor >:

Public Types

typedef T ReturnType
 
typedef T ResultType
 
- Public Types inherited from IterateKernel< Iterator, MapFunctor::result_type >
typedef MapFunctor::result_type ResultType
 
- Public Types inherited from ThreadEngine< MapFunctor::result_type >
typedef MapFunctor::result_type ResultType
 

Public Member Functions

 MappedEachKernel (Iterator begin, Iterator end, MapFunctor _map)
 
bool runIteration (Iterator it, int, T *result)
 
bool runIterations (Iterator sequenceBeginIterator, int begin, int end, T *results)
 
- Public Member Functions inherited from IterateKernel< Iterator, MapFunctor::result_type >
 IterateKernel (Iterator _begin, Iterator _end)
 
virtual ~IterateKernel ()
 
void start ()
 
bool shouldStartThread ()
 
ThreadFunctionResult threadFunction ()
 
ThreadFunctionResult forThreadFunction ()
 
ThreadFunctionResult whileThreadFunction ()
 
- Public Member Functions inherited from ThreadEngine< MapFunctor::result_type >
virtual MapFunctor::result_type * result ()
 
QFutureInterface< MapFunctor::result_type > * futureInterfaceTyped ()
 
MapFunctor::result_type * startSingleThreaded ()
 
MapFunctor::result_type * startBlocking ()
 
QFuture< MapFunctor::result_type > startAsynchronously ()
 
void asynchronousFinish ()
 
void reportResult (const MapFunctor::result_type *_result, int index=-1)
 
void reportResults (const QVector< MapFunctor::result_type > &_result, int index=-1, int count=-1)
 
- Public Member Functions inherited from ThreadEngineBase
 ThreadEngineBase ()
 
virtual ~ThreadEngineBase ()
 
void startSingleThreaded ()
 
void startBlocking ()
 
void startThread ()
 
bool isCanceled ()
 
void waitForResume ()
 
bool isProgressReportingEnabled ()
 
void setProgressValue (int progress)
 
void setProgressRange (int minimum, int maximum)
 
void acquireBarrierSemaphore ()
 
- Public Member Functions inherited from QRunnable
 QRunnable ()
 
virtual ~QRunnable ()
 
bool autoDelete () const
 
void setAutoDelete (bool _autoDelete)
 

Additional Inherited Members

- Public Attributes inherited from IterateKernel< Iterator, MapFunctor::result_type >
const Iterator begin
 
const Iterator end
 
Iterator current
 
QAtomicInt currentIndex
 
bool forIteration
 
QAtomicInt iteratorThreads
 
int iterationCount
 
bool progressReportingEnabled
 
QAtomicInt completed
 
- Protected Member Functions inherited from ThreadEngineBase
virtual void finish ()
 
virtual bool shouldThrottleThread ()
 
- Protected Attributes inherited from ThreadEngineBase
QFutureInterfaceBasefutureInterface
 
QThreadPoolthreadPool
 
ThreadEngineBarrier barrier
 
QtConcurrent::internal::ExceptionStore exceptionStore
 

Member Typedef Documentation

typedef T ReturnType

Definition at line 172 of file qtconcurrentmapkernel.h.

typedef T ResultType

Definition at line 173 of file qtconcurrentmapkernel.h.

Constructor & Destructor Documentation

MappedEachKernel ( Iterator  begin,
Iterator  end,
MapFunctor  _map 
)
inline

Member Function Documentation

bool runIteration ( Iterator  it,
int  ,
T *  result 
)
inlinevirtual

Reimplemented from IterateKernel< Iterator, MapFunctor::result_type >.

Definition at line 178 of file qtconcurrentmapkernel.h.

179  {
180  *result = map(*it);
181  return true;
182  }
bool runIterations ( Iterator  sequenceBeginIterator,
int  begin,
int  end,
T *  results 
)
inlinevirtual

Reimplemented from IterateKernel< Iterator, MapFunctor::result_type >.

Definition at line 184 of file qtconcurrentmapkernel.h.

185  {
186 
187  Iterator it = sequenceBeginIterator;
188  advance(it, begin);
189  for (int i = begin; i < end; ++i) {
190  runIteration(it, i, results + (i - begin));
191  advance(it, 1);
192  }
193 
194  return true;
195  }
bool runIteration(Iterator it, int, T *result)

The documentation for this class was generated from the following file: