6 #ifndef SAVECONTROL_HPP_INCLUDE
7 #define SAVECONTROL_HPP_INCLUDE
70 static std::unique_ptr<SaveControl>
make_unique(
const std::vector<m_setting_s> &settings);
79 static std::unique_ptr<SaveControl>
make_unique(
const std::string &json_string);
99 virtual std::string
json(
void)
const = 0;
104 virtual std::vector<m_setting_s>
settings(
void)
const = 0;
115 virtual void write_json(
const std::string &save_path)
const = 0;
123 virtual std::set<std::string>
unsaved_controls(
const std::set<std::string> &all_controls)
const = 0;
133 std::string json(
void)
const override;
134 std::vector<m_setting_s> settings(
void)
const override;
135 void write_json(
const std::string &save_path)
const override;
136 void restore(
IOGroup &io_group)
const override;
137 std::set<std::string> unsaved_controls(
const std::set<std::string> &all_controls)
const override;
139 static std::string json(
const std::vector<m_setting_s> &settings);
140 static std::vector<m_setting_s> settings(
const std::string &json_string);
141 static std::vector<m_setting_s> settings(
IOGroup &io_group,
144 const std::vector<m_setting_s> m_settings;
145 const std::string m_json;
Definition: IOGroup.hpp:21
Class that enables the save/restore feature for IOGroups.
Definition: SaveControl.hpp:43
virtual std::set< std::string > unsaved_controls(const std::set< std::string > &all_controls) const =0
virtual std::vector< m_setting_s > settings(void) const =0
Get saved control settings structures.
virtual void restore(IOGroup &io_group) const =0
Write all of the control settings to the platform.
virtual std::string json(void) const =0
Get saved control settings JSON.
virtual void write_json(const std::string &save_path) const =0
Write the JSON formatted settings to a file.
virtual ~SaveControl()=default
Definition: SaveControl.hpp:127
virtual ~SaveControlImp()=default
#define GEOPM_PUBLIC
Definition: geopm_public.h:10
std::unique_ptr< Type > make_unique(Args &&...args)
Implementation of std::make_unique (C++14) for C++11. Note that this version will only work for non-a...
Definition: Helper.hpp:28
Structure that holds the parameters passed to the IOGroup::write_control() method.
Definition: SaveControl.hpp:47
int domain_type
Domain to apply the setting.
Definition: SaveControl.hpp:51
int domain_idx
Index of the domain to apply the setting.
Definition: SaveControl.hpp:53
std::string name
Name of the control.
Definition: SaveControl.hpp:49
double setting
Value for restoring the control.
Definition: SaveControl.hpp:55