3 |
|
|
4 |
#include <string> |
#include <string> |
5 |
|
|
6 |
class IGsmModem; |
class ISmsTransceiver; |
7 |
|
|
8 |
/* A Task is some piece of code that must be executed regularly, no matter whether |
/* A Task is some piece of code that must be executed regularly, no matter whether |
9 |
* the daemon has received any SMS. |
* the daemon has received any SMS. |
10 |
* |
* |
11 |
* Tasks exist in two flavours: normal and temporary. |
* Tasks exist in two flavours: persistant and temporary. |
12 |
* |
* |
13 |
* A normal task is one which lives throughout the execution of the smsdaemon instance. |
* A persistant task is one which lives throughout the execution of the smsdaemon instance. |
14 |
* A pointer to a normal tasks can be retrieved via TaskManager::GetTask(std::string name), |
* A pointer to a persistant task can be retrieved via TaskManager::GetTask(std::string name), |
15 |
* and thus it must have a unique name. |
* and thus it must have a unique name. |
16 |
* |
* |
17 |
* A temporary tasks is of a more short-lived nature. It behaves like a fire-and-forget piece of code. |
* A temporary tasks is of a more short-lived nature. It behaves like a fire-and-forget piece of code. |
30 |
|
|
31 |
std::string GetName() {return _name;} |
std::string GetName() {return _name;} |
32 |
|
|
33 |
virtual void ExecuteTask(IGsmModem& modem) = 0; |
virtual void ExecuteTask(ISmsTransceiver& modem) = 0; |
34 |
|
|
35 |
bool IsTemporary() { return _isTemporary; } |
bool IsTemporary() { return _isTemporary; } |
36 |
bool IsFinished() { return _isFinished; } |
bool IsFinished() { return _isFinished; } |