geopm 3.1.1.dev456+g3ba31824
GEOPM - Global Extensible Open Power Manager
Loading...
Searching...
No Matches
GRPCServiceProxy.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 GRPCSERVICEPROXY_HPP_INCLUDE
7#define GRPCSERVICEPROXY_HPP_INCLUDE
8
9#include <string>
10#include <memory>
11#include <vector>
13
14#include "geopm_service.pb.h"
15#include "geopm_service.grpc.pb.h"
16
17namespace geopm
18{
19
21 {
22 public:
24 virtual ~GRPCServiceProxy();
25 void platform_get_user_access(std::vector<std::string> &signal_names,
26 std::vector<std::string> &control_names) override;
27 std::vector<signal_info_s> platform_get_signal_info(const std::vector<std::string> &signal_names) override;
28 std::vector<control_info_s> platform_get_control_info(const std::vector<std::string> &control_names) override;
29 void platform_open_session(void) override;
30 void platform_close_session(void) override;
31 void platform_start_batch(const std::vector<struct geopm_request_s> &signal_config,
32 const std::vector<struct geopm_request_s> &control_config,
33 int &server_pid,
34 std::string &server_key) override;
35 void platform_stop_batch(int server_pid) override;
36 double platform_read_signal(const std::string &signal_name,
37 int domain,
38 int domain_idx) override;
39 void platform_write_control(const std::string &control_name,
40 int domain,
41 int domain_idx,
42 double setting) override;
43 void platform_restore_control(void) override;
44 void platform_start_profile(const std::string &profile_name) override;
45 void platform_stop_profile(const std::vector<std::string> &region_names) override;
46 std::vector<int> platform_get_profile_pids(const std::string &profile_name) override;
47 std::vector<std::string> platform_pop_profile_region_names(const std::string &profile_name) override;
48 std::string topo_get_cache(void) override;
49 private:
50 const std::string m_grpc_socket;
51 std::string m_session_key;
52 int m_pidfd;
53 std::shared_ptr<GEOPMPackage::GEOPMService::Stub> m_client;
54 GEOPMPackage::SessionKey m_id_request;
55 };
56}
57
58#endif
Definition GRPCServiceProxy.hpp:21
virtual ~GRPCServiceProxy()
Definition GRPCServiceProxy.cpp:28
double platform_read_signal(const std::string &signal_name, int domain, int domain_idx) override
Calls the PlatformReadSignal API defined in the io.github.geopm D-Bus namespace.
Definition GRPCServiceProxy.cpp:263
void platform_stop_profile(const std::vector< std::string > &region_names) override
Definition GRPCServiceProxy.cpp:335
std::vector< int > platform_get_profile_pids(const std::string &profile_name) override
Definition GRPCServiceProxy.cpp:356
std::vector< control_info_s > platform_get_control_info(const std::vector< std::string > &control_names) override
Calls the PlatformGetControlInfo API defined in the io.github.geopm D-Bus namespace.
Definition GRPCServiceProxy.cpp:126
void platform_start_profile(const std::string &profile_name) override
Definition GRPCServiceProxy.cpp:316
void platform_write_control(const std::string &control_name, int domain, int domain_idx, double setting) override
Calls the PlatformWriteControl API defined in the io.github.geopm D-Bus namespace.
Definition GRPCServiceProxy.cpp:289
std::string topo_get_cache(void) override
Calls the TopoGetCache API defined in the io.github.geopm D-Bus namespace.
Definition GRPCServiceProxy.cpp:404
void platform_restore_control(void) override
Calls the PlatformRestoreControl API defined in the io.github.geopm D-Bus namespace.
Definition GRPCServiceProxy.cpp:191
void platform_start_batch(const std::vector< struct geopm_request_s > &signal_config, const std::vector< struct geopm_request_s > &control_config, int &server_pid, std::string &server_key) override
Calls the PlatformStartBatch API defined in the io.github.geopm D-Bus namespace.
Definition GRPCServiceProxy.cpp:207
void platform_close_session(void) override
Calls the PlatformCloseSession API defined in the io.github.geopm D-Bus namespace.
Definition GRPCServiceProxy.cpp:175
void platform_get_user_access(std::vector< std::string > &signal_names, std::vector< std::string > &control_names) override
Calls the PlatformGetUserAccess API defined in the io.github.geopm D-Bus namespace.
Definition GRPCServiceProxy.cpp:66
std::vector< signal_info_s > platform_get_signal_info(const std::vector< std::string > &signal_names) override
Calls the PlatformGetSignalInfo API defined in the io.github.geopm D-Bus namespace.
Definition GRPCServiceProxy.cpp:91
void platform_open_session(void) override
Calls the PlatformOpenSession API defined in the io.github.geopm D-Bus namespace.
Definition GRPCServiceProxy.cpp:158
void platform_stop_batch(int server_pid) override
Calls the PlatformStopBatch API defined in the io.github.geopm D-Bus namespace.
Definition GRPCServiceProxy.cpp:242
GRPCServiceProxy()
Definition GRPCServiceProxy.cpp:42
std::vector< std::string > platform_pop_profile_region_names(const std::string &profile_name) override
Definition GRPCServiceProxy.cpp:380
Proxy object for the io.github.geopm D-Bus interface used to implement the ServiceIOGroup.
Definition ServiceProxy.hpp:60
Definition Agg.cpp:20