geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Endpoint.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 ENDPOINT_HPP_INCLUDE
7 #define ENDPOINT_HPP_INCLUDE
8 
9 #include <cstddef>
10 #include <memory>
11 #include <set>
12 #include <string>
13 #include <vector>
14 
15 #include "geopm_public.h"
16 
17 namespace geopm
18 {
19  class GEOPM_PUBLIC Endpoint
20  {
21  public:
22  virtual ~Endpoint() = default;
25  virtual void open(void) = 0;
28  virtual void close(void) = 0;
32  virtual void write_policy(const std::vector<double> &policy) = 0;
37  virtual double read_sample(std::vector<double> &sample) = 0;
40  virtual std::string get_agent(void) = 0;
47  virtual void wait_for_agent_attach(double timeout) = 0;
53  virtual void wait_for_agent_detach(double timeout) = 0;
56  virtual void stop_wait_loop(void) = 0;
58  virtual void reset_wait_loop(void) = 0;
62  virtual std::string get_profile_name(void) = 0;
66  virtual std::set<std::string> get_hostnames(void) = 0;
68  static std::unique_ptr<Endpoint> make_unique(const std::string &data_path);
69  };
70 }
71 
72 #endif
Definition: Endpoint.hpp:20
virtual void write_policy(const std::vector< double > &policy)=0
Write a set of policy values for the Agent.
virtual void wait_for_agent_attach(double timeout)=0
Blocks until an agent attaches to the endpoint, a timeout is reached, or the operation is canceled wi...
virtual void open(void)=0
Create the shared memory regions belonging to the Endpoint.
virtual std::set< std::string > get_hostnames(void)=0
Returns the list of hostnames used by the attached application, or empty if no controller is attached...
virtual void reset_wait_loop(void)=0
Re-enables wait loops occurring after this call.
virtual std::string get_profile_name(void)=0
Returns the profile name associated with the attached application, or empty if no controller is attac...
virtual void wait_for_agent_detach(double timeout)=0
Blocks as long as the same agent is still attached to the endpoint, a timeout is reached,...
virtual ~Endpoint()=default
virtual double read_sample(std::vector< double > &sample)=0
Read a set of samples from the Agent.
virtual void stop_wait_loop(void)=0
Cancels any current wait loops in this Endpoint.
virtual std::string get_agent(void)=0
Returns the Agent name, or empty string if no Agent is attached.
virtual void close(void)=0
Unlink the shared memory regions belonging to the Endpoint.
Definition: Accumulator.cpp:12