mirror of
https://github.com/oguzhaninan/Stacer.git
synced 2025-12-23 23:18:31 -05:00
43 lines
716 B
C++
43 lines
716 B
C++
#ifndef MEMORYINFO_H
|
|
#define MEMORYINFO_H
|
|
|
|
#include <QObject>
|
|
|
|
#include <QDebug>
|
|
#include "Utils/file_util.h"
|
|
|
|
#define PROC_MEMINFO "/proc/meminfo"
|
|
|
|
#include "stacer-core_global.h"
|
|
|
|
class STACERCORESHARED_EXPORT MemoryInfo : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MemoryInfo();
|
|
|
|
void updateMemoryInfo();
|
|
|
|
quint64 getMemTotal() const;
|
|
quint64 getMemAvailable() const;
|
|
quint64 getMemUsed() const;
|
|
|
|
quint64 getSwapTotal() const;
|
|
quint64 getSwapFree() const;
|
|
quint64 getSwapUsed() const;
|
|
|
|
private:
|
|
// memory
|
|
quint64 memTotal;
|
|
quint64 memAvailable;
|
|
quint64 memUsed;
|
|
|
|
// swap
|
|
quint64 swapTotal;
|
|
quint64 swapFree;
|
|
quint64 swapUsed;
|
|
};
|
|
|
|
#endif // MEMORYINFO_H
|