27#ifndef SDBUS_CXX_METHODRESULT_H_
28#define SDBUS_CXX_METHODRESULT_H_
49 template <
typename... _Results>
54 Result(MethodCall call);
56 Result(
const Result&) =
delete;
57 Result& operator=(
const Result&) =
delete;
59 Result(Result&& other) =
default;
60 Result& operator=(Result&& other) =
default;
62 void returnResults(
const _Results&... results)
const;
63 void returnError(
const Error& error)
const;
69 template <
typename... _Results>
70 inline Result<_Results...>::Result(MethodCall call)
71 : call_(std::move(call))
75 template <
typename... _Results>
76 inline void Result<_Results...>::returnResults(
const _Results&... results)
const
78 assert(call_.isValid());
79 auto reply = call_.createReply();
80 (void)(reply << ... << results);
84 template <
typename... _Results>
85 inline void Result<_Results...>::returnError(
const Error& error)
const
87 auto reply = call_.createErrorReply(error);