KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sysinfo.h
Go to the documentation of this file.
1
/*
2
* This program source code file is part of KiCad, a free EDA CAD application.
3
*
4
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef SYSINFO_H
21
#define SYSINFO_H
22
23
#include <cstdint>
24
#include <string>
25
#include <vector>
26
27
namespace
KIPLATFORM
28
{
29
struct
GPU_INFO
30
{
31
public
:
32
std::string
Name
;
33
long
long
MemorySize
;
34
std::string
DriverVersion
;
35
std::string
Manufacturer
;
36
};
37
38
struct
CPU_INFO
39
{
40
public
:
41
std::string
Name
;
42
std::string
Manufacturer
;
43
uint32_t
NumberCores
;
44
uint32_t
NumberLogical
;
45
};
46
47
struct
MEMORY_INFO
48
{
49
public
:
50
uint32_t
Usage
;
51
uint64_t
TotalPhysical
;
52
uint64_t
FreePhysical
;
53
uint64_t
TotalPaging
;
54
uint64_t
FreePaging
;
55
uint64_t
TotalVirtual
;
56
uint64_t
FreeVirtual
;
57
};
58
59
class
SYSINFO_BASE
60
{
61
public
:
69
virtual
bool
GetGPUInfo
( std::vector<GPU_INFO>& aGpuInfos ) = 0;
70
78
virtual
bool
GetCPUInfo
( std::vector<CPU_INFO>& aCpuInfos ) = 0;
79
87
virtual
bool
GetMemoryInfo
(
MEMORY_INFO
& aMemoryInfo ) = 0;
88
};
89
}
// namespace KIPLATFORM
90
91
#if defined( _WIN32 )
92
#include <
kiplatform/sysinfo_windows.h
>
93
#elif defined( __unix__ ) || defined( __unix )
94
#include <
kiplatform/sysinfo_gtk.h
>
95
#elif defined( __APPLE__ )
96
#include <
kiplatform/sysinfo_osx.h
>
97
#else
98
99
#endif
100
#endif
// SYSINFO_H
KIPLATFORM::SYSINFO_BASE
Definition
sysinfo.h:60
KIPLATFORM::SYSINFO_BASE::GetGPUInfo
virtual bool GetGPUInfo(std::vector< GPU_INFO > &aGpuInfos)=0
Retrieve GPU info for the system.
KIPLATFORM::SYSINFO_BASE::GetCPUInfo
virtual bool GetCPUInfo(std::vector< CPU_INFO > &aCpuInfos)=0
Retrieve CPU info for the system.
KIPLATFORM::SYSINFO_BASE::GetMemoryInfo
virtual bool GetMemoryInfo(MEMORY_INFO &aMemoryInfo)=0
Retrieve memory info for the system.
KIPLATFORM
Definition
app.h:28
KIPLATFORM::CPU_INFO
Definition
sysinfo.h:39
KIPLATFORM::CPU_INFO::Name
std::string Name
Definition
sysinfo.h:41
KIPLATFORM::CPU_INFO::NumberCores
uint32_t NumberCores
Definition
sysinfo.h:43
KIPLATFORM::CPU_INFO::NumberLogical
uint32_t NumberLogical
Definition
sysinfo.h:44
KIPLATFORM::CPU_INFO::Manufacturer
std::string Manufacturer
Definition
sysinfo.h:42
KIPLATFORM::GPU_INFO
Definition
sysinfo.h:30
KIPLATFORM::GPU_INFO::Name
std::string Name
Definition
sysinfo.h:32
KIPLATFORM::GPU_INFO::DriverVersion
std::string DriverVersion
Definition
sysinfo.h:34
KIPLATFORM::GPU_INFO::MemorySize
long long MemorySize
Definition
sysinfo.h:33
KIPLATFORM::GPU_INFO::Manufacturer
std::string Manufacturer
Definition
sysinfo.h:35
KIPLATFORM::MEMORY_INFO
Definition
sysinfo.h:48
KIPLATFORM::MEMORY_INFO::FreePhysical
uint64_t FreePhysical
Definition
sysinfo.h:52
KIPLATFORM::MEMORY_INFO::FreePaging
uint64_t FreePaging
Definition
sysinfo.h:54
KIPLATFORM::MEMORY_INFO::Usage
uint32_t Usage
Definition
sysinfo.h:50
KIPLATFORM::MEMORY_INFO::FreeVirtual
uint64_t FreeVirtual
Definition
sysinfo.h:56
KIPLATFORM::MEMORY_INFO::TotalPaging
uint64_t TotalPaging
Definition
sysinfo.h:53
KIPLATFORM::MEMORY_INFO::TotalVirtual
uint64_t TotalVirtual
Definition
sysinfo.h:55
KIPLATFORM::MEMORY_INFO::TotalPhysical
uint64_t TotalPhysical
Definition
sysinfo.h:51
sysinfo_gtk.h
sysinfo_osx.h
sysinfo_windows.h
src
libs
kiplatform
include
kiplatform
sysinfo.h
Generated on Fri Jun 26 2026 00:05:38 for KiCad PCB EDA Suite by
1.13.2