5 |
#define VERSION "smsdaemon v0.1 by Torben Nielsen\n" |
#define VERSION "smsdaemon v0.1 by Torben Nielsen\n" |
6 |
|
|
7 |
|
|
8 |
#include "PluginManager.h" |
|
9 |
#include "TaskManager.h" |
//time_t is defines as long int ! //No need to include time.h |
10 |
|
|
11 |
|
class SmsCounter |
12 |
|
{ |
13 |
|
public: |
14 |
|
SmsCounter() : incomming(0), outgoing(0) {} |
15 |
|
|
16 |
|
unsigned int incomming; |
17 |
|
unsigned int outgoing; |
18 |
|
}; |
19 |
|
|
20 |
|
|
21 |
//Singleton |
//Singleton |
22 |
class Common |
class Common |
33 |
std::string pidfile; |
std::string pidfile; |
34 |
std::string spooldir; |
std::string spooldir; |
35 |
|
|
36 |
PluginManager pluginManager; |
long int daemonStart; |
37 |
TaskManager taskManager; |
|
38 |
|
SmsCounter smsCounter; |
39 |
|
|
40 |
|
class PluginManager* GetPluginManager(); |
41 |
|
class TaskManager* GetTaskManager(); |
42 |
|
|
43 |
void logMessage(std::string str); |
void logMessage(std::string str); |
44 |
void setLogfile(std::string file) {_logFile = file;} |
void setLogfile(std::string file) {_logFile = file;} |
45 |
|
|
46 |
void loadConfig(int argc, char* argv[]); |
void loadConfig(int argc, char* argv[]); |
47 |
|
|
48 |
|
std::string getStatusMessage(); |
49 |
private: |
private: |
50 |
Common() {} |
Common(); |
51 |
Common(const Common&) {} |
Common(const Common&) {} |
52 |
Common& operator=(const Common) {return *this;} |
Common& operator=(const Common) {return *this;} |
53 |
|
~Common(); |
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
class PluginManager* _pluginManager; |
58 |
|
class TaskManager* _taskManager; |
59 |
|
|
60 |
void printUsage(); |
void printUsage(); |
61 |
|
|