geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::PolicyStoreImp Class Reference

#include <PolicyStoreImp.hpp>

Inheritance diagram for geopm::PolicyStoreImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::PolicyStoreImp:
Collaboration graph
[legend]

Public Member Functions

 PolicyStoreImp (const std::string &database_path)
 
 PolicyStoreImp ()=delete
 
 PolicyStoreImp (const PolicyStoreImp &other)=delete
 
PolicyStoreImpoperator= (const PolicyStoreImp &other)=delete
 
virtual ~PolicyStoreImp ()
 
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. More...
 
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. More...
 
void set_default (const std::string &agent_name, const std::vector< double > &policy) override
 Set the default policy to use with an agent. More...
 
- Public Member Functions inherited from geopm::PolicyStore
 PolicyStore ()=default
 
virtual ~PolicyStore ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::PolicyStore
static std::unique_ptr< PolicyStoremake_unique (const std::string &data_path)
 Returns a unique_ptr to a concrete object constructed using the underlying implementation. More...
 
static std::shared_ptr< PolicyStoremake_shared (const std::string &data_path)
 Returns a shared_ptr to a concrete object constructed using the underlying implementation. More...
 

Detailed Description

Manages a data store of best known policies for profiles used with agents. The data store includes records of best known policies and default policies to apply when a best run has not yet been recorded.

Constructor & Destructor Documentation

◆ PolicyStoreImp() [1/3]

geopm::PolicyStoreImp::PolicyStoreImp ( const std::string &  database_path)

◆ PolicyStoreImp() [2/3]

geopm::PolicyStoreImp::PolicyStoreImp ( )
delete

◆ PolicyStoreImp() [3/3]

geopm::PolicyStoreImp::PolicyStoreImp ( const PolicyStoreImp other)
delete

◆ ~PolicyStoreImp()

geopm::PolicyStoreImp::~PolicyStoreImp ( )
virtual

Member Function Documentation

◆ get_best()

std::vector< double > geopm::PolicyStoreImp::get_best ( const std::string &  agent_name,
const std::string &  profile_name 
) const
overridevirtual

Get the best known policy for a given agent/profile pair.

Returns the best known policy from the data store. If no best policy is known, the default policy for the agent is returned. An exception is thrown if no default exists, or if any data store errors occur.

Parameters
[in]agent_nameName of the agent to look up
[in]profile_nameName of the profile to look up
Returns
The recommended policy for the profile to use with the agent.

Implements geopm::PolicyStore.

◆ operator=()

PolicyStoreImp& geopm::PolicyStoreImp::operator= ( const PolicyStoreImp other)
delete

◆ set_best()

void geopm::PolicyStoreImp::set_best ( const std::string &  agent_name,
const std::string &  profile_name,
const std::vector< double > &  policy 
)
overridevirtual

Set the record for the best policy for a profile with an agent.

Creates or overwrites the best-known policy for a profile when used with the given agent.

Parameters
[in]agent_nameName of the agent for which this policy applies.
[in]profile_nameName of the profile whose policy is being set.
[in]policyPolicy string to use with the given agent.

Implements geopm::PolicyStore.

◆ set_default()

void geopm::PolicyStoreImp::set_default ( const std::string &  agent_name,
const std::vector< double > &  policy 
)
overridevirtual

Set the default policy to use with an agent.

Parameters
[in]agent_nameName of the agent for which this policy applies.
[in]policyPolicy string to use with the given agent.

Implements geopm::PolicyStore.


The documentation for this class was generated from the following files: