5 #ifndef CNLIOGROUP_HPP_INCLUDE
6 #define CNLIOGROUP_HPP_INCLUDE
24 CNLIOGroup(
const std::string &pm_counters_path);
49 int push_signal(
const std::string &signal_name,
int domain_type,
50 int domain_idx)
override;
54 int push_control(
const std::string &control_name,
int domain_type,
55 int domain_idx)
override;
69 double sample(
int batch_idx)
override;
73 void adjust(
int batch_idx,
double setting)
override;
85 double read_signal(
const std::string &signal_name,
int domain_type,
86 int domain_idx)
override;
90 void write_control(
const std::string &control_name,
int domain_type,
91 int domain_idx,
double setting)
override;
101 std::function<double(
const std::vector<double> &)>
102 agg_function(
const std::string &signal_name)
const override;
106 std::function<std::string(
double)>
123 void save_control(
const std::string &save_path)
override;
129 std::string
name(
void)
const override;
141 void register_signal_alias(
const std::string &alias_name,
const std::string &signal_name);
143 struct m_signal_info_s {
144 std::string m_description;
145 std::function<double(
const std::vector<double> &)> m_agg_function;
146 std::function<std::string(
double)> m_format_function;
147 std::function<double()> m_read_function;
153 std::map<std::string, m_signal_info_s> m_signal_available;
155 double read_time(
const std::string &freshness_path)
const;
158 double m_initial_freshness;
159 double m_sample_rate;
IOGroup that wraps interfaces to Compute Node Linux.
Definition: CNLIOGroup.hpp:21
double sample(int batch_idx) override
Definition: CNLIOGroup.cpp:204
std::string signal_description(const std::string &signal_name) const override
Definition: CNLIOGroup.cpp:286
void write_batch(void) override
Does nothing; this IOGroup does not provide any controls.
Definition: CNLIOGroup.cpp:202
int control_domain_type(const std::string &control_name) const override
Definition: CNLIOGroup.cpp:163
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: CNLIOGroup.cpp:249
void adjust(int batch_idx, double setting) override
Should not be called; this IOGroup does not provide any controls.
Definition: CNLIOGroup.cpp:227
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: CNLIOGroup.cpp:186
int signal_domain_type(const std::string &signal_name) const override
Definition: CNLIOGroup.cpp:158
std::string control_description(const std::string &control_name) const override
Should not be called; this IOGroup does not provide any controls.
Definition: CNLIOGroup.cpp:312
std::set< std::string > signal_names(void) const override
Definition: CNLIOGroup.cpp:134
double read_signal(const std::string &signal_name, int domain_type, int domain_idx) override
Definition: CNLIOGroup.cpp:233
void restore_control(void) override
Does nothing; this IOGroup does not provide any controls.
Definition: CNLIOGroup.cpp:260
virtual ~CNLIOGroup()=default
void read_batch(void) override
Read all pushed signals from the platform so that the next call to sample() will reflect the updated ...
Definition: CNLIOGroup.cpp:193
std::set< std::string > control_names(void) const override
Definition: CNLIOGroup.cpp:143
int signal_behavior(const std::string &signal_name) const override
Definition: CNLIOGroup.cpp:320
std::string name(void) const override
Definition: CNLIOGroup.cpp:341
int push_signal(const std::string &signal_name, int domain_type, int domain_idx) override
Definition: CNLIOGroup.cpp:168
static std::string plugin_name(void)
Definition: CNLIOGroup.cpp:346
std::function< std::string(double)> format_function(const std::string &signal_name) const override
Definition: CNLIOGroup.cpp:275
bool is_valid_control(const std::string &control_name) const override
Definition: CNLIOGroup.cpp:153
bool is_valid_signal(const std::string &signal_name) const override
Definition: CNLIOGroup.cpp:148
CNLIOGroup()
Definition: CNLIOGroup.cpp:33
void save_control(void) override
Does nothing; this IOGroup does not provide any controls.
Definition: CNLIOGroup.cpp:258
static std::unique_ptr< IOGroup > make_plugin(void)
Definition: CNLIOGroup.cpp:351
std::function< double(const std::vector< double > &)> agg_function(const std::string &signal_name) const override
Definition: CNLIOGroup.cpp:263
Definition: IOGroup.hpp:21
structure to abstract the timespec on linux from other representations of time.
Definition: geopm_time.h:43