-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.h
More file actions
69 lines (53 loc) · 1.15 KB
/
program.h
File metadata and controls
69 lines (53 loc) · 1.15 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef PROGRAM_H
#define PROGRAM_H
#include <QString>
#include <QDebug>
#include <QProcess>
class Program {
public:
Program(QString out, QString exe, QString arg) {
this->out = out;
this->exe = exe;
this->arg = arg;
this->next = NULL;
//qWarning() << "program : " << out << ", " << exe << ", " << arg << ", " << endl;
}
~Program() {
if(next != NULL)
delete(next);
}
void printPid() {
qWarning() << pids << endl;
}
bool pidExist(qint64 id) {
return pids.indexOf(id) != -1;
}
void addPid(qint64 id) {
pids.push_back(id);
}
void deletePid(qint64 id) {
if(pids.indexOf(id) != -1) {
pids.erase(pids.begin() + pids.indexOf(id));
}
}
Program* getProgram() {
return next;
}
QString getOut() {
return out;
}
QString getExe() {
return exe;
}
QString getArg() {
return arg;
}
void setProg(Program *prog) {
this->next = prog;
}
private:
QString out, exe, arg;
Program* next;
QVector<qint64> pids;
};
#endif // PROGRAM_H