| 1 |
/* |
| 2 |
This file is part of Icecream. |
| 3 |
|
| 4 |
Copyright (c) 2003 Frerich Raabe <[email protected]> |
| 5 |
Copyright (c) 2003,2004 Stephan Kulow <[email protected]> |
| 6 |
Copyright (c) 2003,2004 Cornelius Schumacher <[email protected]> |
| 7 |
|
| 8 |
This program is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; either version 2 of the License, or |
| 11 |
(at your option) any later version. |
| 12 |
|
| 13 |
This program is distributed in the hope that it will be useful, |
| 14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
GNU General Public License for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU General Public License along |
| 19 |
with this program; if not, write to the Free Software Foundation, Inc., |
| 20 |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef ICEMON_ICECREAMMONITOR_H |
| 24 |
#define ICEMON_ICECREAMMONITOR_H |
| 25 |
|
| 26 |
#include "monitor.h" |
| 27 |
|
| 28 |
#include <QtCore/QSocketNotifier> |
| 29 |
|
| 30 |
class HostInfoManager; |
| 31 |
class Msg; |
| 32 |
class MsgChannel; |
| 33 |
class StatusView; |
| 34 |
class DiscoverSched; |
| 35 |
class QSocketNotifier; |
| 36 |
|
| 37 |
class IcecreamMonitor |
| 38 |
: public Monitor |
| 39 |
{ |
| 40 |
Q_OBJECT |
| 41 |
|
| 42 |
public: |
| 43 |
IcecreamMonitor(HostInfoManager *, QObject *parent); |
| 44 |
~IcecreamMonitor() override; |
| 45 |
|
| 46 |
QList<Job> jobHistory() const override; |
| 47 |
|
| 48 |
private slots: |
| 49 |
void slotCheckScheduler(); |
| 50 |
void msgReceived(); |
| 51 |
|
| 52 |
private: |
| 53 |
void checkScheduler(bool deleteit = false); |
| 54 |
void registerNotify(int fd, QSocketNotifier::Type type, const char *slot); |
| 55 |
void setupDebug(); |
| 56 |
|
| 57 |
bool handle_activity(); |
| 58 |
void handle_getcs(Msg *m); |
| 59 |
void handle_job_begin(Msg *m); |
| 60 |
void handle_job_done(Msg *m); |
| 61 |
void handle_stats(Msg *m); |
| 62 |
void handle_local_begin(Msg *m); |
| 63 |
void handle_local_done(Msg *m); |
| 64 |
|
| 65 |
JobList m_rememberedJobs; |
| 66 |
MsgChannel *m_scheduler{nullptr}; |
| 67 |
|
| 68 |
DiscoverSched *m_discover{nullptr}; |
| 69 |
QSocketNotifier *m_fd_notify{nullptr}; |
| 70 |
QSocketNotifier::Type m_fd_type{QSocketNotifier::Exception}; |
| 71 |
}; |
| 72 |
|
| 73 |
#endif // ICEMON_ICECREAMMONITOR_H |
| 74 |
|
| 75 |
// vim:ts=4:sw=4:noet |