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

Contents of /smsdaemon/common.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 157 - (show annotations) (download)
Mon Dec 8 21:28:40 2008 UTC (15 years, 5 months ago) by torben
File MIME type: text/plain
File size: 1039 byte(s)
Move logpart to its own files

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
32 std::string configFilePath;
33
34 std::string pidfile;
35 std::string spooldir;
36
37 long int daemonStart;
38
39 SmsCounter smsCounter;
40
41 class PluginManager* GetPluginManager();
42 class TaskManager* GetTaskManager();
43 class ConfigFile* GetConfigfile();
44 void SetConfigfile(class ConfigFile*);
45
46
47 void loadConfig(int argc, char* argv[]);
48
49 std::string getStatusMessage();
50 private:
51 Common();
52 Common(const Common&) {}
53 Common& operator=(const Common) {return *this;}
54 ~Common();
55
56
57
58 class PluginManager* _pluginManager;
59 class TaskManager* _taskManager;
60 class ConfigFile* _configFile;
61
62 void printUsage();
63
64 };
65
66
67 #endif //__COMMON_H__

  ViewVC Help
Powered by ViewVC 1.1.20