geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Admin.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 ADMIN_HPP_INCLUDE
7 #define ADMIN_HPP_INCLUDE
8 
9 #include <memory>
10 #include <string>
11 #include <vector>
12 #include <map>
13 #include "geopm_public.h"
14 
15 namespace geopm
16 {
17  class OptionParser;
18  class GEOPM_PUBLIC Admin
19  {
20  public:
21  Admin();
22  Admin(const std::string &default_config_path,
23  const std::string &override_config_path);
24  void main(int argc,
25  const char **argv,
26  std::ostream &std_out,
27  std::ostream &std_err);
28  std::string run(bool do_default,
29  bool do_override);
30  OptionParser parser(std::ostream &std_out,
31  std::ostream &std_err);
32  std::string default_config(void);
33  std::string override_config(void);
34  std::string check_node(void);
35  void check_config(const std::map<std::string, std::string> &config_map,
36  std::vector<std::string> &policy_names,
37  std::vector<double> &policy_vals);
38  std::string print_config(const std::map<std::string, std::string> &config_map,
39  const std::map<std::string, std::string> &override_map,
40  const std::vector<std::string> &policy_names,
41  const std::vector<double> &policy_vals);
42  static std::vector<std::string> dup_keys(const std::map<std::string, std::string> &map_a,
43  const std::map<std::string, std::string> &map_b);
44  private:
45  std::string m_default_config_path;
46  std::string m_override_config_path;
47  };
48 }
49 
50 #endif
Definition: Admin.hpp:19
Definition: OptionParser.hpp:20
int main(int argc, const char **argv)
Definition: geopmadmin_main.cpp:13
Definition: Accumulator.cpp:12