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