mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2026-04-07 23:45:09 +00:00
big changes:
- task manager working now in round robbin and returning after every task to arduino - adding a system class which is managing all bigger things
This commit is contained in:
parent
5a1a091fc7
commit
52d41dd9f6
27 changed files with 216 additions and 121 deletions
29
lib/System/TaskQueue.h
Normal file
29
lib/System/TaskQueue.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef TASK_QUEUE_H_
|
||||
#define TASK_QUEUE_H_
|
||||
|
||||
#include <list>
|
||||
|
||||
template <typename T> class TaskQueue {
|
||||
public:
|
||||
TaskQueue() {
|
||||
}
|
||||
|
||||
void addElement(T elem) {
|
||||
_elements.push_back(elem);
|
||||
}
|
||||
|
||||
T getElement() {
|
||||
T elem = _elements.front();
|
||||
_elements.pop_front();
|
||||
return elem;
|
||||
}
|
||||
|
||||
bool empty() const {
|
||||
return _elements.empty();
|
||||
}
|
||||
|
||||
private:
|
||||
std::list<T> _elements;
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue