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 (C) 2024 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, you may find one here:
18
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19
* or you may search the http://www.gnu.org website for the version 2 license,
20
* or you may write to the Free Software Foundation, Inc.,
21
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22
*/
23
24
#ifndef SYSINFO_H
25
#define SYSINFO_H
26
27
#include <cstdint>
28
#include <string>
29
#include <vector>
30
31
namespace
KIPLATFORM
32
{
33
struct
GPU_INFO
34
{
35
public
:
36
std::string
Name
;
37
long
long
MemorySize
;
38
std::string
DriverVersion
;
39
std::string
Manufacturer
;
40
};
41
42
struct
CPU_INFO
43
{
44
public
:
45
std::string
Name
;
46
std::string
Manufacturer
;
47
uint32_t
NumberCores
;
48
uint32_t
NumberLogical
;
49
};
50
51
struct
MEMORY_INFO
52
{
53
public
:
54
uint32_t
Usage
;
55
uint64_t
TotalPhysical
;
56
uint64_t
FreePhysical
;
57
uint64_t
TotalPaging
;
58
uint64_t
FreePaging
;
59
uint64_t
TotalVirtual
;
60
uint64_t
FreeVirtual
;
61
};
62
63
class
SYSINFO_BASE
64
{
65
public
:
73
virtual
bool
GetGPUInfo
( std::vector<GPU_INFO>& aGpuInfos ) = 0;
74
82
virtual
bool
GetCPUInfo
( std::vector<CPU_INFO>& aCpuInfos ) = 0;
83
91
virtual
bool
GetMemoryInfo
(
MEMORY_INFO
& aMemoryInfo ) = 0;
92
};
93
}
// namespace KIPLATFORM
94
95
#if defined( _WIN32 )
96
#include <
kiplatform/sysinfo_windows.h
>
97
#elif defined( __unix__ ) || defined( __unix )
98
#include <
kiplatform/sysinfo_gtk.h
>
99
#elif defined( __APPLE__ )
100
#include <
kiplatform/sysinfo_osx.h
>
101
#else
102
103
#endif
104
#endif
// SYSINFO_H
KIPLATFORM::SYSINFO_BASE
Definition:
sysinfo.h:64
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:43
KIPLATFORM::CPU_INFO::Name
std::string Name
Definition:
sysinfo.h:45
KIPLATFORM::CPU_INFO::NumberCores
uint32_t NumberCores
Definition:
sysinfo.h:47
KIPLATFORM::CPU_INFO::NumberLogical
uint32_t NumberLogical
Definition:
sysinfo.h:48
KIPLATFORM::CPU_INFO::Manufacturer
std::string Manufacturer
Definition:
sysinfo.h:46
KIPLATFORM::GPU_INFO
Definition:
sysinfo.h:34
KIPLATFORM::GPU_INFO::Name
std::string Name
Definition:
sysinfo.h:36
KIPLATFORM::GPU_INFO::DriverVersion
std::string DriverVersion
Definition:
sysinfo.h:38
KIPLATFORM::GPU_INFO::MemorySize
long long MemorySize
Definition:
sysinfo.h:37
KIPLATFORM::GPU_INFO::Manufacturer
std::string Manufacturer
Definition:
sysinfo.h:39
KIPLATFORM::MEMORY_INFO
Definition:
sysinfo.h:52
KIPLATFORM::MEMORY_INFO::FreePhysical
uint64_t FreePhysical
Definition:
sysinfo.h:56
KIPLATFORM::MEMORY_INFO::FreePaging
uint64_t FreePaging
Definition:
sysinfo.h:58
KIPLATFORM::MEMORY_INFO::Usage
uint32_t Usage
Definition:
sysinfo.h:54
KIPLATFORM::MEMORY_INFO::FreeVirtual
uint64_t FreeVirtual
Definition:
sysinfo.h:60
KIPLATFORM::MEMORY_INFO::TotalPaging
uint64_t TotalPaging
Definition:
sysinfo.h:57
KIPLATFORM::MEMORY_INFO::TotalVirtual
uint64_t TotalVirtual
Definition:
sysinfo.h:59
KIPLATFORM::MEMORY_INFO::TotalPhysical
uint64_t TotalPhysical
Definition:
sysinfo.h:55
sysinfo_gtk.h
sysinfo_osx.h
sysinfo_windows.h
src
libs
kiplatform
include
kiplatform
sysinfo.h
Generated on Sun Nov 24 2024 00:04:52 for KiCad PCB EDA Suite by
1.9.6