5 #ifndef CPUINFOIOGROUP_HPP_INCLUDE
6 #define CPUINFOIOGROUP_HPP_INCLUDE
22 const std::string &cpu_freq_max_path,
23 double cpu_freq_sticker);
49 int push_signal(
const std::string &signal_name,
int domain_type,
int domain_idx)
override;
53 int push_control(
const std::string &control_name,
int domain_type,
int domain_idx)
override;
63 double sample(
int batch_idx)
override;
67 void adjust(
int batch_idx,
double setting)
override;
79 double read_signal(
const std::string &signal_name,
int domain_type,
int domain_idx)
override;
83 void write_control(
const std::string &control_name,
int domain_type,
int domain_idx,
double setting)
override;
96 std::function<double(
const std::vector<double> &)>
agg_function(
const std::string &signal_name)
const override;
100 std::function<std::string(
double)>
format_function(
const std::string &signal_name)
const override;
116 void save_control(
const std::string &save_path)
override;
122 std::string
name(
void)
const override;
134 void register_signal_alias(
const std::string &alias_name,
const std::string &signal_name);
136 struct m_signal_info_s {
139 std::function<double(
const std::vector<double> &)>
agg_function;
140 std::string description;
142 std::map<std::string, m_signal_info_s> m_signal_available;
IOGroup that provides constants for CPU frequency limits as signals for PlatformIO.
Definition: CpuinfoIOGroup.hpp:18
std::string name(void) const override
Definition: CpuinfoIOGroup.cpp:323
void write_control(const std::string &control_name, int domain_type, int domain_idx, double setting) override
Should not be called; this IOGroup does not provide any controls.
Definition: CpuinfoIOGroup.cpp:246
std::string control_description(const std::string &control_name) const override
Does nothing; this IOGroup does not provide any controls.
Definition: CpuinfoIOGroup.cpp:308
void adjust(int batch_idx, double setting) override
Should not be called; this IOGroup does not provide any controls.
Definition: CpuinfoIOGroup.cpp:225
void write_batch(void) override
Does nothing; this IOGroup does not provide any controls.
Definition: CpuinfoIOGroup.cpp:205
bool is_valid_signal(const std::string &signal_name) const override
Definition: CpuinfoIOGroup.cpp:149
void save_control(void) override
Does nothing; this IOGroup does not provide any controls.
Definition: CpuinfoIOGroup.cpp:252
void restore_control(void) override
Does nothing; this IOGroup does not provide any controls.
Definition: CpuinfoIOGroup.cpp:257
std::set< std::string > control_names(void) const override
Definition: CpuinfoIOGroup.cpp:144
int control_domain_type(const std::string &control_name) const override
Definition: CpuinfoIOGroup.cpp:175
std::set< std::string > signal_names(void) const override
Definition: CpuinfoIOGroup.cpp:135
virtual ~CpuinfoIOGroup()=default
int push_control(const std::string &control_name, int domain_type, int domain_idx) override
Should not be called; this IOGroup does not provide any controls.
Definition: CpuinfoIOGroup.cpp:195
void read_batch(void) override
Does nothing; this IOGroup's signals are constant.
Definition: CpuinfoIOGroup.cpp:201
double read_signal(const std::string &signal_name, int domain_type, int domain_idx) override
Definition: CpuinfoIOGroup.cpp:231
std::function< double(const std::vector< double > &)> agg_function(const std::string &signal_name) const override
For all valid signals in this IOGroup, the aggregation function is expect_same()
Definition: CpuinfoIOGroup.cpp:262
CpuinfoIOGroup()
Definition: CpuinfoIOGroup.cpp:63
int push_signal(const std::string &signal_name, int domain_type, int domain_idx) override
Definition: CpuinfoIOGroup.cpp:180
std::function< std::string(double)> format_function(const std::string &signal_name) const override
Definition: CpuinfoIOGroup.cpp:272
std::string signal_description(const std::string &signal_name) const override
Definition: CpuinfoIOGroup.cpp:282
static std::string plugin_name(void)
Definition: CpuinfoIOGroup.cpp:328
int signal_behavior(const std::string &signal_name) const override
Definition: CpuinfoIOGroup.cpp:313
int signal_domain_type(const std::string &signal_name) const override
Definition: CpuinfoIOGroup.cpp:159
static std::unique_ptr< IOGroup > make_plugin(void)
Definition: CpuinfoIOGroup.cpp:333
double sample(int batch_idx) override
Definition: CpuinfoIOGroup.cpp:209
bool is_valid_control(const std::string &control_name) const override
Definition: CpuinfoIOGroup.cpp:154
Definition: IOGroup.hpp:21