Kaspersky Neuromorphic Platform  1.0.0
API Reference
Loading...
Searching...
No Matches
cpu.h
Go to the documentation of this file.
1
22#pragma once
23
24#include <knp/core/device.h>
25#include <knp/core/impexp.h>
26
27#include <memory>
28#include <string>
29#include <vector>
30
31
41{
42
46class CpuPower;
47
51class KNP_DECLSPEC CPU : public knp::core::Device // cppcheck-suppress class_X_Y
52{
53public:
57 CPU(const CPU &) = delete;
58
62 CPU &operator=(const CPU &) = delete;
63
67 CPU(CPU &&);
68
73 CPU &operator=(CPU &&) noexcept;
74
78 ~CPU() override;
79
80public:
85 [[nodiscard]] knp::core::DeviceType get_type() const override;
86
91 [[nodiscard]] const std::string &get_name() const override;
92
97 [[nodiscard]] uint32_t get_socket_number() const;
98
103 [[nodiscard]] float get_power() const override;
104
105private:
109 explicit CPU(uint32_t cpu_num);
110 friend KNP_DECLSPEC std::vector<CPU> list_processors();
111
112private:
113 uint32_t cpu_num_;
114 // Non const, because of move operator.
115 // cppcheck-suppress unusedStructMember
116 std::string cpu_name_;
117 mutable std::unique_ptr<CpuPower> power_meter_;
118};
119
120
125KNP_DECLSPEC std::vector<CPU> list_processors();
126
127} // namespace knp::devices::cpu
The CPU class is a definition of an interface to the CPU device.
Definition cpu.h:52
CPU(CPU &&)
CPU device move constructor.
CPU & operator=(CPU &&) noexcept
CPU device move operator.
CPU & operator=(const CPU &)=delete
Avoid copy assignment of a CPU device.
CPU(const CPU &)=delete
Avoid copy of a CPU device.
Class definition for device base class.
CPU device namespace.
Definition cpu.h:41