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

Annotation of /smsdaemon/Common.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 146 - (hide annotations) (download)
Sun Dec 7 20:06:12 2008 UTC (15 years, 5 months ago) by torben
Original Path: smsdaemon/common.h
File MIME type: text/plain
File size: 1133 byte(s)
Added configuration module

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

  ViewVC Help
Powered by ViewVC 1.1.20