summaryrefslogtreecommitdiffstats
path: root/Master/Real-Time Systems/Praktikum1/Aufgabe3/src/Task.h
blob: bd8c7734ee918c72259eec05d105ef7f77fd1348 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
 * Task.h
 *
 *  Created on: 31.10.2010
 *      Author: sven
 */

#ifndef TASK_H_
#define TASK_H_

#ifndef GLOBAL_H_
	#include "Global.h"
#endif

#include <string>
#include <vector>
#include <cmath>

class Task;

typedef vector<Task> task_set;

class Task {
public:
	Task();
	Task(char*,int,int,int);
	virtual ~Task();

	void dump() const;
	void dumpStep() const;
	void execute();
	void requeue();
	void checkPeriod();

    int getStepCounter() const
    {
        return m_stepCounter;
    }

    void setStepCounter(int m_stepCounter)
    {
        this->m_stepCounter = m_stepCounter;
    }

    int getActC() const
    {
        return m_actC;
    }

    int getActD() const
    {
        return m_actD;
    }

    string getName() const
    {
        return m_Name;
    }

    int getOrigC() const
    {
        return m_origC;
    }

    int getOrigD() const
    {
        return m_origD;
    }

    int getOrigP() const
    {
        return m_origP;
    }

    void setActC(int m_actC)
    {
        this->m_actC = m_actC;
    }

    void setActD(int m_actD)
    {
        this->m_actD = m_actD;
    }

    void setName(string m_Name)
    {
        this->m_Name = m_Name;
    }

    void setOrigC(int m_origC)
    {
        this->m_origC = m_origC;
    }

    void setOrigD(int m_origD)
    {
        this->m_origD = m_origD;
    }

    void setOrigP(int m_origP)
    {
        this->m_origP = m_origP;
    }
    int getNextDeadline();

private:
	string m_Name;
	int m_origC;
	int m_origP;
	int m_origD;
	int m_actC;
	int m_actD;
	int m_stepCounter;
	int m_absoluteStepCounter;
};

#endif /* TASK_H_ */