1 /* 2 SPDX-FileCopyrightText: 2020 David Redondo <kde@david-redondo.de> 3 4 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 */ 6 7 #ifndef BACKEND_H 8 #define BACKEND_H 9 10 namespace KSysGuard { 11 class SensorContainer; 12 class SensorObject; 13 class SensorProperty; 14 } 15 16 class MemoryBackend { 17 public: 18 MemoryBackend(KSysGuard::SensorContainer *container); 19 virtual ~MemoryBackend() = default; 20 21 void initSensors(); 22 virtual void update() = 0; 23 protected: 24 virtual void makeSensors(); 25 26 KSysGuard::SensorProperty *m_total = nullptr; 27 KSysGuard::SensorProperty *m_used = nullptr; 28 KSysGuard::SensorProperty *m_free = nullptr; 29 KSysGuard::SensorProperty *m_application = nullptr; 30 KSysGuard::SensorProperty *m_cache = nullptr; 31 KSysGuard::SensorProperty *m_buffer = nullptr; 32 KSysGuard::SensorProperty *m_swapTotal = nullptr; 33 KSysGuard::SensorProperty *m_swapUsed = nullptr; 34 KSysGuard::SensorProperty *m_swapFree = nullptr; 35 KSysGuard::SensorObject *m_physicalObject = nullptr; 36 KSysGuard::SensorObject *m_swapObject = nullptr; 37 }; 38 39 #endif 40