Newer
Older
typedef std::string string;
typedef std::stringstream sstream;
typedef std::ostream ostream;
typedef std::ifstream ifstream;
// -----------------------------------------------------------------------------
// SLDAEMON CLASS
// -----------------------------------------------------------------------------
class SLDaemon
{
public:
static const string version;
string pass;
int verbose; //0=false, 1=true, 3=undef
string scriptdir;
string conffile;
};
int pid;
string name;
time_t start_time;
bool operator()(const Job &a, const Job &b);
};
inline bool verbose() const { return options_.verbose == 1; }
Options *getoptions(int argc, char *argv[]) const;
Options *getoptions(const string file) const;
void applyoptions(const Options *opt);
typedef std::set<Job, Job> t_job;
t_job jobs_;
void usage(const char *argv0) const;
void check_options() const;
void send(const char *data, size_t len, bool buf = true);
void send(const string str, bool buf = true);
void cmd_status();
void cmd_killall();
void cmd_kill(const char *line);
private:
static SLDaemon *instance_;
SLDaemon();
~SLDaemon() {}
SLDaemon(const SLDaemon &) { assert(true); }
SLDaemon &operator=(const SLDaemon &) { assert(true); return *instance_; }