Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
systeminfo.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
12
namespace
System
13
{
14
enum
PlatformType
15
{
16
Win32
,
17
Linux
,
18
19
UnknownPlatform
,
20
};
21
22
enum
CpuArchType
23
{
24
X86_32
,
// any 32-bit x86
25
X86_64
,
// any 64-bit x86
26
27
UnknownCpuType
,
28
};
29
31
inline
const
char
*
32
PlatformTypeAsString
(
PlatformType
p)
33
{
34
switch
(p)
35
{
36
case
Win32
:
return
"win32"
;
37
case
Linux
:
return
"linux"
;
38
default
:
return
"unknownplatform"
;
39
}
40
}
41
43
inline
const
char
*
44
CpuArchTypeAsString
(
CpuArchType
cpu)
45
{
46
switch
(cpu)
47
{
48
case
X86_32
:
return
"x86_32"
;
49
case
X86_64
:
return
"x86_64"
;
50
default
:
return
"unknowncputype"
;
51
}
52
}
53
54
extern
CpuArchType
CpuArch
;
55
extern
PlatformType
Platform
;
56
extern
SizeT
NumCpuCores
;
57
extern
SizeT
PageSize
;
58
59
}
60
#if __WIN32__
61
#include "
system/win32/win32systeminfo.h
"
62
namespace
System
63
{
64
class
SystemInfo :
public
Win32::Win32SystemInfo {};
65
}
66
#elif __linux__ || __APPLE__
67
#include "
system/posix/posixsysteminfo.h
"
68
namespace
System
69
{
70
class
SystemInfo :
public
Posix::PosixSystemInfo {};
71
}
72
#else
73
#error "System::SystemInfo not implemented on this platform!"
74
#endif
75
//------------------------------------------------------------------------------
Linux
Definition
linuxcompletioncounter.h:15
System
Definition
osxsysfunc.h:15
System::PlatformTypeAsString
const char * PlatformTypeAsString(PlatformType p)
convert platform to string
Definition
systeminfo.h:32
System::NumCpuCores
SizeT NumCpuCores
Definition
posixsysteminfo.cc:13
System::PlatformType
PlatformType
Definition
systeminfo.h:15
System::UnknownPlatform
@ UnknownPlatform
Definition
systeminfo.h:19
System::PageSize
SizeT PageSize
Definition
posixsysteminfo.cc:14
System::Platform
PlatformType Platform
Definition
posixsysteminfo.cc:12
System::CpuArchType
CpuArchType
Definition
systeminfo.h:23
System::X86_32
@ X86_32
Definition
systeminfo.h:24
System::X86_64
@ X86_64
Definition
systeminfo.h:25
System::UnknownCpuType
@ UnknownCpuType
Definition
systeminfo.h:27
System::CpuArchTypeAsString
const char * CpuArchTypeAsString(CpuArchType cpu)
convert CpuType to string
Definition
systeminfo.h:44
System::CpuArch
CpuArchType CpuArch
Definition
posixsysteminfo.cc:11
Win32
[TODO: Describe Win32 subsystem]
posixsysteminfo.h
SizeT
int SizeT
Definition
types.h:42
win32systeminfo.h
code
foundation
system
systeminfo.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.