Memorator/Memorator.h

30 lines
786 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*Ковалев Р.Е. 2021. rekovalev.site*/
#ifdef __linux__
#include <sys/sysinfo.h>
#endif
/*Класс для работы с информацией об оперативной памяти*/
class Memorator
{
public:
static unsigned long getTotalRam_B();
static unsigned long getTotalRam_KB();
static unsigned long getTotalRam_MB();
static unsigned long getFreeRam_B();
static unsigned long getFreeRam_KB();
static unsigned long getFreeRam_MB();
static unsigned long getTotalSwap_B();
static unsigned long getTotalSwap_KB();
static unsigned long getTotalSwap_MB();
static unsigned long getFreeSwap_B();
static unsigned long getFreeSwap_KB();
static unsigned long getFreeSwap_MB();
private:
static void ask();
#ifdef __linux__
static sysinfo info;
#endif
};