blob: 5ac4a263b91e9b9008e07807e6a7dc966f2e0b75 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#ifndef __TASK_H__
#define __TASK_H__
#ifndef _WIN32
#include <unistd.h>
#include <sys/time.h>
#endif
#include <vector>
#include <Exceptions.h>
#include <Handle.h>
#define TASK_ON_HOLD 0
#define TASK_DONE 1
#define TASK_BURST 2
#define W4_STICKY 1
#define W4_READING 2
#define W4_WRITING 4
class Task : public Base {
public:
Task();
virtual ~Task();
virtual String GetName();
int Run();
int DryRun();
int GetState();
void Suspend(int = -1) throw (GeneralException);
void WaitFor(Task *);
void WaitFor(Handle *, int = 0);
void WaitFor(pid_t);
void WaitFor(timeval, int = 0);
Task * WaitedBy();
void SetBurst();
void Stop();
void Restart();
bool IsStopped();
void RemoveFromWatches();
protected:
virtual int Do() throw (GeneralException);
int current;
private:
class wbta_t {
public:
wbta_t(Task * ata) : ta(ata) { }
Task * ta;
};
int state;
bool stopped;
bool suspended;
Task * wbta;
};
#endif
|