CppCommon 1.0.5.0
C++ Common Library
Loading...
Searching...
No Matches
cpu.h
Go to the documentation of this file.
1
9#ifndef CPPCOMMON_SYSTEM_CPU_H
10#define CPPCOMMON_SYSTEM_CPU_H
11
12#include <cstdint>
13#include <string>
14
15namespace CppCommon {
16
18
24class CPU
25{
26public:
27 CPU() = delete;
28 CPU(const CPU&) = delete;
29 CPU(CPU&&) = delete;
30 ~CPU() = delete;
31
32 CPU& operator=(const CPU&) = delete;
33 CPU& operator=(CPU&&) = delete;
34
36 static std::string Architecture();
38 static int Affinity();
40 static int LogicalCores();
42 static int PhysicalCores();
44 static std::pair<int, int> TotalCores();
46 static int64_t ClockSpeed();
48 static bool HyperThreading();
49};
50
53} // namespace CppCommon
54
55#endif // CPPCOMMON_SYSTEM_CPU_H
CPU management static class.
Definition cpu.h:25
static int LogicalCores()
CPU logical cores count.
Definition cpu.cpp:123
static bool HyperThreading()
Is CPU Hyper-Threading enabled?
Definition cpu.cpp:269
CPU & operator=(CPU &&)=delete
static int Affinity()
CPU affinity count.
Definition cpu.cpp:95
static std::string Architecture()
CPU architecture string.
Definition cpu.cpp:52
CPU & operator=(const CPU &)=delete
CPU(const CPU &)=delete
static std::pair< int, int > TotalCores()
CPU total cores count.
Definition cpu.cpp:133
static int PhysicalCores()
CPU physical cores count.
Definition cpu.cpp:128
static int64_t ClockSpeed()
CPU clock speed in Hz.
Definition cpu.cpp:220
CPU(CPU &&)=delete
C++ Common project definitions.