geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
PolicyStoreImp.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 POLICYSTOREIMP_HPP_INCLUDE
7 #define POLICYSTOREIMP_HPP_INCLUDE
8 
9 #include <string>
10 #include <vector>
11 
12 #include "PolicyStore.hpp"
13 
14 struct sqlite3;
15 
16 namespace geopm
17 {
21  class PolicyStoreImp : public PolicyStore
22  {
23  public:
24  PolicyStoreImp(const std::string &database_path);
25 
26  PolicyStoreImp() = delete;
27  PolicyStoreImp(const PolicyStoreImp &other) = delete;
28  PolicyStoreImp &operator=(const PolicyStoreImp &other) = delete;
29 
30  virtual ~PolicyStoreImp();
31 
32  std::vector<double> get_best(const std::string &agent_name,
33  const std::string &profile_name) const override;
34 
35  void set_best(const std::string &agent_name,
36  const std::string &profile_name,
37  const std::vector<double> &policy) override;
38 
39  void set_default(const std::string &agent_name, const std::vector<double> &policy) override;
40 
41  private:
42  struct sqlite3 *m_database;
43  };
44 }
45 
46 #endif
Definition: PolicyStore.hpp:19
Definition: PolicyStoreImp.hpp:22
void set_best(const std::string &agent_name, const std::string &profile_name, const std::vector< double > &policy) override
Set the record for the best policy for a profile with an agent.
Definition: PolicyStoreImp.cpp:271
void set_default(const std::string &agent_name, const std::vector< double > &policy) override
Set the default policy to use with an agent.
Definition: PolicyStoreImp.cpp:317
std::vector< double > get_best(const std::string &agent_name, const std::string &profile_name) const override
Get the best known policy for a given agent/profile pair.
Definition: PolicyStoreImp.cpp:247
PolicyStoreImp(const PolicyStoreImp &other)=delete
virtual ~PolicyStoreImp()
Definition: PolicyStoreImp.cpp:238
PolicyStoreImp & operator=(const PolicyStoreImp &other)=delete
Definition: Accumulator.cpp:12