1 |
torben |
26 |
#ifndef __COMMON_H__ |
2 |
|
|
#define __COMMON_H__ |
3 |
|
|
|
4 |
|
|
#include <string> |
5 |
|
|
|
6 |
torben |
36 |
//time_t is defines as long int ! //No need to include time.h |
7 |
|
|
|
8 |
|
|
class SmsCounter |
9 |
|
|
{ |
10 |
|
|
public: |
11 |
|
|
SmsCounter() : incomming(0), outgoing(0) {} |
12 |
|
|
|
13 |
|
|
unsigned int incomming; |
14 |
|
|
unsigned int outgoing; |
15 |
|
|
}; |
16 |
|
|
|
17 |
|
|
|
18 |
torben |
26 |
//Singleton |
19 |
|
|
class Common |
20 |
|
|
{ |
21 |
|
|
public: |
22 |
|
|
static Common* instance(); |
23 |
|
|
|
24 |
|
|
bool isDaemon; |
25 |
|
|
bool isDebug; |
26 |
torben |
150 |
bool daemonized; |
27 |
torben |
26 |
int uid; |
28 |
|
|
int gid; |
29 |
|
|
volatile bool mainContinue; |
30 |
torben |
208 |
volatile bool reloadConfig; |
31 |
torben |
26 |
|
32 |
torben |
146 |
std::string configFilePath; |
33 |
|
|
|
34 |
torben |
26 |
std::string pidfile; |
35 |
|
|
std::string spooldir; |
36 |
|
|
|
37 |
torben |
36 |
long int daemonStart; |
38 |
torben |
26 |
|
39 |
torben |
216 |
|
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 |
216 |
|
51 |
torben |
196 |
std::string getStatusMessage(); |
52 |
torben |
26 |
private: |
53 |
torben |
92 |
Common(); |
54 |
torben |
26 |
Common(const Common&) {} |
55 |
torben |
196 |
Common& operator=(const Common) |
56 |
|
|
{ |
57 |
|
|
return *this; |
58 |
|
|
} |
59 |
torben |
92 |
~Common(); |
60 |
torben |
26 |
|
61 |
torben |
92 |
|
62 |
|
|
|
63 |
|
|
class PluginManager* _pluginManager; |
64 |
|
|
class TaskManager* _taskManager; |
65 |
torben |
146 |
class ConfigFile* _configFile; |
66 |
torben |
92 |
|
67 |
torben |
26 |
void printUsage(); |
68 |
|
|
|
69 |
torben |
216 |
|
70 |
torben |
26 |
}; |
71 |
|
|
|
72 |
|
|
|
73 |
|
|
#endif //__COMMON_H__ |