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

Contents of /smsdaemon/Common.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 208 - (show annotations) (download)
Sun Dec 21 18:41:08 2008 UTC (15 years, 5 months ago) by torben
File MIME type: text/plain
File size: 1073 byte(s)
Enable dynamic reload of plugins/tasks when recieving a HUP signal

1 #ifndef __COMMON_H__
2 #define __COMMON_H__
3
4 #include <string>
5
6
7 //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 //Singleton
20 class Common
21 {
22 public:
23 static Common* instance();
24
25 bool isDaemon;
26 bool isDebug;
27 bool daemonized;
28 int uid;
29 int gid;
30 volatile bool mainContinue;
31 volatile bool reloadConfig;
32
33 std::string configFilePath;
34
35 std::string pidfile;
36 std::string spooldir;
37
38 long int daemonStart;
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 std::string getStatusMessage();
51 private:
52 Common();
53 Common(const Common&) {}
54 Common& operator=(const Common)
55 {
56 return *this;
57 }
58 ~Common();
59
60
61
62 class PluginManager* _pluginManager;
63 class TaskManager* _taskManager;
64 class ConfigFile* _configFile;
65
66 void printUsage();
67
68 };
69
70
71 #endif //__COMMON_H__

Properties

Name Value
svn:mergeinfo

  ViewVC Help
Powered by ViewVC 1.1.20