Skip to content
Skip to link menu
Trinity API Reference
Trinity API Reference
superkaramba
superkaramba
superkaramba
src
memsensor.h
1
/***************************************************************************
2
* Copyright (C) 2003 by Hans Karlsson *
3
* karlsson.h@home.se *
4
* *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
9
***************************************************************************/
10
#ifndef MEMSENSOR_H
11
#define MEMSENSOR_H
12
#include "sensor.h"
13
#include <tqglobal.h>
14
#include <tqstring.h>
15
#include <tqregexp.h>
16
#include <tdeprocess.h>
17
18
#ifdef __FreeBSD__
19
#include <tdeprocio.h>
20
#include <kvm.h>
21
#include <osreldate.h>
22
#endif
23
24
class
MemSensor :
public
Sensor
25
{
26
TQ_OBJECT
27
28
public
:
29
30
MemSensor(
int
interval );
31
~MemSensor();
32
33
int
getMemTotal();
34
int
getMemFree();
35
int
getBuffers();
36
int
getCached();
37
38
int
getSwapTotal();
39
int
getSwapFree();
40
41
void
update();
42
void
setMaxValue(
SensorParams
*sp );
43
TQString getMemLine();
44
45
private
:
46
TQString meminfo;
47
void
readValues();
48
#if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
49
int
pageshift;
/* log base 2 of the pagesize */
50
TQString sensorResult;
51
int
swapTotal;
52
int
swapUsed;
53
# if defined(Q_OS_FREEBSD) && defined(__FreeBSD_version) && __FreeBSD_version >= 500018
54
kvm_t *kd;
55
kvm_swap swapinfo;
56
# elif defined(Q_OS_FREEBSD)
57
KShellProcess ksp;
58
bool
MaxSet;
59
# endif
60
#endif
61
62
private
slots:
63
void
receivedStdout(TDEProcess *,
char
*buffer,
int
);
64
void
processExited(TDEProcess *);
65
66
};
67
68
#endif
// MEMSENSOR_H
SensorParams
Hans Karlsson.
Definition:
sensorparams.h:32
superkaramba
Skip menu "superkaramba"
Main Page
Alphabetical List
Class List
File List
Class Members
superkaramba
Skip menu "superkaramba"
kcalc
knumber
superkaramba