geopm 3.2.1.dev535+ga96c120fc
GEOPM - Global Extensible Open Power Manager
Loading...
Searching...
No Matches
geopm::SDBusImp Class Reference

#include <SDBus.hpp>

Inheritance diagram for geopm::SDBusImp:
Collaboration diagram for geopm::SDBusImp:

Public Member Functions

 SDBusImp ()
 SDBusImp (const SDBusImp &other)=delete
SDBusImp & operator= (const SDBusImp &other)=delete
virtual ~SDBusImp ()
std::shared_ptr< SDBusMessage > call_method (std::shared_ptr< SDBusMessage > message) override
 Wrapper for the sd_bus_call(3) function.
std::shared_ptr< SDBusMessage > call_method (const std::string &member) override
 Wrapper for the sd_bus_call_method(3) function.
std::shared_ptr< SDBusMessage > call_method (const std::string &member, const std::string &arg0, int arg1, int arg2) override
 Wrapper for the sd_bus_call_method(3) function.
std::shared_ptr< SDBusMessage > call_method (const std::string &member, const std::string &arg0, int arg1, int arg2, double arg3) override
 Wrapper for the sd_bus_call_method(3) function.
std::shared_ptr< SDBusMessage > call_method (const std::string &member, int arg0) override
 Wrapper for the sd_bus_call_method(3) function.
std::shared_ptr< SDBusMessage > make_call_message (const std::string &member) override
 Wrapper for the sd_bus_message_new_method_call(3) function.
std::shared_ptr< SDBusMessage > call_method (const std::string &member, const std::string &arg0) override
Public Member Functions inherited from geopm::SDBus
 SDBus ()=default
virtual ~SDBus ()=default

Additional Inherited Members

Static Public Member Functions inherited from geopm::SDBus
static std::unique_ptr< SDBus > make_unique (void)
 Factory method for SDBus interface.

Constructor & Destructor Documentation

◆ SDBusImp() [1/2]

geopm::SDBusImp::SDBusImp ( )

◆ SDBusImp() [2/2]

geopm::SDBusImp::SDBusImp ( const SDBusImp & other)
delete

◆ ~SDBusImp()

geopm::SDBusImp::~SDBusImp ( )
virtual

Member Function Documentation

◆ call_method() [1/6]

std::shared_ptr< SDBusMessage > geopm::SDBusImp::call_method ( const std::string & member)
overridevirtual

Wrapper for the sd_bus_call_method(3) function.

Used to execute a GEOPM D-Bus API that takes no arguments.

Parameters
member[in] Name of the API from the io.github.geopm interface.
Returns
Reply message that resulted from the call.

Implements geopm::SDBus.

◆ call_method() [2/6]

std::shared_ptr< SDBusMessage > geopm::SDBusImp::call_method ( const std::string & member,
const std::string & arg0 )
overridevirtual

Implements geopm::SDBus.

◆ call_method() [3/6]

std::shared_ptr< SDBusMessage > geopm::SDBusImp::call_method ( const std::string & member,
const std::string & arg0,
int arg1,
int arg2 )
overridevirtual

Wrapper for the sd_bus_call_method(3) function.

Used to execute a GEOPM D-Bus API that takes three arguments with types (string, integer, integer).

Parameters
member[in] Name of the API from the io.github.geopm interface.
arg0[in] First parameter to pass to the D-Bus API.
arg1[in] Second parameter to pass to the D-Bus API.
arg2[in] Third parameter to pass to the D-Bus API.
Returns
Reply message that resulted from the call.

Implements geopm::SDBus.

◆ call_method() [4/6]

std::shared_ptr< SDBusMessage > geopm::SDBusImp::call_method ( const std::string & member,
const std::string & arg0,
int arg1,
int arg2,
double arg3 )
overridevirtual

Wrapper for the sd_bus_call_method(3) function.

Used to execute a GEOPM D-Bus API that takes four arguments with types (string, integer, integer, double).

Parameters
member[in] Name of the API from the io.github.geopm interface.
arg0[in] First parameter to pass to the D-Bus API.
arg1[in] Second parameter to pass to the D-Bus API.
arg2[in] Third parameter to pass to the D-Bus API.
arg2[in] Fourth parameter to pass to the D-Bus API.
Returns
Reply message that resulted from the call.

Implements geopm::SDBus.

◆ call_method() [5/6]

std::shared_ptr< SDBusMessage > geopm::SDBusImp::call_method ( const std::string & member,
int arg0 )
overridevirtual

Wrapper for the sd_bus_call_method(3) function.

Used to execute a GEOPM D-Bus API that takes one integer argument.

Parameters
member[in] Name of the API from the io.github.geopm interface.
arg0[in] First parameter to pass to the D-Bus API.
Returns
Reply message that resulted from the call.

Implements geopm::SDBus.

◆ call_method() [6/6]

std::shared_ptr< SDBusMessage > geopm::SDBusImp::call_method ( std::shared_ptr< SDBusMessage > message)
overridevirtual

Wrapper for the sd_bus_call(3) function.

Used to execute a GEOPM D-Bus API using an SDBusMessage created by the make_call_message() method. This enables the user to update the message with complex data types like arrays and structs to pass into the method.

One use case is to to pass lists of strings as inputs to GEOPM D-Bus APIs. The SDBusMessage that is created by make_call_message() is updated using SDBusMessage::append_strings() prior to passing the SDBusMessage to the call() method.

Parameters
message[in] Complete SDBusMessage returned by call to make_call_message().
Returns
Reply message that resulted from the call.

Implements geopm::SDBus.

◆ make_call_message()

std::shared_ptr< SDBusMessage > geopm::SDBusImp::make_call_message ( const std::string & member)
overridevirtual

Wrapper for the sd_bus_message_new_method_call(3) function.

This is used to create a SDBusMessage that can be passed to the call() method. The user can append data to the message prior to passing the result to the call() method in order to send complex data types like arrays and structures. The D-Bus API that will be called later is a parameter to this function.

Parameters
member[in] Name of the API from the io.github.geopm interface.
Returns
Complete message that can be passed to the call() method.

Implements geopm::SDBus.

◆ operator=()

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

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