Newer
Older
/*
This file is part of SLD.
Copyright (C) 2008 Sebastien LUTTRINGER <contact@seblu.net>
SLD is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
SLD is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SLD; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
# include "sld.hh"
# include "sll/connection.hh"
// -----------------------------------------------------------------------------
// 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 == 2; }
Connection c_;
// int socket_fd_;
// FILE* socket_fs_;
typedef std::set<Job, Job> t_job;
t_job jobs_;
// void disconnect();
// void send(const char *data, size_t len, bool buf = true);
// void send(const string str, bool buf = true);
// void send(long int i);
// void sendln(const string &s);
// char *recv(size_t size);
// void recv(size_t size, const string &filename);
// char *recvln();
// void flush();
void cmd_status();
void cmd_killall();
void cmd_kill(const char *line);
void recv2file(size_t size, const string &filename);
void clean_dir(const string &dir) const;
~SLDaemon() {}
SLDaemon(const SLDaemon &) { assert(true); }
SLDaemon &operator=(const SLDaemon &) { assert(true); return *instance_; }