/[projects]/smsdaemon/Common.h
ViewVC logotype

Contents of /smsdaemon/Common.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 678 - (show annotations) (download)
Tue Apr 27 21:06:53 2010 UTC (14 years ago) by torben
File MIME type: text/plain
File size: 1075 byte(s)
undo previous unintentional commit
1 #ifndef __COMMON_H__
2 #define __COMMON_H__
3
4 #include <string>
5
6 //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 //Singleton
19 class Common
20 {
21 public:
22 static Common* instance();
23
24 bool isDaemon;
25 bool isDebug;
26 bool daemonized;
27 int uid;
28 int gid;
29 volatile bool mainContinue;
30 volatile bool reloadConfig;
31
32 std::string configFilePath;
33
34 std::string pidfile;
35 std::string spooldir;
36
37 long int daemonStart;
38
39
40 SmsCounter smsCounter;
41
42 class PluginManager* GetPluginManager();
43 class TaskManager* GetTaskManager();
44 class ConfigFile* GetConfigfile();
45 void SetConfigfile(class ConfigFile*);
46
47
48 void loadConfig(int argc, char* argv[]);
49
50
51 std::string getStatusMessage();
52 private:
53 Common();
54 Common(const Common&) {}
55 Common& operator=(const Common)
56 {
57 return *this;
58 }
59 ~Common();
60
61
62
63 class PluginManager* _pluginManager;
64 class TaskManager* _taskManager;
65 class ConfigFile* _configFile;
66
67 void printUsage();
68
69
70 };
71
72
73 #endif //__COMMON_H__

  ViewVC Help
Powered by ViewVC 1.1.20