File indexing completed on 2024-05-12 17:00:15

0001 /*
0002     SPDX-FileCopyrightText: 2020 David Redondo <kde@david-redondo.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #ifndef BACKEND_H
0008 #define BACKEND_H
0009 
0010 namespace KSysGuard {
0011     class SensorContainer;
0012     class SensorObject;
0013     class SensorProperty;
0014 }
0015 
0016 class MemoryBackend {
0017 public:
0018     MemoryBackend(KSysGuard::SensorContainer *container);
0019     virtual ~MemoryBackend() = default;
0020 
0021     void initSensors();
0022     virtual void update() = 0;
0023 protected:
0024     virtual void makeSensors();
0025 
0026     KSysGuard::SensorProperty *m_total = nullptr;
0027     KSysGuard::SensorProperty *m_used = nullptr;
0028     KSysGuard::SensorProperty *m_free = nullptr;
0029     KSysGuard::SensorProperty *m_application = nullptr;
0030     KSysGuard::SensorProperty *m_cache = nullptr;
0031     KSysGuard::SensorProperty *m_buffer = nullptr;
0032     KSysGuard::SensorProperty *m_swapTotal = nullptr;
0033     KSysGuard::SensorProperty *m_swapUsed = nullptr;
0034     KSysGuard::SensorProperty *m_swapFree = nullptr;
0035     KSysGuard::SensorObject *m_physicalObject = nullptr;
0036     KSysGuard::SensorObject *m_swapObject = nullptr;
0037 };
0038 
0039 #endif