Home
Install
Use
Develop
Support
News
Credits
hosted by
|
14#include "ThreadContext.h"
31 void resize ( unsigned nthread);
40 template< class Class, typename Method>
41 void submit (Class* instance, Method method);
44 template< class Class, typename Method, typename Argument>
45 void submit (Class* instance, Method method, Argument argument);
48 template< class Class, typename Method, typename Arg1, typename Arg2>
49 void submit (Class* instance, Method method, Arg1 a1, Arg2 a2);
70class BatchQueue::Job {
80 virtual void execute () = 0;
84 friend class BatchQueue;
91template< class Class, typename Method>
94 class Job0 : public Job {
96 void execute () { functor (); }
98 Job0 (Class* instance, Method method) : functor (instance, method) {}
101 submit ( new Job0( instance, method ));
104template< class Class, typename Method, typename Argument>
107 class Job1 : public Job {
108 Functor< void(Argument) > functor;
110 void execute () { functor (argument); }
112 Job1 (Class* instance, Method method, Argument arg)
113 : functor (instance, method) { argument = arg; }
116 submit ( new Job1( instance, method, arg ));
119template< class Class, typename Method, typename Arg1, typename Arg2>
122 class Job2 : public Job {
123 Functor< void(Arg1, Arg2) > functor;
126 void execute () { functor (arg1, arg2); }
128 Job2 (Class* instance, Method method, Arg1 a1, Arg2 a2)
129 : functor (instance, method) { arg1 = a1; arg2 = a2; }
132 submit ( new Job2( instance, method, a1, a2 ));
ThreadContext * context Mutual exclusion and condition variables used to coordinate the queue. Definition BatchQueue.h:63
void wait() Wait for completion of all active jobs. Definition BatchQueue.C:237
~BatchQueue() Destructor. Definition BatchQueue.C:36
void submit(Job *) Submit a job for processing. Definition BatchQueue.C:232
std::vector< Job * > active The active jobs. Definition BatchQueue.h:66
void resize(unsigned nthread) Set the number of tasks that may run at one time. Definition BatchQueue.C:241
BatchQueue(unsigned nthread=0) Default constructor. Definition BatchQueue.C:23
void remove(Job *) Remove a job from the active list.
void add(Job *) Add a job to the active list.
Implements an adaptable function object in compliance with the STL. Definition Functor.h:39
ThreadContext class. Definition ThreadContext.h:15
Generated using doxygen 1.14.0
|