FilteredEachKernel< Iterator, KeepFunctor > Class Template Reference

FilteredEachKernel< Iterator, KeepFunctor > Class Template Reference

#include <qtconcurrentfilterkernel.h>

Class Description

template<typename Iterator, typename KeepFunctor>
class QtConcurrent::FilteredEachKernel< Iterator, KeepFunctor >

Definition at line 247 of file qtconcurrentfilterkernel.h.

+ Inheritance diagram for FilteredEachKernel< Iterator, KeepFunctor >:

Public Types

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

Public Member Functions

 FilteredEachKernel (Iterator begin, Iterator end, KeepFunctor _keep)
 
void start ()
 
bool runIteration (Iterator it, int index, T *)
 
bool runIterations (Iterator sequenceBeginIterator, int begin, int end, T *)
 
- Public Member Functions inherited from IterateKernel< Iterator, qValueType< Iterator >::value_type >
 IterateKernel (Iterator _begin, Iterator _end)
 
virtual ~IterateKernel ()
 
virtual bool runIteration (Iterator it, int index, qValueType< Iterator >::value_type *result)
 
virtual bool runIterations (Iterator _begin, int beginIndex, int endIndex, qValueType< Iterator >::value_type *results)
 
void start ()
 
bool shouldStartThread ()
 
ThreadFunctionResult threadFunction ()
 
ThreadFunctionResult forThreadFunction ()
 
ThreadFunctionResult whileThreadFunction ()
 
- Public Member Functions inherited from ThreadEngine< qValueType< Iterator >::value_type >
virtual qValueType< Iterator >::value_type * result ()
 
QFutureInterface< qValueType< Iterator >::value_type > * futureInterfaceTyped ()
 
qValueType< Iterator >::value_type * startSingleThreaded ()
 
qValueType< Iterator >::value_type * startBlocking ()
 
QFuture< qValueType< Iterator >::value_type > startAsynchronously ()
 
void asynchronousFinish ()
 
void reportResult (const qValueType< Iterator >::value_type *_result, int index=-1)
 
void reportResults (const QVector< qValueType< Iterator >::value_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, qValueType< Iterator >::value_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 255 of file qtconcurrentfilterkernel.h.

typedef T ResultType

Definition at line 256 of file qtconcurrentfilterkernel.h.

Constructor & Destructor Documentation

FilteredEachKernel ( Iterator  begin,
Iterator  end,
KeepFunctor  _keep 
)
inline

Definition at line 258 of file qtconcurrentfilterkernel.h.

259  : IterateKernelType(begin, end), keep(_keep)
260  { }
GLuint GLuint end
Definition: GLee.h:872

Member Function Documentation

void start ( )
inlinevirtual

Reimplemented from ThreadEngineBase.

Definition at line 262 of file qtconcurrentfilterkernel.h.

263  {
264  if (this->futureInterface)
265  this->futureInterface->setFilterMode(true);
267  }
void setFilterMode(bool enable)
bool runIteration ( Iterator  it,
int  index,
T *   
)
inline

Definition at line 269 of file qtconcurrentfilterkernel.h.

270  {
271  if (keep(*it))
272  this->reportResult(&(*it), index);
273  else
274  this->reportResult(0, index);
275  return false;
276  }
GLuint index
Definition: GLee.h:1704
void reportResult(const qValueType< Iterator >::value_type *_result, int index=-1)
bool runIterations ( Iterator  sequenceBeginIterator,
int  begin,
int  end,
T *   
)
inline

Definition at line 278 of file qtconcurrentfilterkernel.h.

279  {
280  const int count = end - begin;
281  IntermediateResults<typename qValueType<Iterator>::value_type> results;
282  results.begin = begin;
283  results.end = end;
284  results.vector.reserve(count);
285 
286  Iterator it = sequenceBeginIterator;
287  advance(it, begin);
288  for (int i = begin; i < end; ++i) {
289  if (keep(*it))
290  results.vector.append(*it);
291  advance(it, 1);
292  }
293 
294  this->reportResults(results.vector, begin, count);
295  return false;
296  }
void reportResults(const QVector< qValueType< Iterator >::value_type > &_result, int index=-1, int count=-1)
GLuint GLuint GLsizei count
Definition: GLee.h:872
GLuint GLuint end
Definition: GLee.h:872

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