Norbert's Game Engine v200
Loading...
Searching...
No Matches
eSystem Namespace Reference

Functions

const uint GetProcessorCount ()
 Get CPU count.
 
const uint64 GetRAMsize ()
 Get physical RAM size.
 
const uint64 GetAvailableRAMsize ()
 Get available physical RAM.
 
const uint64 GetVirtualRAMsize ()
 Get virtual RAM size.
 
const uint64 GetAvailableVirtualRAMsize ()
 Get available virtual RAM size.
 
const uint64 GetSpaceOnDisk ()
 Get physical space on disk.
 
const uint64 GetAvailableSpaceOnDisk ()
 Get available physical space on disc.
 

Detailed Description

Functions for getting system information

Function Documentation

◆ GetAvailableRAMsize()

const uint64 eSystem::GetAvailableRAMsize ( )

Get available physical RAM.

Definition at line 30 of file System.cpp.

31{
32 MEMORYSTATUSEX memSt;
33 memSt.dwLength = sizeof(memSt);
34
35 if (GlobalMemoryStatusEx(&memSt))
36 return memSt.ullAvailPhys / (1024 * 1024);
37 NGE_ASSERT(true);
38}

◆ GetAvailableSpaceOnDisk()

const uint64 eSystem::GetAvailableSpaceOnDisk ( )

Get available physical space on disc.

Definition at line 73 of file System.cpp.

74{
75 ULARGE_INTEGER freeBytesAvailable, totalNumberOfBytes, totalNumberOfFreeBytes;
76
77 if (GetDiskFreeSpaceEx(nullptr, &freeBytesAvailable, &totalNumberOfBytes, &totalNumberOfFreeBytes))
78 return freeBytesAvailable.QuadPart / (1024 * 1024);
79 NGE_ASSERT(true);
80}

◆ GetAvailableVirtualRAMsize()

const uint64 eSystem::GetAvailableVirtualRAMsize ( )

Get available virtual RAM size.

Definition at line 52 of file System.cpp.

53{
54 MEMORYSTATUSEX memSt;
55 memSt.dwLength = sizeof(memSt);
56
57 if (GlobalMemoryStatusEx(&memSt))
58 return memSt.ullAvailVirtual / (1024 * 1024);
59 NGE_ASSERT(true);
60}

◆ GetProcessorCount()

const uint eSystem::GetProcessorCount ( )

Get CPU count.

Definition at line 13 of file System.cpp.

14{
15 return (const uint)std::thread::hardware_concurrency();
16}

◆ GetRAMsize()

const uint64 eSystem::GetRAMsize ( )

Get physical RAM size.

Definition at line 19 of file System.cpp.

20{
21 MEMORYSTATUSEX memSt;
22 memSt.dwLength = sizeof(memSt);
23
24 if (GlobalMemoryStatusEx(&memSt))
25 return memSt.ullTotalPhys / (1024 * 1024);
26 NGE_ASSERT(true);
27}

◆ GetSpaceOnDisk()

const uint64 eSystem::GetSpaceOnDisk ( )

Get physical space on disk.

Definition at line 63 of file System.cpp.

64{
65 ULARGE_INTEGER freeBytesAvailable, totalNumberOfBytes, totalNumberOfFreeBytes;
66
67 if (GetDiskFreeSpaceEx(nullptr, &freeBytesAvailable, &totalNumberOfBytes, &totalNumberOfFreeBytes))
68 return totalNumberOfBytes.QuadPart / (1024 * 1024);
69 NGE_ASSERT(true);
70}

◆ GetVirtualRAMsize()

const uint64 eSystem::GetVirtualRAMsize ( )

Get virtual RAM size.

Definition at line 41 of file System.cpp.

42{
43 MEMORYSTATUSEX memSt;
44 memSt.dwLength = sizeof(memSt);
45
46 if (GlobalMemoryStatusEx(&memSt))
47 return memSt.ullTotalVirtual / (1024 * 1024);
48 NGE_ASSERT(true);
49}