1 |
torben |
26 |
#ifndef __COMMON_H__ |
2 |
|
|
#define __COMMON_H__ |
3 |
|
|
|
4 |
|
|
#include <string> |
5 |
|
|
|
6 |
|
|
|
7 |
torben |
36 |
//time_t is defines as long int ! //No need to include time.h |
8 |
|
|
|
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 |
torben |
26 |
//Singleton |
20 |
|
|
class Common |
21 |
|
|
{ |
22 |
|
|
public: |
23 |
|
|
static Common* instance(); |
24 |
|
|
|
25 |
|
|
bool isDaemon; |
26 |
|
|
bool isDebug; |
27 |
torben |
150 |
bool daemonized; |
28 |
torben |
26 |
int uid; |
29 |
|
|
int gid; |
30 |
|
|
volatile bool mainContinue; |
31 |
torben |
208 |
volatile bool reloadConfig; |
32 |
torben |
26 |
|
33 |
torben |
146 |
std::string configFilePath; |
34 |
|
|
|
35 |
torben |
26 |
std::string pidfile; |
36 |
|
|
std::string spooldir; |
37 |
|
|
|
38 |
torben |
36 |
long int daemonStart; |
39 |
torben |
26 |
|
40 |
torben |
36 |
SmsCounter smsCounter; |
41 |
torben |
26 |
|
42 |
torben |
92 |
class PluginManager* GetPluginManager(); |
43 |
|
|
class TaskManager* GetTaskManager(); |
44 |
torben |
146 |
class ConfigFile* GetConfigfile(); |
45 |
|
|
void SetConfigfile(class ConfigFile*); |
46 |
torben |
92 |
|
47 |
torben |
26 |
|
48 |
|
|
void loadConfig(int argc, char* argv[]); |
49 |
|
|
|
50 |
torben |
196 |
std::string getStatusMessage(); |
51 |
torben |
26 |
private: |
52 |
torben |
92 |
Common(); |
53 |
torben |
26 |
Common(const Common&) {} |
54 |
torben |
196 |
Common& operator=(const Common) |
55 |
|
|
{ |
56 |
|
|
return *this; |
57 |
|
|
} |
58 |
torben |
92 |
~Common(); |
59 |
torben |
26 |
|
60 |
torben |
92 |
|
61 |
|
|
|
62 |
|
|
class PluginManager* _pluginManager; |
63 |
|
|
class TaskManager* _taskManager; |
64 |
torben |
146 |
class ConfigFile* _configFile; |
65 |
torben |
92 |
|
66 |
torben |
26 |
void printUsage(); |
67 |
|
|
|
68 |
|
|
}; |
69 |
|
|
|
70 |
|
|
|
71 |
|
|
#endif //__COMMON_H__ |