geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
InitControl.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef INITCONTROL_HPP_INCLUDE
7 #define INITCONTROL_HPP_INCLUDE
8 
9 #include "config.h"
10 
11 #include <string>
12 #include <vector>
13 #include <memory>
14 
15 namespace geopm
16 {
18  {
19  public:
20  static std::unique_ptr<InitControl> make_unique(void);
21  InitControl() = default;
22  virtual ~InitControl() = default;
23 
24  virtual void parse_input(const std::string &input_file) = 0;
25  virtual void write_controls(void) const = 0;
26  };
27 
28  class PlatformIO;
29 
30  class InitControlImp : public InitControl
31  {
32  public:
33  InitControlImp(const InitControlImp &other) = delete;
34  InitControlImp &operator=(const InitControlImp &other) = delete;
35 
37  InitControlImp(PlatformIO &platform_io);
38  virtual ~InitControlImp() = default;
39 
40  void parse_input(const std::string &input_file) override;
41  void write_controls(void) const override;
42 
43  private:
44  struct m_request_s {
45  std::string name;
46  int domain;
47  int domain_idx;
48  double setting;
49  };
50 
51  PlatformIO &m_platform_io;
52  std::vector<m_request_s> m_requests;
53  };
54 }
55 #endif
Definition: InitControl.hpp:18
InitControl()=default
virtual ~InitControl()=default
virtual void parse_input(const std::string &input_file)=0
virtual void write_controls(void) const =0
static std::unique_ptr< InitControl > make_unique(void)
Definition: InitControl.cpp:22
Definition: InitControl.hpp:31
InitControlImp(const InitControlImp &other)=delete
InitControlImp()
Definition: InitControl.cpp:27
void parse_input(const std::string &input_file) override
Definition: InitControl.cpp:39
virtual ~InitControlImp()=default
InitControlImp & operator=(const InitControlImp &other)=delete
void write_controls(void) const override
Definition: InitControl.cpp:144
Definition: Accumulator.cpp:12