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;
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 options;
typedef std::set<Job, Job> t_job;
t_job jobs_;
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);
void clean_dir(const string &dir) const;
private:
static SLDaemon *instance_;
SLDaemon();
~SLDaemon() {}
SLDaemon(const SLDaemon &) { assert(true); }
SLDaemon &operator=(const SLDaemon &) { assert(true); return *instance_; }