1
/* BEGIN_COMMON_COPYRIGHT_HEADER
4
** SysStat is a Qt-based interface to system statistics
7
** Copyright (c) 2009 - 2012 Kuzma Shapran <Kuzma.Shapran@gmail.com>
9
** This library is free software; you can redistribute it and/or
10
** modify it under the terms of the GNU Lesser General Public
11
** License as published by the Free Software Foundation; either
12
** version 2.1 of the License, or (at your option) any later version.
14
** This library is distributed in the hope that it will be useful,
15
** but WITHOUT ANY WARRANTY; without even the implied warranty of
16
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
** Lesser General Public License for more details.
19
** You should have received a copy of the GNU Lesser General Public
20
** License along with this library;
21
** if not, write to the Free Software Foundation, Inc.,
22
** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24
** END_COMMON_COPYRIGHT_HEADER */
27
#ifndef LIBSYSSTAT__CPU_STAT__INCLUDED
28
#define LIBSYSSTAT__CPU_STAT__INCLUDED
31
#include <QtCore/QObject>
33
#include <sysstat/basestat.hpp>
40
class SYSSTATSHARED_EXPORT CpuStat : public BaseStat
47
enum Monitoring { LoadAndFrequency, LoadOnly, FrequencyOnly };
50
CpuStat(QObject *parent = NULL);
53
void updateSources(void);
55
uint minFreq(const QString &source) const;
56
uint maxFreq(const QString &source) const;
59
void update(float user, float nice, float system, float other, float frequencyRate, uint frequency);
60
void update(float user, float nice, float system, float other);
61
void update(uint frequency);
63
void monitoringChanged(Monitoring);
66
Q_PROPERTY(Monitoring monitoring READ monitoring WRITE setMonitoring NOTIFY monitoringChanged)
69
Monitoring monitoring(void) const;
70
void setMonitoring(Monitoring value);
78
#endif //LIBSYSSTAT__CPU_STAT__INCLUDED