00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026 #ifndef CORE_EPONA_H
00027 #define CORE_EPONA_H
00028
00029
00030
00031 #include <string>
00032
00033 #include <modules/core.h>
00034
00035
00036
00037 namespace conf { class ConfGlobalQ; }
00038
00039
00040
00042
00043 namespace core
00044 {
00045
00046
00047
00048 namespace hidden
00049 {
00050 class Directives;
00051 }
00052
00053
00054
00056
00061 class Epona : public modules::Core
00062 {
00063 private:
00064 friend class ECmdLineParser;
00065 public:
00066
00068 static uint32_t const efTakeOver = 0x80000000;
00070 static uint32_t const efNoExpire = 0x40000000;
00071
00072
00073 typedef hidden::Directives Directives;
00074
00075
00076
00078 Epona(int ac, char const *const *av, char const *const *envp);
00080 ~Epona();
00081
00083 virtual conf::ConfQ *config(modules::Core &core,
00084 conf::ConfGlobalQ &global);
00085
00087
00092 void dump_core(bool dump);
00093
00095 virtual void fatal(char const *msg = 0);
00096
00098 virtual void notify(Module &sender, int msg, void *arg);
00099
00101
00104 void pid_erase(const char *filename);
00105
00107
00110 void pid_write(const char *filename);
00111
00113
00115 void run();
00116
00118 virtual cmdline::CmdLineParser &clp() { return *m_clp; }
00119
00121 hidden::Directives const &cd() const { return *m_cd; }
00123 std::string const &conffile() const { return m_conffile; }
00124
00126 virtual conf::ConfLogger &conf_logger() { return *m_conflogger; }
00127
00129 virtual xlog::Logger &logger() { return *m_logger; }
00130
00132 virtual modules::ModManager &modules() { return *m_modules; }
00133
00135 virtual scheduler::Scheduler &tasks() { return *m_tasks; }
00136
00138 virtual int version() const;
00140 virtual std::string const version_string() const;
00141 private:
00142 cmdline::CmdLineParser *m_clp;
00143
00144 conf::ConfLogger *m_conflogger;
00145 hidden::Directives *m_cd;
00146 std::string m_conffile;
00147 conf::ConfGlobalQ *m_global;
00148
00149 xlog::Logger *m_logger;
00150
00151 modules::ModManager *m_modules;
00152
00153 scheduler::Scheduler *m_tasks;
00154
00155 bool config(bool reload);
00156
00157 void init_signals();
00158 void load_modules();
00159
00160 void load();
00161 void restart();
00162 void start();
00163 void stop();
00164 };
00165
00166
00167
00168 }
00169
00170
00171
00172 #endif