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

Diff of /smsdaemon/Common.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 26 by torben, Mon Jun 9 18:15:53 2008 UTC revision 678 by torben, Tue Apr 27 21:06:53 2010 UTC
# Line 2  Line 2 
2  #define __COMMON_H__  #define __COMMON_H__
3    
4  #include <string>  #include <string>
 #define VERSION "smsdaemon v0.1 by Torben Nielsen\n"  
5    
6    //time_t is defines as long int ! //No need to include time.h
7    
8    class SmsCounter
9    {
10    public:
11            SmsCounter() : incomming(0), outgoing(0) {}
12    
13            unsigned int incomming;
14            unsigned int outgoing;
15    };
16    
 #include "PluginManager.h"  
 #include "TaskManager.h"  
17    
18  //Singleton  //Singleton
19  class Common  class Common
# Line 16  public: Line 23  public:
23    
24          bool isDaemon;          bool isDaemon;
25          bool isDebug;          bool isDebug;
26            bool daemonized;
27          int uid;          int uid;
28          int gid;          int gid;
29          volatile bool mainContinue;          volatile bool mainContinue;
30            volatile bool reloadConfig;
31    
32            std::string configFilePath;
33    
34          std::string pidfile;          std::string pidfile;
35          std::string spooldir;          std::string spooldir;
36    
37          PluginManager pluginManager;          long int daemonStart;
38          TaskManager taskManager;  
39    
40            SmsCounter smsCounter;
41    
42            class PluginManager* GetPluginManager();
43            class TaskManager* GetTaskManager();
44            class ConfigFile* GetConfigfile();
45            void SetConfigfile(class ConfigFile*);
46    
         void logMessage(std::string str);  
         void setLogfile(std::string file) {_logFile = file;}  
47    
48          void loadConfig(int argc, char* argv[]);          void loadConfig(int argc, char* argv[]);
49    
50            
51            std::string getStatusMessage();
52  private:  private:
53          Common() {}          Common();
54          Common(const Common&) {}          Common(const Common&) {}
55          Common& operator=(const Common) {return *this;}          Common& operator=(const Common)
56            {
57                    return *this;
58            }
59            ~Common();
60    
61    
62    
63            class PluginManager* _pluginManager;
64            class TaskManager* _taskManager;
65            class ConfigFile* _configFile;
66    
67          void printUsage();          void printUsage();
68    
69          std::string _logFile;  
70  };  };
71    
72    

Legend:
Removed from v.26  
changed lines
  Added in v.678

  ViewVC Help
Powered by ViewVC 1.1.20