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

Annotation of /smsdaemon/Common.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 92 - (hide annotations) (download)
Mon Jun 16 11:30:20 2008 UTC (15 years, 11 months ago) by torben
Original Path: smsdaemon/common.h
File MIME type: text/plain
File size: 1049 byte(s)
No need for Common.h to include TaskManager.h and PluginManager.h


1 torben 26 #ifndef __COMMON_H__
2     #define __COMMON_H__
3    
4     #include <string>
5     #define VERSION "smsdaemon v0.1 by Torben Nielsen\n"
6    
7    
8    
9 torben 36 //time_t is defines as long int ! //No need to include time.h
10    
11     class SmsCounter
12     {
13     public:
14     SmsCounter() : incomming(0), outgoing(0) {}
15    
16     unsigned int incomming;
17     unsigned int outgoing;
18     };
19    
20    
21 torben 26 //Singleton
22     class Common
23     {
24     public:
25     static Common* instance();
26    
27     bool isDaemon;
28     bool isDebug;
29     int uid;
30     int gid;
31     volatile bool mainContinue;
32    
33     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    
43 torben 26 void logMessage(std::string str);
44     void setLogfile(std::string file) {_logFile = file;}
45    
46     void loadConfig(int argc, char* argv[]);
47    
48 torben 36 std::string getStatusMessage();
49 torben 26 private:
50 torben 92 Common();
51 torben 26 Common(const Common&) {}
52     Common& operator=(const Common) {return *this;}
53 torben 92 ~Common();
54 torben 26
55 torben 92
56    
57     class PluginManager* _pluginManager;
58     class TaskManager* _taskManager;
59    
60 torben 26 void printUsage();
61    
62     std::string _logFile;
63     };
64    
65    
66     #endif //__COMMON_H__

  ViewVC Help
Powered by ViewVC 1.1.20