// Copyright Leon Freist // Author Leon Freist #pragma once #include #include #include namespace hwinfo { class Socket; class CPU { friend std::vector getAllSockets(); friend class Socket; public: ~CPU() = default; const std::string& modelName() const; const std::string& vendor() const; int64_t cacheSize_Bytes() const; int numPhysicalCores() const; int numLogicalCores() const; int64_t maxClockSpeed_MHz() const; int64_t regularClockSpeed_MHz() const; int64_t minClockSpeed_MHz() const; int64_t currentClockSpeed_MHz() const; const std::vector& flags() const; int id() const; private: CPU() = default; std::string _modelName; std::string _vendor; int _numPhysicalCores{-1}; int _numLogicalCores{-1}; int64_t _maxClockSpeed_MHz{-1}; int64_t _regularClockSpeed_MHz{-1}; int64_t _minClockSpeed_MHz{-1}; int64_t _cacheSize_Bytes{-1}; std::vector _flags{}; int _core_id{-1}; }; class Socket { friend std::vector getAllSockets(); public: ~Socket() = default; const class CPU& CPU() const; int id() const; private: explicit Socket(class CPU cpu); int _id{-1}; class CPU _cpu; }; std::vector getAllSockets(); } // namespace hwinfo