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

Annotation of /smsdaemon/Common.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 94 - (hide annotations) (download)
Mon Jun 16 11:57:48 2008 UTC (15 years, 11 months ago) by torben
Original Path: smsdaemon/common.h
File MIME type: text/plain
File size: 995 byte(s)
Testing keyword property substitution

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

  ViewVC Help
Powered by ViewVC 1.1.20