--- smsdaemon/common.h 2008/06/09 18:15:53 26 +++ smsdaemon/Common.h 2008/12/08 21:49:49 158 @@ -2,11 +2,19 @@ #define __COMMON_H__ #include -#define VERSION "smsdaemon v0.1 by Torben Nielsen\n" -#include "PluginManager.h" -#include "TaskManager.h" +//time_t is defines as long int ! //No need to include time.h + +class SmsCounter +{ +public: + SmsCounter() : incomming(0), outgoing(0) {} + + unsigned int incomming; + unsigned int outgoing; +}; + //Singleton class Common @@ -16,31 +24,43 @@ bool isDaemon; bool isDebug; + bool daemonized; int uid; int gid; volatile bool mainContinue; + std::string configFilePath; + std::string pidfile; std::string spooldir; - PluginManager pluginManager; - TaskManager taskManager; + long int daemonStart; + + SmsCounter smsCounter; + class PluginManager* GetPluginManager(); + class TaskManager* GetTaskManager(); + class ConfigFile* GetConfigfile(); + void SetConfigfile(class ConfigFile*); - void logMessage(std::string str); - void setLogfile(std::string file) {_logFile = file;} void loadConfig(int argc, char* argv[]); - + std::string getStatusMessage(); private: - Common() {} + Common(); Common(const Common&) {} Common& operator=(const Common) {return *this;} + ~Common(); + + + + class PluginManager* _pluginManager; + class TaskManager* _taskManager; + class ConfigFile* _configFile; void printUsage(); - std::string _logFile; };