diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-08-07 14:04:05 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-02-12 06:49:39 -0500 |
| commit | 52c28dbda3f4ef2241182e32002b710b1a9eae0b (patch) | |
| tree | c2e47ffa32bfc042ec49694289ab2ea5963a1828 /native/include | |
| parent | 2e2370a21d65ee9ea7659f995fc5b553885646fc (diff) | |
Add unique IDs to TaskInfo
The LP code generates variable IDs based on task identity.
It's convenient to keep track of this explicitly.
Diffstat (limited to 'native/include')
| -rw-r--r-- | native/include/sharedres_types.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/native/include/sharedres_types.h b/native/include/sharedres_types.h index fe190c6..898434c 100644 --- a/native/include/sharedres_types.h +++ b/native/include/sharedres_types.h | |||
| @@ -63,18 +63,20 @@ private: | |||
| 63 | unsigned long period; | 63 | unsigned long period; |
| 64 | unsigned long response; | 64 | unsigned long response; |
| 65 | unsigned int cluster; | 65 | unsigned int cluster; |
| 66 | 66 | unsigned int id; | |
| 67 | Requests requests; | 67 | Requests requests; |
| 68 | 68 | ||
| 69 | public: | 69 | public: |
| 70 | TaskInfo(unsigned long _period, | 70 | TaskInfo(unsigned long _period, |
| 71 | unsigned long _response, | 71 | unsigned long _response, |
| 72 | unsigned int _cluster, | 72 | unsigned int _cluster, |
| 73 | unsigned int _priority) | 73 | unsigned int _priority, |
| 74 | int _id) | ||
| 74 | : priority(_priority), | 75 | : priority(_priority), |
| 75 | period(_period), | 76 | period(_period), |
| 76 | response(_response), | 77 | response(_response), |
| 77 | cluster(_cluster) | 78 | cluster(_cluster), |
| 79 | id(_id) | ||
| 78 | {} | 80 | {} |
| 79 | 81 | ||
| 80 | void add_request(unsigned int res_id, | 82 | void add_request(unsigned int res_id, |
| @@ -90,6 +92,7 @@ public: | |||
| 90 | return requests; | 92 | return requests; |
| 91 | } | 93 | } |
| 92 | 94 | ||
| 95 | unsigned int get_id() const { return id; } | ||
| 93 | unsigned int get_priority() const { return priority; } | 96 | unsigned int get_priority() const { return priority; } |
| 94 | unsigned long get_period() const { return period; } | 97 | unsigned long get_period() const { return period; } |
| 95 | unsigned long get_response() const { return response; } | 98 | unsigned long get_response() const { return response; } |
| @@ -144,7 +147,8 @@ public: | |||
| 144 | { | 147 | { |
| 145 | // Avoid re-allocation! | 148 | // Avoid re-allocation! |
| 146 | assert(tasks.size() < tasks.capacity()); | 149 | assert(tasks.size() < tasks.capacity()); |
| 147 | tasks.push_back(TaskInfo(period, response, cluster, priority)); | 150 | int id = tasks.size(); |
| 151 | tasks.push_back(TaskInfo(period, response, cluster, priority, id)); | ||
| 148 | } | 152 | } |
| 149 | 153 | ||
| 150 | void add_request(unsigned int resource_id, | 154 | void add_request(unsigned int resource_id, |
