2 |
#define __COMMON_H__ |
#define __COMMON_H__ |
3 |
|
|
4 |
#include <string> |
#include <string> |
|
#define VERSION "smsdaemon v0.1 by Torben Nielsen\n" |
|
5 |
|
|
6 |
|
|
|
#include "PluginManager.h" |
|
|
#include "TaskManager.h" |
|
|
|
|
7 |
//time_t is defines as long int ! //No need to include time.h |
//time_t is defines as long int ! //No need to include time.h |
8 |
|
|
9 |
class SmsCounter |
class SmsCounter |
24 |
|
|
25 |
bool isDaemon; |
bool isDaemon; |
26 |
bool isDebug; |
bool isDebug; |
27 |
|
bool daemonized; |
28 |
int uid; |
int uid; |
29 |
int gid; |
int gid; |
30 |
volatile bool mainContinue; |
volatile bool mainContinue; |
31 |
|
|
32 |
|
std::string configFilePath; |
33 |
|
|
34 |
std::string pidfile; |
std::string pidfile; |
35 |
std::string spooldir; |
std::string spooldir; |
36 |
|
|
|
PluginManager pluginManager; |
|
|
TaskManager taskManager; |
|
37 |
long int daemonStart; |
long int daemonStart; |
38 |
|
|
39 |
SmsCounter smsCounter; |
SmsCounter smsCounter; |
40 |
|
|
41 |
|
class PluginManager* GetPluginManager(); |
42 |
|
class TaskManager* GetTaskManager(); |
43 |
|
class ConfigFile* GetConfigfile(); |
44 |
|
void SetConfigfile(class ConfigFile*); |
45 |
|
|
46 |
void logMessage(std::string str); |
void logMessage(std::string str); |
47 |
void setLogfile(std::string file) {_logFile = file;} |
void setLogfile(std::string file) {_logFile = file;} |
48 |
|
|
50 |
|
|
51 |
std::string getStatusMessage(); |
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) {return *this;} |
56 |
|
~Common(); |
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
class PluginManager* _pluginManager; |
61 |
|
class TaskManager* _taskManager; |
62 |
|
class ConfigFile* _configFile; |
63 |
|
|
64 |
void printUsage(); |
void printUsage(); |
65 |
|
|