Data class that contains information about the system's memory and swap space, in Kilobytes.
More...
#include <SystemMemoryInformation.h>
|
| | SystemMemoryInformation () |
| | Builds an empty SystemMemoryInformation with all fields zeroed. More...
|
| |
| | SystemMemoryInformation (const long systemMemoryTotalInKB, const long systemMemoryFreeInKB, const long systemMemoryAvailableInKB, const long systemSwapMemoryTotalInKB, const long systemSwapMemoryFreeInKB) |
| | Builds a SystemMemoryInformation from raw memory and swap figures, computing the derived percentages. More...
|
| |
| virtual | ~SystemMemoryInformation ()=default |
| | Defaulted destructor. More...
|
| |
| std::string | ToString () const |
| | Serializes the memory and swap figures and their derived percentages to a string. More...
|
| |
| long | GetSystemMemoryTotalInKB () const |
| | Gets the total system memory, in KB. More...
|
| |
| long | GetSystemMemoryFreeInKB () const |
| | Gets the free system memory, in KB. More...
|
| |
| long | GetSystemMemoryAvailableInKB () const |
| | Gets the available system memory, in KB. More...
|
| |
| float | GetAvailableMemoryPercent () const |
| | Gets the percent of system memory available. More...
|
| |
| long | GetSystemSwapMemoryTotalInKB () const |
| | Gets the total swap memory, in KB. More...
|
| |
| long | GetSystemSwapMemoryFreeInKB () const |
| | Gets the free swap memory, in KB. More...
|
| |
| float | GetSwapMemoryUsedPercent () const |
| | Gets the percent of swap memory used. More...
|
| |
| void | SetSystemMemoryTotalInKB (const long systemMemoryTotalInKB) |
| | Sets the total system memory (in KB) and recomputes the derived percentages. More...
|
| |
| void | SetSystemMemoryFreeInKB (const long systemMemoryFreeInKB) |
| | Sets the free system memory, in KB. More...
|
| |
| void | SetSystemMemoryAvailableInKB (const long systemMemoryAvailableInKB) |
| | Sets the available system memory (in KB) and recomputes the derived percentages. More...
|
| |
| void | SetSystemSwapMemoryTotalInKB (const long systemSwapMemoryTotalInKB) |
| | Sets the total swap memory (in KB) and recomputes the derived percentages. More...
|
| |
| void | SetSystemSwapMemoryFreeInKB (const long systemSwapMemoryFreeInKB) |
| | Sets the free swap memory (in KB) and recomputes the derived percentages. More...
|
| |
|
| void | CalculatePercentages () |
| | Recomputes the available-memory percent and the used-swap percent from the current memory and swap figures. More...
|
| |
Data class that contains information about the system's memory and swap space, in Kilobytes.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
◆ SystemMemoryInformation() [1/2]
| RumPi::SystemMemoryInformation::SystemMemoryInformation |
( |
| ) |
|
◆ SystemMemoryInformation() [2/2]
| RumPi::SystemMemoryInformation::SystemMemoryInformation |
( |
const long |
systemMemoryTotalInKB, |
|
|
const long |
systemMemoryFreeInKB, |
|
|
const long |
systemMemoryAvailableInKB, |
|
|
const long |
systemSwapMemoryTotalInKB, |
|
|
const long |
systemSwapMemoryFreeInKB |
|
) |
| |
Builds a SystemMemoryInformation from raw memory and swap figures, computing the derived percentages.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
- Parameters
-
| [in] | systemMemoryTotalInKB | Total system memory, in KB. |
| [in] | systemMemoryFreeInKB | Free system memory, in KB. |
| [in] | systemMemoryAvailableInKB | Available system memory, in KB. |
| [in] | systemSwapMemoryTotalInKB | Total swap memory, in KB. |
| [in] | systemSwapMemoryFreeInKB | Free swap memory, in KB. |
◆ ~SystemMemoryInformation()
| virtual RumPi::SystemMemoryInformation::~SystemMemoryInformation |
( |
| ) |
|
|
virtualdefault |
Defaulted destructor.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
◆ CalculatePercentages()
| void RumPi::SystemMemoryInformation::CalculatePercentages |
( |
| ) |
|
|
protected |
Recomputes the available-memory percent and the used-swap percent from the current memory and swap figures.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
◆ GetAvailableMemoryPercent()
| float RumPi::SystemMemoryInformation::GetAvailableMemoryPercent |
( |
| ) |
const |
Gets the percent of system memory available.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
float percent = info.GetAvailableMemoryPercent();
- Returns
- The available memory, as a percent.
◆ GetSwapMemoryUsedPercent()
| float RumPi::SystemMemoryInformation::GetSwapMemoryUsedPercent |
( |
| ) |
const |
Gets the percent of swap memory used.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
float percent = info.GetSwapMemoryUsedPercent();
- Returns
- The used swap memory, as a percent.
◆ GetSystemMemoryAvailableInKB()
| long RumPi::SystemMemoryInformation::GetSystemMemoryAvailableInKB |
( |
| ) |
const |
Gets the available system memory, in KB.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
long available = info.GetSystemMemoryAvailableInKB();
- Returns
- The available system memory, in KB.
◆ GetSystemMemoryFreeInKB()
| long RumPi::SystemMemoryInformation::GetSystemMemoryFreeInKB |
( |
| ) |
const |
Gets the free system memory, in KB.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
long free = info.GetSystemMemoryFreeInKB();
- Returns
- The free system memory, in KB.
◆ GetSystemMemoryTotalInKB()
| long RumPi::SystemMemoryInformation::GetSystemMemoryTotalInKB |
( |
| ) |
const |
Gets the total system memory, in KB.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
long total = info.GetSystemMemoryTotalInKB();
- Returns
- The total system memory, in KB.
◆ GetSystemSwapMemoryFreeInKB()
| long RumPi::SystemMemoryInformation::GetSystemSwapMemoryFreeInKB |
( |
| ) |
const |
Gets the free swap memory, in KB.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
long swapFree = info.GetSystemSwapMemoryFreeInKB();
- Returns
- The free swap memory, in KB.
◆ GetSystemSwapMemoryTotalInKB()
| long RumPi::SystemMemoryInformation::GetSystemSwapMemoryTotalInKB |
( |
| ) |
const |
Gets the total swap memory, in KB.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
long swapTotal = info.GetSystemSwapMemoryTotalInKB();
- Returns
- The total swap memory, in KB.
◆ SetSystemMemoryAvailableInKB()
| void RumPi::SystemMemoryInformation::SetSystemMemoryAvailableInKB |
( |
const long |
systemMemoryAvailableInKB | ) |
|
Sets the available system memory (in KB) and recomputes the derived percentages.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
info.SetSystemMemoryAvailableInKB(2048000);
- Parameters
-
| [in] | systemMemoryAvailableInKB | The available system memory, in KB. |
◆ SetSystemMemoryFreeInKB()
| void RumPi::SystemMemoryInformation::SetSystemMemoryFreeInKB |
( |
const long |
systemMemoryFreeInKB | ) |
|
Sets the free system memory, in KB.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
info.SetSystemMemoryFreeInKB(512000);
- Parameters
-
| [in] | systemMemoryFreeInKB | The free system memory, in KB. |
◆ SetSystemMemoryTotalInKB()
| void RumPi::SystemMemoryInformation::SetSystemMemoryTotalInKB |
( |
const long |
systemMemoryTotalInKB | ) |
|
Sets the total system memory (in KB) and recomputes the derived percentages.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
info.SetSystemMemoryTotalInKB(4096000);
- Parameters
-
| [in] | systemMemoryTotalInKB | The total system memory, in KB. |
◆ SetSystemSwapMemoryFreeInKB()
| void RumPi::SystemMemoryInformation::SetSystemSwapMemoryFreeInKB |
( |
const long |
systemSwapMemoryFreeInKB | ) |
|
Sets the free swap memory (in KB) and recomputes the derived percentages.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
info.SetSystemSwapMemoryFreeInKB(512000);
- Parameters
-
| [in] | systemSwapMemoryFreeInKB | The free swap memory, in KB. |
◆ SetSystemSwapMemoryTotalInKB()
| void RumPi::SystemMemoryInformation::SetSystemSwapMemoryTotalInKB |
( |
const long |
systemSwapMemoryTotalInKB | ) |
|
Sets the total swap memory (in KB) and recomputes the derived percentages.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
info.SetSystemSwapMemoryTotalInKB(1024000);
- Parameters
-
| [in] | systemSwapMemoryTotalInKB | The total swap memory, in KB. |
◆ ToString()
| std::string RumPi::SystemMemoryInformation::ToString |
( |
| ) |
const |
Serializes the memory and swap figures and their derived percentages to a string.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
std::string data = info.ToString();
- Returns
- A multi-line string describing the system memory information.
◆ myAvailableMemoryPercent
| float RumPi::SystemMemoryInformation::myAvailableMemoryPercent |
|
protected |
Percent of system memory available (computed).
◆ mySwapMemoryUsedPercent
| float RumPi::SystemMemoryInformation::mySwapMemoryUsedPercent |
|
protected |
Percent of swap memory used (computed).
◆ mySystemMemoryAvailableInKB
| long RumPi::SystemMemoryInformation::mySystemMemoryAvailableInKB |
|
protected |
Available system memory, in KB.
◆ mySystemMemoryFreeInKB
| long RumPi::SystemMemoryInformation::mySystemMemoryFreeInKB |
|
protected |
Free system memory, in KB.
◆ mySystemMemoryTotalInKB
| long RumPi::SystemMemoryInformation::mySystemMemoryTotalInKB |
|
protected |
Total system memory, in KB.
◆ mySystemSwapMemoryFreeInKB
| long RumPi::SystemMemoryInformation::mySystemSwapMemoryFreeInKB |
|
protected |
◆ mySystemSwapMemoryTotalInKB
| long RumPi::SystemMemoryInformation::mySystemSwapMemoryTotalInKB |
|
protected |
Total swap memory, in KB.
The documentation for this class was generated from the following files: