22 namespace Threads {
class ConditionVar; }
48 virtual uiString uiNrDoneText()
const;
53 virtual bool execute() = 0;
56 virtual void enableWorkControl(
bool=
true);
58 bool workControlEnabled()
const;
59 virtual void controlWork(
Control);
60 virtual Control getState()
const;
64 Task(
const char* nm=0);
65 virtual bool shouldContinue();
73 virtual const char*
message()
const {
return 0; }
87 void addTask( Task* );
90 void setParallel(
bool);
91 void showCumulativeCount(
bool yn);
102 virtual bool execute();
104 void enableWorkControl(
bool=
true);
105 virtual void controlWork(
Control);
106 virtual Control getState()
const;
150 virtual int nextStep() = 0;
172 static bool execute(TaskRunner* tr,
Task& );
179 {
return (execres_ = t.
execute()); }
#define mExpClass(module)
Definition: commondefs.h:160
Is an object that faciliates many threads to wait for something to happen.
Definition: thread.h:108
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:53
is an interface where processes can report their progress.
Definition: progressmeter.h:21
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
static int ErrorOccurred()
Definition: task.h:141
ProgressMeter * progressMeter()
Definition: task.h:131
TaskRunner()
Definition: task.h:175
static uiString stdNrDoneText()
Definition: task.h:49
#define od_int64
Definition: plftypes.h:36
static uiString uiStdNrDoneText()
Definition: task.h:50
Definition: uistring.h:89
static int MoreToDo()
Definition: task.h:143
Threads::Lock lock_
Definition: task.h:113
int lastupdate_
Definition: task.h:158
int curtask_
Definition: task.h:111
virtual ~TaskRunner()
Definition: task.h:176
A collection of tasks, that behave as a single task.
Definition: task.h:82
const ProgressMeter * progressMeter() const
Definition: task.h:132
Threads::ConditionVar * workcontrolcondvar_
Definition: task.h:68
interface to threads that should be portable.
Definition: atomic.h:28
The generalization of something (e.g. a computation) where the steps must be done in sequence...
Definition: task.h:124
static int Finished()
Definition: task.h:142
Class that can execute a task.
Definition: task.h:169
Control
Definition: task.h:55
virtual const char * nrDoneText() const
Definition: task.h:75
virtual void setProgressMeter(ProgressMeter *)
Must be called before execute()
Definition: task.h:34
virtual int64_t totalNr() const
Definition: task.h:43
virtual bool execute(Task &t)
Definition: task.h:178
Object with a name.
Definition: namedobj.h:35
Control control_
Definition: task.h:67
virtual int64_t nrDone() const
Definition: task.h:37
ObjectSet< Task > tasks_
Definition: task.h:110
ProgressMeter * progressmeter_
Definition: task.h:157
bool execres_
Definition: task.h:184
static int WarningAvailable()
Definition: task.h:144
Generalization of something (e.g. a computation) that needs to be done in multiple steps...
Definition: task.h:28
virtual bool execResult() const
Definition: task.h:180
~TaskGroup()
Definition: task.h:86
virtual const char * message() const
Definition: task.h:73
void deepErase(ObjectSet< T > &os)
empty the ObjectSet deleting all objects pointed to.
Definition: objectset.h:118