geopm
3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
|
Abstraction around sd_bus interface for calling methods. More...
#include <SDBus.hpp>
Public Member Functions | |
SDBus ()=default | |
virtual | ~SDBus ()=default |
virtual std::shared_ptr< SDBusMessage > | call_method (std::shared_ptr< SDBusMessage > message)=0 |
Wrapper for the sd_bus_call(3) function. More... | |
virtual std::shared_ptr< SDBusMessage > | call_method (const std::string &member)=0 |
Wrapper for the sd_bus_call_method(3) function. More... | |
virtual std::shared_ptr< SDBusMessage > | call_method (const std::string &member, const std::string &arg0, int arg1, int arg2)=0 |
Wrapper for the sd_bus_call_method(3) function. More... | |
virtual std::shared_ptr< SDBusMessage > | call_method (const std::string &member, const std::string &arg0, int arg1, int arg2, double arg3)=0 |
Wrapper for the sd_bus_call_method(3) function. More... | |
virtual std::shared_ptr< SDBusMessage > | call_method (const std::string &member, int arg0)=0 |
Wrapper for the sd_bus_call_method(3) function. More... | |
virtual std::shared_ptr< SDBusMessage > | make_call_message (const std::string &member)=0 |
Wrapper for the sd_bus_message_new_method_call(3) function. More... | |
virtual std::shared_ptr< SDBusMessage > | call_method (const std::string &member, const std::string &arg0)=0 |
Static Public Member Functions | |
static std::unique_ptr< SDBus > | make_unique (void) |
Factory method for SDBus interface. More... | |
Abstraction around sd_bus interface for calling methods.
A mock-able C++ interface wrapper around the sd_bus functions that initiate calls to GEOPM D-Bus methods. The sd_bus functions are provided by the libsystemd.so library and defined int the systemd/sd-bus.h" header file. The messages passed to and from these calls are abstracted by the SDBusMessage interface. The SDBus method syntax reflects the syntax of the underlying sd_bus interface, and for further information look at the sd-bus(3) man page and links therein.
|
default |
|
virtualdefault |
|
pure virtual |
Wrapper for the sd_bus_call_method(3) function.
Used to execute a GEOPM D-Bus API that takes no arguments.
member | [in] Name of the API from the io.github.geopm interface. |
Implemented in geopm::SDBusImp.
|
pure virtual |
Implemented in geopm::SDBusImp.
|
pure virtual |
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).
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. |
Implemented in geopm::SDBusImp.
|
pure virtual |
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).
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. |
Implemented in geopm::SDBusImp.
|
pure virtual |
Wrapper for the sd_bus_call_method(3) function.
Used to execute a GEOPM D-Bus API that takes one integer argument.
member | [in] Name of the API from the io.github.geopm interface. |
arg0 | [in] First parameter to pass to the D-Bus API. |
Implemented in geopm::SDBusImp.
|
pure virtual |
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.
message | [in] Complete SDBusMessage returned by call to make_call_message(). |
Implemented in geopm::SDBusImp.
|
pure virtual |
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.
member | [in] Name of the API from the io.github.geopm interface. |
Implemented in geopm::SDBusImp.
|
static |