CppCommon  1.0.4.1
C++ Common Library
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 
15 namespace CppCommon {
16 
18 
24 class CPU
25 {
26 public:
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:114
static bool HyperThreading()
Is CPU Hyper-Threading enabled?
Definition: cpu.cpp:240
static int Affinity()
CPU affinity count.
Definition: cpu.cpp:93
static std::string Architecture()
CPU architecture string.
Definition: cpu.cpp:50
CPU & operator=(CPU &&)=delete
CPU(const CPU &)=delete
static std::pair< int, int > TotalCores()
CPU total cores count.
Definition: cpu.cpp:124
static int PhysicalCores()
CPU physical cores count.
Definition: cpu.cpp:119
static int64_t ClockSpeed()
CPU clock speed in Hz.
Definition: cpu.cpp:197
CPU & operator=(const CPU &)=delete
CPU(CPU &&)=delete
C++ Common project definitions.
Definition: token_bucket.h:15