27#ifndef SDBUS_CXX_IPROXY_H_
28#define SDBUS_CXX_IPROXY_H_
43 class PendingAsyncCall;
108 template <
typename _Rep,
typename _Period>
132 template <
typename _Rep,
typename _Period>
145 ,
const std::string& signalName
146 , signal_handler signalHandler ) = 0;
157 ,
const std::string& signalName ) = 0;
350 template <
typename _Rep,
typename _Period>
352 ,
const std::chrono::duration<_Rep, _Period>& timeout
391 friend internal::Proxy;
395 std::weak_ptr<void> callData_;
400 template <
typename _Rep,
typename _Period>
403 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
404 return callMethod(message, microsecs.count());
407 template <
typename _Rep,
typename _Period>
410 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
411 return callMethod(message, std::move(asyncReplyCallback), microsecs.count());
414 template <
typename _Rep,
typename _Period>
416 ,
const std::chrono::duration<_Rep, _Period>& timeout
419 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
420 return callMethod(message, microsecs.count(), with_future);
473 , std::string destination
474 , std::string objectPath );
495 [[nodiscard]] std::unique_ptr<sdbus::IProxy>
createProxy( std::unique_ptr<sdbus::IConnection>&& connection
496 , std::string destination
497 , std::string objectPath );
518 [[nodiscard]] std::unique_ptr<sdbus::IProxy>
createProxy( std::unique_ptr<sdbus::IConnection>&& connection
519 , std::string destination
520 , std::string objectPath
540 [[nodiscard]] std::unique_ptr<sdbus::IProxy>
createProxy( std::string destination
541 , std::string objectPath );
561 [[nodiscard]] std::unique_ptr<sdbus::IProxy>
createProxy( std::string destination
562 , std::string objectPath
std::unique_ptr< sdbus::IProxy > createProxy(sdbus::IConnection &connection, std::string destination, std::string objectPath)
Creates a proxy object for a specific remote D-Bus object.
Definition ConvenienceApiClasses.h:190
Definition IConnection.h:50
virtual const Message * getCurrentlyProcessedMessage() const =0
Provides currently processed D-Bus message.
virtual void registerSignalHandler(const std::string &interfaceName, const std::string &signalName, signal_handler signalHandler)=0
Registers a handler for the desired signal emitted by the proxied D-Bus object.
virtual void unregisterSignalHandler(const std::string &interfaceName, const std::string &signalName)=0
Unregisters the handler of the desired signal.
virtual std::future< MethodReply > callMethod(const MethodCall &message, with_future_t)=0
Calls method on the proxied D-Bus object asynchronously.
virtual MethodCall createMethodCall(const std::string &interfaceName, const std::string &methodName)=0
Creates a method call message.
virtual const std::string & getObjectPath() const =0
Returns object path of the underlying DBus object.
SignalUnsubscriber muteSignal(const std::string &signalName)
Unregisters signal handler of a given signal of the proxied D-Bus object.
Definition IProxy.h:438
virtual void unregister()=0
Unregisters proxy's signal handlers and stops receving replies to pending async calls.
virtual void finishRegistration()=0
Finishes the registration of signal handlers.
virtual PendingAsyncCall callMethod(const MethodCall &message, async_reply_handler asyncReplyCallback, uint64_t timeout=0)=0
Calls method on the proxied D-Bus object asynchronously.
PropertySetter setProperty(const std::string &propertyName)
Sets value of a property of the proxied D-Bus object.
Definition IProxy.h:448
virtual MethodReply callMethod(const MethodCall &message, uint64_t timeout=0)=0
Calls method on the proxied D-Bus object.
virtual sdbus::IConnection & getConnection() const =0
Provides D-Bus connection used by the proxy.
AsyncMethodInvoker callMethodAsync(const std::string &methodName)
Calls method on the proxied D-Bus object asynchronously.
Definition IProxy.h:428
PropertyGetter getProperty(const std::string &propertyName)
Gets value of a property of the proxied D-Bus object.
Definition IProxy.h:443
SignalSubscriber uponSignal(const std::string &signalName)
Registers signal handler for a given signal of the proxied D-Bus object.
Definition IProxy.h:433
Definition ConvenienceApiClasses.h:165
void cancel()
Cancels the delivery of the pending asynchronous call result.
bool isPending() const
Answers whether the asynchronous call is still pending.
Definition ConvenienceApiClasses.h:236
Definition ConvenienceApiClasses.h:247
Definition ConvenienceApiClasses.h:212
Definition ConvenienceApiClasses.h:225
Definition TypeTraits.h:91
Definition TypeTraits.h:94