27#ifndef SDBUS_CXX_IPROXY_H_
28#define SDBUS_CXX_IPROXY_H_
93 [[nodiscard]] MethodInvoker
callMethod(
const MethodName& methodName);
98 [[nodiscard]] MethodInvoker
callMethod(
const std::string& methodName);
103 [[nodiscard]] MethodInvoker
callMethod(
const char* methodName);
128 [[nodiscard]] AsyncMethodInvoker
callMethodAsync(
const MethodName& methodName);
133 [[nodiscard]] AsyncMethodInvoker
callMethodAsync(
const std::string& methodName);
138 [[nodiscard]] AsyncMethodInvoker
callMethodAsync(
const char* methodName);
164 [[nodiscard]] SignalSubscriber
uponSignal(
const SignalName& signalName);
169 [[nodiscard]] SignalSubscriber
uponSignal(
const std::string& signalName);
174 [[nodiscard]] SignalSubscriber
uponSignal(
const char* signalName);
433 template <
typename _Rep,
typename _Period>
482 , async_reply_handler asyncReplyCallback
508 , async_reply_handler asyncReplyCallback
509 , uint64_t timeout ) = 0;
535 , async_reply_handler asyncReplyCallback
542 template <
typename _Rep,
typename _Period>
544 , async_reply_handler asyncReplyCallback
545 ,
const std::chrono::duration<_Rep, _Period>& timeout );
550 template <
typename _Rep,
typename _Period>
552 , async_reply_handler asyncReplyCallback
553 ,
const std::chrono::duration<_Rep, _Period>& timeout
604 template <
typename _Rep,
typename _Period>
606 ,
const std::chrono::duration<_Rep, _Period>& timeout
626 ,
const SignalName& signalName
627 , signal_handler signalHandler ) = 0;
646 ,
const SignalName& signalName
647 , signal_handler signalHandler
651 friend MethodInvoker;
652 friend AsyncMethodInvoker;
653 friend SignalSubscriber;
657 ,
const char* signalName
658 , signal_handler signalHandler ) = 0;
660 ,
const char* signalName
661 , signal_handler signalHandler
675 class PendingAsyncCall
678 PendingAsyncCall() =
default;
700 friend internal::Proxy;
701 PendingAsyncCall(std::weak_ptr<void> callInfo);
704 std::weak_ptr<void> callInfo_;
709 template <
typename _Rep,
typename _Period>
712 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
713 return callMethod(message, microsecs.count());
716 template <
typename _Rep,
typename _Period>
718 , async_reply_handler asyncReplyCallback
719 ,
const std::chrono::duration<_Rep, _Period>& timeout )
721 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
722 return callMethodAsync(message, std::move(asyncReplyCallback), microsecs.count());
725 template <
typename _Rep,
typename _Period>
727 , async_reply_handler asyncReplyCallback
728 ,
const std::chrono::duration<_Rep, _Period>& timeout
731 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
732 return callMethodAsync(message, std::move(asyncReplyCallback), microsecs.count(), return_slot);
735 template <
typename _Rep,
typename _Period>
737 ,
const std::chrono::duration<_Rep, _Period>& timeout
740 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
746 return MethodInvoker(*
this, methodName);
751 return MethodInvoker(*
this, methodName.c_str());
756 return MethodInvoker(*
this, methodName);
761 return AsyncMethodInvoker(*
this, methodName);
766 return AsyncMethodInvoker(*
this, methodName.c_str());
771 return AsyncMethodInvoker(*
this, methodName);
776 return SignalSubscriber(*
this, signalName);
781 return SignalSubscriber(*
this, signalName.c_str());
786 return SignalSubscriber(*
this, signalName);
862 , ServiceName destination
887 [[nodiscard]] std::unique_ptr<sdbus::IProxy>
createProxy( std::unique_ptr<sdbus::IConnection>&& connection
888 , ServiceName destination
914 [[nodiscard]] std::unique_ptr<sdbus::IProxy>
createProxy( std::unique_ptr<sdbus::IConnection>&& connection
915 , ServiceName destination
936 [[nodiscard]] std::unique_ptr<sdbus::IProxy>
createProxy( ServiceName destination
957 [[nodiscard]] std::unique_ptr<sdbus::IProxy>
createProxy( ServiceName destination
std::unique_ptr< sdbus::IProxy > createProxy(sdbus::IConnection &connection, ServiceName destination, ObjectPath objectPath)
Creates a proxy object for a specific remote D-Bus object.
Definition ConvenienceApiClasses.h:255
Definition ConvenienceApiClasses.h:270
Definition ConvenienceApiClasses.h:191
Definition ConvenienceApiClasses.h:232
Definition IConnection.h:61
PropertyGetter getProperty(const PropertyName &propertyName)
Gets value of a property of the D-Bus object.
Definition IProxy.h:789
AsyncPropertyGetter getPropertyAsync(const PropertyName &propertyName)
Gets value of a property of the D-Bus object asynchronously.
Definition IProxy.h:799
virtual std::future< MethodReply > callMethodAsync(const MethodCall &message, with_future_t)=0
Calls method on the D-Bus object asynchronously.
virtual PendingAsyncCall callMethodAsync(const MethodCall &message, async_reply_handler asyncReplyCallback, uint64_t timeout)=0
Calls method on the D-Bus object asynchronously, with custom timeout.
virtual MethodReply callMethod(const MethodCall &message)=0
Calls method on the remote D-Bus object.
AsyncAllPropertiesGetter getAllPropertiesAsync()
Gets values of all properties of the D-Bus object asynchronously.
Definition IProxy.h:834
virtual void registerSignalHandler(const InterfaceName &interfaceName, const SignalName &signalName, signal_handler signalHandler)=0
Registers a handler for the desired signal emitted by the D-Bus object.
virtual Slot callMethodAsync(const MethodCall &message, async_reply_handler asyncReplyCallback, return_slot_t)=0
Calls method on the D-Bus object asynchronously.
PropertySetter setProperty(const PropertyName &propertyName)
Sets value of a property of the D-Bus object.
Definition IProxy.h:809
MethodInvoker callMethod(const MethodName &methodName)
Calls method on the D-Bus object.
Definition IProxy.h:744
virtual Message getCurrentlyProcessedMessage() const =0
Provides access to the currently processed D-Bus message.
virtual MethodCall createMethodCall(const InterfaceName &interfaceName, const MethodName &methodName) const =0
Creates a method call message.
virtual void unregister()=0
Unregisters proxy's signal handlers and stops receiving replies to pending async calls.
virtual MethodReply callMethod(const MethodCall &message, uint64_t timeout)=0
Calls method on the remote D-Bus object.
virtual sdbus::IConnection & getConnection() const =0
Provides D-Bus connection used by the proxy.
virtual std::future< MethodReply > callMethodAsync(const MethodCall &message, uint64_t timeout, with_future_t)=0
Calls method on the D-Bus object asynchronously, with custom timeout.
virtual Slot registerSignalHandler(const InterfaceName &interfaceName, const SignalName &signalName, signal_handler signalHandler, return_slot_t)=0
Registers a handler for the desired signal emitted by the D-Bus object.
virtual Slot callMethodAsync(const MethodCall &message, async_reply_handler asyncReplyCallback, uint64_t timeout, return_slot_t)=0
Calls method on the D-Bus object asynchronously, with custom timeout.
virtual const ObjectPath & getObjectPath() const =0
Returns object path of the underlying DBus object.
AsyncMethodInvoker callMethodAsync(const MethodName &methodName)
Calls method on the D-Bus object asynchronously.
Definition IProxy.h:759
SignalSubscriber uponSignal(const SignalName &signalName)
Registers signal handler for a given signal of the D-Bus object.
Definition IProxy.h:774
AllPropertiesGetter getAllProperties()
Gets values of all properties of the D-Bus object.
Definition IProxy.h:829
virtual PendingAsyncCall callMethodAsync(const MethodCall &message, async_reply_handler asyncReplyCallback)=0
Calls method on the D-Bus object asynchronously.
AsyncPropertySetter setPropertyAsync(const PropertyName &propertyName)
Sets value of a property of the D-Bus object asynchronously.
Definition IProxy.h:819
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:175
Definition ConvenienceApiClasses.h:211
Definition TypeTraits.h:101
Definition TypeTraits.h:88
Definition TypeTraits.h:104