File indexing completed on 2024-12-08 04:27:14

0001 /*
0002 SPDX-FileCopyrightText: 2022 Eric Jiang <erjiang@alumni.iu.edu>
0003 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 */
0005 
0006 #pragma once
0007 
0008 class SysMemInfo
0009 {
0010 public:
0011     static SysMemInfo getMemoryInfo();
0012     bool isSuccessful() { return m_successful; }
0013     int availableMemory() { return m_availableMemory; }
0014     int totalMemory() { return m_totalMemory; }
0015 
0016 private:
0017     bool m_successful;
0018     int m_availableMemory;
0019     int m_totalMemory;
0020     SysMemInfo(bool successful, int availableMemory, int totalMemory)
0021     {
0022         this->m_successful = successful;
0023         this->m_availableMemory = availableMemory;
0024         this->m_totalMemory = totalMemory;
0025     }
0026 };