geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | Static Public Member Functions | List of all members
geopm::BatchClient Class Referenceabstract

Interface that will attach to a batch server. The batch server that it connects to is typically created through a call to the GEOPM DBus interface io.github.geopm.PlatformStartBatch. More...

#include <BatchClient.hpp>

Inheritance diagram for geopm::BatchClient:
Inheritance graph
[legend]

Public Member Functions

 BatchClient ()=default
 
virtual ~BatchClient ()=default
 
virtual std::vector< double > read_batch (void)=0
 Ask batch server to read all signal values and return result. More...
 
virtual void write_batch (std::vector< double > settings)=0
 Ask batch server to write all of the control values. More...
 
virtual void stop_batch (void)=0
 Send message to batch server asking it to quit. More...
 

Static Public Member Functions

static std::unique_ptr< BatchClientmake_unique (const std::string &server_key, double timeout, int num_signal, int num_control)
 Factory method to create a pointer to a BatchClient object. More...
 

Detailed Description

Interface that will attach to a batch server. The batch server that it connects to is typically created through a call to the GEOPM DBus interface io.github.geopm.PlatformStartBatch.

Constructor & Destructor Documentation

◆ BatchClient()

geopm::BatchClient::BatchClient ( )
default

◆ ~BatchClient()

virtual geopm::BatchClient::~BatchClient ( )
virtualdefault

Member Function Documentation

◆ make_unique()

std::unique_ptr< BatchClient > geopm::BatchClient::make_unique ( const std::string &  server_key,
double  timeout,
int  num_signal,
int  num_control 
)
static

Factory method to create a pointer to a BatchClient object.

The BatchClient interface is used to communicate with an existing GEOPM batch server. The batch server is typically created with the PlatformStartBatch GEOPM DBus interface.

Parameters
server_key[in] The server key that was returned when the batch server was created.
timeout[in] Maximum wait time to attach to batch server in units of seconds.
num_signal[in] Number of signal requests made when starting the batch server.
num_signal[in] Number of control requests made when starting the batch server.
Returns
New unique pointer to an object that supports the BatchClient interface.

◆ read_batch()

virtual std::vector<double> geopm::BatchClient::read_batch ( void  )
pure virtual

Ask batch server to read all signal values and return result.

Command is issued to batch server to read all pushed signal values. All of the values read by the batch server are returned.

Returns
A vector containing all values read by batch server

Implemented in geopm::BatchClientImp.

◆ stop_batch()

virtual void geopm::BatchClient::stop_batch ( void  )
pure virtual

Send message to batch server asking it to quit.

Implemented in geopm::BatchClientImp.

◆ write_batch()

virtual void geopm::BatchClient::write_batch ( std::vector< double >  settings)
pure virtual

Ask batch server to write all of the control values.

Sends the vector of settings to the batch server. This function blocks until the batch server has written all values.

Parameters
settings[in] Control settings to be written: one for each control requests made when batch server was created.

Implemented in geopm::BatchClientImp.


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