#ifndef __COMMON_H__ #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 { public: static Common* instance(); bool isDaemon; bool isDebug; int uid; int gid; volatile bool mainContinue; std::string pidfile; std::string spooldir; PluginManager pluginManager; TaskManager taskManager; long int daemonStart; SmsCounter smsCounter; void logMessage(std::string str); void setLogfile(std::string file) {_logFile = file;} void loadConfig(int argc, char* argv[]); std::string getStatusMessage(); private: Common() {} Common(const Common&) {} Common& operator=(const Common) {return *this;} void printUsage(); std::string _logFile; }; #endif //__COMMON_H__