~lubuntu-dev/lxde/libsysstat-lxde

« back to all changes in this revision

Viewing changes to cpustat.hpp

  • Committer: Kuzma Shapran
  • Date: 2013-01-19 21:05:50 UTC
  • Revision ID: git-v1:11cc6ba1c2df1bcb25b8cd6cfc86c0a33e306b42
Style follows the Coding Standard

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* BEGIN_COMMON_COPYRIGHT_HEADER
2
 
 * (c)LGPL2+
3
 
**
4
 
**  SysStat is a Qt-based interface to system statistics
5
 
**
6
 
**  Authors:
7
 
**       Copyright (c) 2009 - 2012 Kuzma Shapran <Kuzma.Shapran@gmail.com>
8
 
**
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.
13
 
**
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.
18
 
**
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
23
 
**
24
 
** END_COMMON_COPYRIGHT_HEADER */
25
 
 
26
 
 
27
 
#ifndef LIBSYSSTAT__CPU_STAT__INCLUDED
28
 
#define LIBSYSSTAT__CPU_STAT__INCLUDED
29
 
 
30
 
 
31
 
#include <QtCore/QObject>
32
 
 
33
 
#include <sysstat/basestat.hpp>
34
 
 
35
 
 
36
 
namespace SysStat {
37
 
 
38
 
class CpuStatPrivate;
39
 
 
40
 
class SYSSTATSHARED_EXPORT CpuStat : public BaseStat
41
 
{
42
 
    Q_OBJECT
43
 
 
44
 
    Q_ENUMS(Monitoring)
45
 
 
46
 
public:
47
 
    enum Monitoring { LoadAndFrequency, LoadOnly, FrequencyOnly };
48
 
 
49
 
public:
50
 
    CpuStat(QObject *parent = NULL);
51
 
    ~CpuStat();
52
 
 
53
 
    void updateSources(void);
54
 
 
55
 
    uint minFreq(const QString &source) const;
56
 
    uint maxFreq(const QString &source) const;
57
 
 
58
 
signals:
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);
62
 
 
63
 
    void monitoringChanged(Monitoring);
64
 
 
65
 
public:
66
 
    Q_PROPERTY(Monitoring monitoring READ monitoring WRITE setMonitoring NOTIFY monitoringChanged)
67
 
 
68
 
public slots:
69
 
    Monitoring monitoring(void) const;
70
 
    void setMonitoring(Monitoring value);
71
 
 
72
 
protected:
73
 
    CpuStatPrivate* impl;
74
 
};
75
 
 
76
 
}
77
 
 
78
 
#endif //LIBSYSSTAT__CPU_STAT__INCLUDED