27#ifndef SDBUS_CXX_IPROXY_H_
28#define SDBUS_CXX_IPROXY_H_
41 class PendingAsyncCall;
106 template <
typename _Rep,
typename _Period>
130 template <
typename _Rep,
typename _Period>
143 ,
const std::string& signalName
144 , signal_handler signalHandler ) = 0;
155 ,
const std::string& signalName ) = 0;
362 friend internal::Proxy;
366 std::weak_ptr<void> callData_;
371 template <
typename _Rep,
typename _Period>
374 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
375 return callMethod(message, microsecs.count());
378 template <
typename _Rep,
typename _Period>
381 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
382 return callMethod(message, std::move(asyncReplyCallback), microsecs.count());
435 , std::string destination
436 , std::string objectPath );
457 [[nodiscard]] std::unique_ptr<sdbus::IProxy>
createProxy( std::unique_ptr<sdbus::IConnection>&& connection
458 , std::string destination
459 , std::string objectPath );
478 [[nodiscard]] std::unique_ptr<sdbus::IProxy>
createProxy( std::string destination
479 , 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:189
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 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:400
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:410
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:390
PropertyGetter getProperty(const std::string &propertyName)
Gets value of a property of the proxied D-Bus object.
Definition: IProxy.h:405
SignalSubscriber uponSignal(const std::string &signalName)
Registers signal handler for a given signal of the proxied D-Bus object.
Definition: IProxy.h:395
Definition: Message.h:171
Definition: ConvenienceApiClasses.h:164
Definition: Message.h:199
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:231
Definition: ConvenienceApiClasses.h:242
Definition: ConvenienceApiClasses.h:207
Definition: ConvenienceApiClasses.h:220