27#ifndef SDBUS_CXX_IPROXY_H_
28#define SDBUS_CXX_IPROXY_H_
94 [[nodiscard]] MethodInvoker
callMethod(
const MethodName& methodName);
99 [[nodiscard]] MethodInvoker
callMethod(
const std::string& methodName);
104 [[nodiscard]] MethodInvoker
callMethod(
const char* methodName);
129 [[nodiscard]] AsyncMethodInvoker
callMethodAsync(
const MethodName& methodName);
134 [[nodiscard]] AsyncMethodInvoker
callMethodAsync(
const std::string& methodName);
139 [[nodiscard]] AsyncMethodInvoker
callMethodAsync(
const char* methodName);
165 [[nodiscard]] SignalSubscriber
uponSignal(
const SignalName& signalName);
170 [[nodiscard]] SignalSubscriber
uponSignal(
const std::string& signalName);
175 [[nodiscard]] SignalSubscriber
uponSignal(
const char* signalName);
434 template <
typename Rep,
typename Period>
483 , async_reply_handler asyncReplyCallback
509 , async_reply_handler asyncReplyCallback
510 , uint64_t timeout ) = 0;
536 , async_reply_handler asyncReplyCallback
543 template <
typename Rep,
typename Period>
545 , async_reply_handler asyncReplyCallback
546 ,
const std::chrono::duration<Rep, Period>& timeout );
551 template <
typename Rep,
typename Period>
553 , async_reply_handler asyncReplyCallback
554 ,
const std::chrono::duration<Rep, Period>& timeout
603 template <
typename Rep,
typename Period>
605 ,
const std::chrono::duration<Rep, Period>& timeout
611 template <
typename Rep,
typename Period>
613 ,
const std::chrono::duration<Rep, Period>& timeout
633 ,
const SignalName& signalName
634 , signal_handler signalHandler ) = 0;
653 ,
const SignalName& signalName
654 , signal_handler signalHandler
658 friend MethodInvoker;
659 friend AsyncMethodInvoker;
660 friend SignalSubscriber;
664 ,
const char* signalName
665 , signal_handler signalHandler ) = 0;
667 ,
const char* signalName
668 , signal_handler signalHandler
721 class PendingAsyncCall
724 PendingAsyncCall() =
default;
746 friend internal::Proxy;
747 explicit PendingAsyncCall(std::weak_ptr<void> callInfo);
749 std::weak_ptr<void> callInfo_;
754 template <
typename Rep,
typename Period>
757 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
758 return callMethod(message, microsecs.count());
761 template <
typename Rep,
typename Period>
763 , async_reply_handler asyncReplyCallback
764 ,
const std::chrono::duration<Rep, Period>& timeout )
766 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
767 return callMethodAsync(message, std::move(asyncReplyCallback), microsecs.count());
770 template <
typename Rep,
typename Period>
772 , async_reply_handler asyncReplyCallback
773 ,
const std::chrono::duration<Rep, Period>& timeout
776 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
777 return callMethodAsync(message, std::move(asyncReplyCallback), microsecs.count(), return_slot);
780 template <
typename Rep,
typename Period>
782 ,
const std::chrono::duration<Rep, Period>& timeout
785 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
789 template <
typename Rep,
typename Period>
791 ,
const std::chrono::duration<Rep, Period>& timeout
793 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
799 return {*
this, methodName};
804 return {*
this, methodName.c_str()};
809 return {*
this, methodName};
814 return {*
this, methodName};
819 return {*
this, methodName.c_str()};
824 return {*
this, methodName};
829 return {*
this, signalName};
834 return {*
this, signalName.c_str()};
839 return {*
this, signalName};
844 return {*
this, propertyName};
849 return {*
this, std::move(propertyName)};
854 return {*
this, propertyName};
859 return {*
this, std::move(propertyName)};
864 return {*
this, propertyName};
869 return {*
this, std::move(propertyName)};
874 return {*
this, propertyName};
879 return {*
this, std::move(propertyName)};
915 , ServiceName destination
940 [[nodiscard]] std::unique_ptr<IProxy>
createProxy( std::unique_ptr<IConnection>&& connection
941 , ServiceName destination
967 [[nodiscard]] std::unique_ptr<IProxy>
createProxy( std::unique_ptr<IConnection>&& connection
968 , ServiceName destination
978 , ServiceName destination
998 [[nodiscard]] std::unique_ptr<IProxy>
createProxy( ServiceName destination
1019 [[nodiscard]] std::unique_ptr<IProxy>
createProxy( ServiceName destination
std::unique_ptr< IProxy > createProxy(IConnection &connection, ServiceName destination, ObjectPath objectPath)
Creates a proxy object for a specific remote D-Bus object.
std::unique_ptr< IProxy > createLightWeightProxy(std::unique_ptr< IConnection > &&connection, ServiceName destination, ObjectPath objectPath)
Creates a light-weight proxy object for a specific remote D-Bus object.
Definition ConvenienceApiClasses.h:256
Definition ConvenienceApiClasses.h:270
Definition ConvenienceApiClasses.h:193
Definition ConvenienceApiClasses.h:233
Definition Awaitable.h:110
Definition IConnection.h:61
PropertyGetter getProperty(const PropertyName &propertyName)
Gets value of a property of the D-Bus object.
Definition IProxy.h:842
AsyncPropertyGetter getPropertyAsync(const PropertyName &propertyName)
Gets value of a property of the D-Bus object asynchronously.
Definition IProxy.h:852
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:887
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 Awaitable< MethodReply > callMethodAsync(const MethodCall &message, uint64_t timeout, with_awaitable_t)=0
Calls method on the D-Bus object asynchronously, with custom timeout.
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:862
MethodInvoker callMethod(const MethodName &methodName)
Calls method on the D-Bus object.
Definition IProxy.h:797
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 Awaitable< MethodReply > callMethodAsync(const MethodCall &message, with_awaitable_t)=0
Calls method on the D-Bus object asynchronously.
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:812
SignalSubscriber uponSignal(const SignalName &signalName)
Registers signal handler for a given signal of the D-Bus object.
Definition IProxy.h:827
AllPropertiesGetter getAllProperties()
Gets values of all properties of the D-Bus object.
Definition IProxy.h:882
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:872
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:178
Definition ConvenienceApiClasses.h:213
Definition TypeTraits.h:101
Definition TypeTraits.h:88
Definition TypeTraits.h:113
Definition TypeTraits.h:104