6 #ifndef SDBUSMESSAGE_HPP_INCLUDE
7 #define SDBUSMESSAGE_HPP_INCLUDE
13 struct sd_bus_message;
42 static std::unique_ptr<SDBusMessage>
make_unique(sd_bus_message *bus_message);
62 const std::string &contents) = 0;
79 const std::string &contents) = 0;
111 const std::vector<std::string> &write_values) = 0;
145 const std::string &contents)
override;
149 const std::string &contents)
override;
155 const std::vector<std::string> &write_values)
override;
159 sd_bus_message *m_bus_message;
Abstraction around sd_bus interfaces that read from or append to sd_bus_message types.
Definition: SDBusMessage.hpp:28
virtual bool was_success(void)=0
Determine if end of array has been reached.
virtual void close_container(void)=0
Close a container in the message for writing.
virtual sd_bus_message * get_sd_ptr(void)=0
Get raw pointer to sd_bus struct.
static const char M_MESSAGE_TYPE_STRUCT
Used with enter_container() method to specify a structure container.
Definition: SDBusMessage.hpp:32
static std::unique_ptr< SDBusMessage > make_unique(sd_bus_message *bus_message)
Factory method for SDBusMessage interface.
Definition: SDBusMessage.cpp:47
virtual int read_integer(void)=0
Read an integer out of the message.
virtual ~SDBusMessage()=default
virtual void exit_container(void)=0
Exit a container in the message for reading.
static const char M_MESSAGE_TYPE_ARRAY
Used with enter_container() method to specify an array container.
Definition: SDBusMessage.hpp:35
virtual void append_strings(const std::vector< std::string > &write_values)=0
Write an array of strings into the message.
virtual void open_container(char type, const std::string &contents)=0
Open a container in the message for writing.
virtual std::string read_string(void)=0
Read a string out of the message.
virtual void append_request(const geopm_request_s &request)=0
Write an array of geopm_request_s into the message.
virtual void enter_container(char type, const std::string &contents)=0
Enter a container in the message for reading.
virtual double read_double(void)=0
Read a double out of the message.
Definition: SDBusMessage.hpp:137
sd_bus_message * get_sd_ptr(void) override
Get raw pointer to sd_bus struct.
Definition: SDBusMessage.cpp:70
std::string read_string(void) override
Read a string out of the message.
Definition: SDBusMessage.cpp:107
double read_double(void) override
Read a double out of the message.
Definition: SDBusMessage.cpp:123
void enter_container(char type, const std::string &contents) override
Enter a container in the message for reading.
Definition: SDBusMessage.cpp:75
void append_request(const geopm_request_s &request) override
Write an array of geopm_request_s into the message.
Definition: SDBusMessage.cpp:156
virtual void open_container(char type, const std::string &contents) override
Open a container in the message for writing.
Definition: SDBusMessage.cpp:92
bool was_success(void) override
Determine if end of array has been reached.
Definition: SDBusMessage.cpp:164
SDBusMessageImp()
Definition: SDBusMessage.cpp:52
void exit_container(void) override
Exit a container in the message for reading.
Definition: SDBusMessage.cpp:84
int read_integer(void) override
Read an integer out of the message.
Definition: SDBusMessage.cpp:133
virtual ~SDBusMessageImp()
Definition: SDBusMessage.cpp:65
virtual void close_container(void) override
Close a container in the message for writing.
Definition: SDBusMessage.cpp:100
void append_strings(const std::vector< std::string > &write_values) override
Write an array of strings into the message.
Definition: SDBusMessage.cpp:143
Definition: geopm_pio.h:387