26 #ifndef COMMON_RESULT_DBUS_METHOD_RESULT_BUILDER_HPP
27 #define COMMON_RESULT_DBUS_METHOD_RESULT_BUILDER_HPP
44 template<
typename Data>
51 void setImpl(
const std::shared_ptr<void>&
data)
override;
53 void setError(
const std::string& name,
const std::string& message)
override;
54 std::string
getID()
const override;
57 std::function<GVariant*(std::shared_ptr<void>)>
mSerialize;
60 template<
typename Data>
62 : mMethodResultBuilderPtr(methodResultBuilderPtr)
69 template<
typename Data>
72 GVariant* parameters = mSerialize(data);
73 mMethodResultBuilderPtr->set(parameters);
76 template<
typename Data>
79 mMethodResultBuilderPtr->setVoid();
82 template<
typename Data>
85 mMethodResultBuilderPtr->setError(name, message);
88 template<
typename Data>
97 #endif // COMMON_RESULT_DBUS_METHOD_RESULT_BUILDER_HPP
::dbus::MethodResultBuilder::Pointer mMethodResultBuilderPtr
Definition: dbus-method-result-builder.hpp:56
std::string getID() const override
Definition: dbus-method-result-builder.hpp:89
const std::string DBUS_CONNECTION_PREFIX
Definition: dbus-method-result-builder.hpp:42
Definition: dbus-method-result-builder.hpp:45
Configuration file for the code.
~DbusMethodResultBuilder()
Definition: dbus-method-result-builder.hpp:48
An interface used to set a result to a method call.
Definition: method-result-builder.hpp:39
char data[368]
Definition: initctl.cpp:41
void setImpl(const std::shared_ptr< void > &data) override
Definition: dbus-method-result-builder.hpp:70
GVariant * saveToGVariant(const Cargo &visitable)
Saves the visitable in a GVariant.
Definition: cargo-gvariant.hpp:58
std::function< GVariant *(std::shared_ptr< void >)> mSerialize
Definition: dbus-method-result-builder.hpp:57
void setError(const std::string &name, const std::string &message) override
Definition: dbus-method-result-builder.hpp:83
DbusMethodResultBuilder(const ::dbus::MethodResultBuilder::Pointer &methodResultBuilderPtr)
Definition: dbus-method-result-builder.hpp:61
std::shared_ptr< MethodResultBuilder > Pointer
Definition: connection.hpp:47
void setVoid() override
Definition: dbus-method-result-builder.hpp:77
Interface for result builders.