58 void forInterface(std::string interfaceName);
60 [[nodiscard]] Slot forInterface(std::string interfaceName,
return_slot_t);
64 VTableAdder(IObject&
object, std::vector<VTableItem> vtable);
67 std::vector<VTableItem> vtable_;
73 SignalEmitter& onInterface(
const InterfaceName& interfaceName);
74 SignalEmitter& onInterface(
const std::string& interfaceName);
75 SignalEmitter& onInterface(
const char* interfaceName);
76 template <
typename... Args>
void withArguments(Args&&... args);
78 SignalEmitter(
const SignalEmitter&) =
delete;
79 SignalEmitter& operator=(
const SignalEmitter&) =
delete;
80 SignalEmitter(SignalEmitter&& other) =
default;
81 SignalEmitter& operator=(SignalEmitter&&) =
delete;
82 ~SignalEmitter()
noexcept(
false);
86 SignalEmitter(IObject&
object,
const SignalName& signalName);
87 SignalEmitter(IObject&
object,
const char* signalName);
90 const char* signalName_;
98 MethodInvoker& onInterface(
const InterfaceName& interfaceName);
99 MethodInvoker& onInterface(
const std::string& interfaceName);
100 MethodInvoker& onInterface(
const char* interfaceName);
101 MethodInvoker& withTimeout(uint64_t usec);
102 template <
typename Rep,
typename Period>
103 MethodInvoker& withTimeout(
const std::chrono::duration<Rep, Period>& timeout);
104 template <
typename... Args> MethodInvoker& withArguments(Args&&... args);
105 template <
typename... Args>
void storeResultsTo(Args&... args);
106 void dontExpectReply();
108 MethodInvoker(
const MethodInvoker&) =
delete;
109 MethodInvoker& operator=(
const MethodInvoker&) =
delete;
110 MethodInvoker(MethodInvoker&& other) =
default;
111 MethodInvoker& operator=(MethodInvoker&&) =
delete;
112 ~MethodInvoker()
noexcept(
false);
116 MethodInvoker(IProxy& proxy,
const MethodName& methodName);
117 MethodInvoker(IProxy& proxy,
const char* methodName);
120 const char* methodName_;
124 bool methodCalled_{};
127 class AsyncMethodInvoker
130 AsyncMethodInvoker& onInterface(
const InterfaceName& interfaceName);
131 AsyncMethodInvoker& onInterface(
const std::string& interfaceName);
132 AsyncMethodInvoker& onInterface(
const char* interfaceName);
133 AsyncMethodInvoker& withTimeout(uint64_t usec);
134 template <
typename Rep,
typename Period>
135 AsyncMethodInvoker& withTimeout(
const std::chrono::duration<Rep, Period>& timeout);
136 template <
typename... Args> AsyncMethodInvoker& withArguments(Args&&... args);
137 template <
typename Function>
PendingAsyncCall uponReplyInvoke(Function&& callback);
138 template <
typename Function> [[nodiscard]] Slot uponReplyInvoke(Function&& callback,
return_slot_t);
142 template <
typename... Args> std::future<future_return_t<Args...>> getResultAsFuture();
143 template <
typename... Args>
Awaitable<awaitable_return_t<Args...>> getResultAsAwaitable();
147 AsyncMethodInvoker(IProxy& proxy,
const MethodName& methodName);
148 AsyncMethodInvoker(IProxy& proxy,
const char* methodName);
149 template <
typename Function> async_reply_handler makeAsyncReplyHandler(Function&& callback);
152 const char* methodName_;
157 class SignalSubscriber
160 SignalSubscriber& onInterface(
const InterfaceName& interfaceName);
161 SignalSubscriber& onInterface(
const std::string& interfaceName);
162 SignalSubscriber& onInterface(
const char* interfaceName);
163 template <
typename Function>
void call(Function&& callback);
164 template <
typename Function> [[nodiscard]] Slot call(Function&& callback,
return_slot_t);
168 SignalSubscriber(IProxy& proxy,
const SignalName& signalName);
169 SignalSubscriber(IProxy& proxy,
const char* signalName);
170 template <
typename Function> signal_handler makeSignalHandler(Function&& callback);
173 const char* signalName_;
174 const char* interfaceName_{};
180 Variant onInterface(std::string_view interfaceName);
184 PropertyGetter(IProxy& proxy, std::string_view propertyName);
186 static constexpr const char* DBUS_PROPERTIES_INTERFACE_NAME =
"org.freedesktop.DBus.Properties";
189 std::string_view propertyName_;
192 class AsyncPropertyGetter
195 AsyncPropertyGetter& onInterface(std::string_view interfaceName);
196 template <
typename Function>
PendingAsyncCall uponReplyInvoke(Function&& callback);
197 template <
typename Function> [[nodiscard]] Slot uponReplyInvoke(Function&& callback,
return_slot_t);
198 std::future<Variant> getResultAsFuture();
203 AsyncPropertyGetter(IProxy& proxy, std::string_view propertyName);
205 static constexpr const char* DBUS_PROPERTIES_INTERFACE_NAME =
"org.freedesktop.DBus.Properties";
208 std::string_view propertyName_;
209 std::string_view interfaceName_;
215 PropertySetter& onInterface(std::string_view interfaceName);
216 template <
typename Value>
void toValue(
const Value& value);
218 void toValue(
const Variant& value);
223 PropertySetter(IProxy& proxy, std::string_view propertyName);
225 static constexpr const char* DBUS_PROPERTIES_INTERFACE_NAME =
"org.freedesktop.DBus.Properties";
228 std::string_view propertyName_;
229 std::string_view interfaceName_;
232 class AsyncPropertySetter
235 AsyncPropertySetter& onInterface(std::string_view interfaceName);
236 template <
typename Value> AsyncPropertySetter& toValue(Value&& value);
237 AsyncPropertySetter& toValue(
Variant value);
238 template <
typename Function>
PendingAsyncCall uponReplyInvoke(Function&& callback);
239 template <
typename Function> [[nodiscard]] Slot uponReplyInvoke(Function&& callback,
return_slot_t);
240 std::future<void> getResultAsFuture();
245 AsyncPropertySetter(IProxy& proxy, std::string_view propertyName);
247 static constexpr const char* DBUS_PROPERTIES_INTERFACE_NAME =
"org.freedesktop.DBus.Properties";
250 std::string_view propertyName_;
251 std::string_view interfaceName_;
269 class AsyncAllPropertiesGetter
272 AsyncAllPropertiesGetter& onInterface(std::string_view interfaceName);
273 template <
typename Function>
PendingAsyncCall uponReplyInvoke(Function&& callback);
274 template <
typename Function> [[nodiscard]] Slot uponReplyInvoke(Function&& callback,
return_slot_t);
275 std::future<std::map<PropertyName, Variant>> getResultAsFuture();
280 explicit AsyncAllPropertiesGetter(IProxy& proxy);
282 static constexpr const char* DBUS_PROPERTIES_INTERFACE_NAME =
"org.freedesktop.DBus.Properties";
285 std::string_view interfaceName_;