• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • @topname@
  • Sitemap
  • Contact Us
 

superkaramba

memsensor.h

00001 /***************************************************************************
00002  *   Copyright (C) 2003 by Hans Karlsson                                   *
00003  *   karlsson.h@home.se                                                      *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 #ifndef MEMSENSOR_H
00011 #define MEMSENSOR_H
00012 #include "sensor.h"
00013 #include <tqglobal.h>
00014 #include <tqstring.h>
00015 #include <tqregexp.h>
00016 #include <kprocess.h>
00017 
00018 #ifdef __FreeBSD__
00019 #include <kprocio.h>
00020 #include <kvm.h>
00021 #include <osreldate.h>
00022 #endif
00023 
00024 class MemSensor :  public Sensor
00025 {
00026 Q_OBJECT
00027 public:
00028 
00029   MemSensor( int interval );
00030   ~MemSensor();
00031 
00032   int getMemTotal();
00033   int getMemFree();
00034   int getBuffers();
00035   int getCached();
00036 
00037   int getSwapTotal();
00038   int getSwapFree();
00039 
00040   void update();
00041   void setMaxValue( SensorParams *sp );
00042   TQString getMemLine();
00043 
00044 private:
00045   TQString meminfo;
00046   void readValues();
00047 #if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
00048   int pageshift;           /* log base 2 of the pagesize */
00049   TQString sensorResult;
00050   int swapTotal;
00051   int swapUsed;
00052 # if defined(Q_OS_FREEBSD) && defined(__FreeBSD_version) && __FreeBSD_version >= 500018
00053   kvm_t *kd;
00054   kvm_swap swapinfo;
00055 # elif defined(Q_OS_FREEBSD)
00056   KShellProcess ksp;
00057   bool MaxSet;
00058 # endif
00059 #endif
00060 
00061 private slots:
00062     void receivedStdout(KProcess *, char *buffer, int);
00063     void processExited(KProcess *);
00064 
00065 };
00066 
00067 #endif // MEMSENSOR_H

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

@topname@

Skip menu "@topname@"
  • kcalc
  •   knumber
  • superkaramba
Generated for @topname@ by doxygen 1.5.6
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal