57 void forInterface(std::string interfaceName);
59 [[nodiscard]] Slot forInterface(std::string interfaceName,
return_slot_t);
63 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(SignalEmitter&& other) =
default;
79 ~SignalEmitter()
noexcept(
false);
83 SignalEmitter(IObject&
object,
const SignalName& signalName);
84 SignalEmitter(IObject&
object,
const char* signalName);
88 const char* signalName_;
96 MethodInvoker& onInterface(
const InterfaceName& interfaceName);
97 MethodInvoker& onInterface(
const std::string& interfaceName);
98 MethodInvoker& onInterface(
const char* interfaceName);
99 MethodInvoker& withTimeout(uint64_t usec);
100 template <
typename _Rep,
typename _Period>
101 MethodInvoker& withTimeout(
const std::chrono::duration<_Rep, _Period>& timeout);
102 template <
typename... _Args> MethodInvoker& withArguments(_Args&&... args);
103 template <
typename... _Args>
void storeResultsTo(_Args&... args);
104 void dontExpectReply();
106 MethodInvoker(MethodInvoker&& other) =
default;
107 ~MethodInvoker()
noexcept(
false);
111 MethodInvoker(IProxy& proxy,
const MethodName& methodName);
112 MethodInvoker(IProxy& proxy,
const char* methodName);
116 const char* methodName_;
120 bool methodCalled_{};
123 class AsyncMethodInvoker
126 AsyncMethodInvoker& onInterface(
const InterfaceName& interfaceName);
127 AsyncMethodInvoker& onInterface(
const std::string& interfaceName);
128 AsyncMethodInvoker& onInterface(
const char* interfaceName);
129 AsyncMethodInvoker& withTimeout(uint64_t usec);
130 template <
typename _Rep,
typename _Period>
131 AsyncMethodInvoker& withTimeout(
const std::chrono::duration<_Rep, _Period>& timeout);
132 template <
typename... _Args> AsyncMethodInvoker& withArguments(_Args&&... args);
133 template <
typename _Function>
PendingAsyncCall uponReplyInvoke(_Function&& callback);
134 template <
typename _Function> [[nodiscard]] Slot uponReplyInvoke(_Function&& callback,
return_slot_t);
138 template <
typename... _Args> std::future<future_return_t<_Args...>> getResultAsFuture();
142 AsyncMethodInvoker(IProxy& proxy,
const MethodName& methodName);
143 AsyncMethodInvoker(IProxy& proxy,
const char* methodName);
144 template <
typename _Function> async_reply_handler makeAsyncReplyHandler(_Function&& callback);
148 const char* methodName_;
153 class SignalSubscriber
156 SignalSubscriber& onInterface(
const InterfaceName& interfaceName);
157 SignalSubscriber& onInterface(
const std::string& interfaceName);
158 SignalSubscriber& onInterface(
const char* interfaceName);
159 template <
typename _Function>
void call(_Function&& callback);
160 template <
typename _Function> [[nodiscard]] Slot call(_Function&& callback,
return_slot_t);
164 SignalSubscriber(IProxy& proxy,
const SignalName& signalName);
165 SignalSubscriber(IProxy& proxy,
const char* signalName);
166 template <
typename _Function> signal_handler makeSignalHandler(_Function&& callback);
170 const char* signalName_;
171 const char* interfaceName_{};
177 Variant onInterface(std::string_view interfaceName);
181 PropertyGetter(IProxy& proxy, std::string_view propertyName);
183 static constexpr const char* DBUS_PROPERTIES_INTERFACE_NAME =
"org.freedesktop.DBus.Properties";
187 std::string_view propertyName_;
190 class AsyncPropertyGetter
193 AsyncPropertyGetter& onInterface(std::string_view interfaceName);
194 template <
typename _Function>
PendingAsyncCall uponReplyInvoke(_Function&& callback);
195 template <
typename _Function> [[nodiscard]] Slot uponReplyInvoke(_Function&& callback,
return_slot_t);
196 std::future<Variant> getResultAsFuture();
200 AsyncPropertyGetter(IProxy& proxy, std::string_view propertyName);
202 static constexpr const char* DBUS_PROPERTIES_INTERFACE_NAME =
"org.freedesktop.DBus.Properties";
206 std::string_view propertyName_;
207 std::string_view interfaceName_;
213 PropertySetter& onInterface(std::string_view interfaceName);
214 template <
typename _Value>
void toValue(
const _Value& value);
216 void toValue(
const Variant& value);
221 PropertySetter(IProxy& proxy, std::string_view propertyName);
223 static constexpr const char* DBUS_PROPERTIES_INTERFACE_NAME =
"org.freedesktop.DBus.Properties";
227 std::string_view propertyName_;
228 std::string_view interfaceName_;
231 class AsyncPropertySetter
234 AsyncPropertySetter& onInterface(std::string_view interfaceName);
235 template <
typename _Value> AsyncPropertySetter& toValue(_Value&& value);
236 AsyncPropertySetter& toValue(
Variant value);
237 template <
typename _Function>
PendingAsyncCall uponReplyInvoke(_Function&& callback);
238 template <
typename _Function> [[nodiscard]] Slot uponReplyInvoke(_Function&& callback,
return_slot_t);
239 std::future<void> getResultAsFuture();
243 AsyncPropertySetter(IProxy& proxy, std::string_view propertyName);
245 static constexpr const char* DBUS_PROPERTIES_INTERFACE_NAME =
"org.freedesktop.DBus.Properties";
249 std::string_view propertyName_;
250 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();
279 AsyncAllPropertiesGetter(IProxy& proxy);
281 static constexpr const char* DBUS_PROPERTIES_INTERFACE_NAME =
"org.freedesktop.DBus.Properties";
285 std::string_view interfaceName_;