Nebula
Loading...
Searching...
No Matches
systeminfo.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
12namespace System
13{
21
23{
24 X86_32, // any 32-bit x86
25 X86_64, // any 64-bit x86
26
28};
29
31inline const char*
33{
34 switch (p)
35 {
36 case Win32: return "win32";
37 case Linux: return "linux";
38 default: return "unknownplatform";
39 }
40}
41
43inline const char*
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
54extern CpuArchType CpuArch;
56extern SizeT NumCpuCores;
57extern SizeT PageSize;
58
59}
60#if __WIN32__
62namespace System
63{
64class SystemInfo : public Win32::Win32SystemInfo {};
65}
66#elif __linux__
68namespace System
69{
70class SystemInfo : public Posix::PosixSystemInfo {};
71}
72#else
73#error "System::SystemInfo not implemented on this platform!"
74#endif
75//------------------------------------------------------------------------------
Provide information about the system we're running on.
Definition posixsysteminfo.h:14
Provides information about the host system.
Provide information about the system we're running on.
Definition win32systeminfo.h:17
Definition osxsysfunc.h:15
const char * PlatformTypeAsString(PlatformType p)
convert platform to string
Definition systeminfo.h:32
SizeT NumCpuCores
Definition posixsysteminfo.cc:13
PlatformType
Definition systeminfo.h:15
@ UnknownPlatform
Definition systeminfo.h:19
@ Win32
Definition systeminfo.h:16
@ Linux
Definition systeminfo.h:17
SizeT PageSize
Definition posixsysteminfo.cc:14
PlatformType Platform
Definition posixsysteminfo.cc:12
CpuArchType
Definition systeminfo.h:23
@ X86_32
Definition systeminfo.h:24
@ X86_64
Definition systeminfo.h:25
@ UnknownCpuType
Definition systeminfo.h:27
const char * CpuArchTypeAsString(CpuArchType cpu)
convert CpuType to string
Definition systeminfo.h:44
CpuArchType CpuArch
Definition posixsysteminfo.cc:11
int SizeT
Definition types.h:49