geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
PolicyStore.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 POLICYSTORE_HPP_INCLUDE
7 #define POLICYSTORE_HPP_INCLUDE
8 
9 #include <string>
10 #include <vector>
11 #include <memory>
12 
13 namespace geopm
14 {
19  {
20  public:
21  PolicyStore() = default;
22  virtual ~PolicyStore() = default;
23 
32  virtual std::vector<double> get_best(const std::string &agent_name,
33  const std::string &profile_name) const = 0;
34 
41  virtual void set_best(const std::string &agent_name,
42  const std::string &profile_name,
43  const std::vector<double> &policy) = 0;
44 
48  virtual void set_default(const std::string &agent_name,
49  const std::vector<double> &policy) = 0;
52  static std::unique_ptr<PolicyStore> make_unique(const std::string &data_path);
55  static std::shared_ptr<PolicyStore> make_shared(const std::string &data_path);
56  };
57 }
58 
59 #endif
Definition: PolicyStore.hpp:19
static std::shared_ptr< PolicyStore > make_shared(const std::string &data_path)
Returns a shared_ptr to a concrete object constructed using the underlying implementation.
Definition: PolicyStore.cpp:23
PolicyStore()=default
virtual std::vector< double > get_best(const std::string &agent_name, const std::string &profile_name) const =0
Get the best known policy for a given agent/profile pair.
virtual void set_default(const std::string &agent_name, const std::vector< double > &policy)=0
Set the default policy to use with an agent.
virtual void set_best(const std::string &agent_name, const std::string &profile_name, const std::vector< double > &policy)=0
Set the record for the best policy for a profile with an agent.
virtual ~PolicyStore()=default
static std::unique_ptr< PolicyStore > make_unique(const std::string &data_path)
Returns a unique_ptr to a concrete object constructed using the underlying implementation.
Definition: PolicyStore.cpp:18
Definition: Accumulator.cpp:12