|
virtual MethodCall | createMethodCall (const std::string &interfaceName, const std::string &methodName)=0 |
| Creates a method call message. More...
|
|
virtual MethodReply | callMethod (const MethodCall &message, uint64_t timeout=0)=0 |
| Calls method on the proxied D-Bus object. More...
|
|
template<typename _Rep , typename _Period > |
MethodReply | callMethod (const MethodCall &message, const std::chrono::duration< _Rep, _Period > &timeout) |
| Calls method on the proxied D-Bus object. More...
|
|
virtual PendingAsyncCall | callMethod (const MethodCall &message, async_reply_handler asyncReplyCallback, uint64_t timeout=0)=0 |
| Calls method on the proxied D-Bus object asynchronously. More...
|
|
template<typename _Rep , typename _Period > |
PendingAsyncCall | callMethod (const MethodCall &message, async_reply_handler asyncReplyCallback, const std::chrono::duration< _Rep, _Period > &timeout) |
| Calls method on the proxied D-Bus object asynchronously. More...
|
|
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. More...
|
|
virtual void | finishRegistration ()=0 |
| Finishes the registration of signal handlers. More...
|
|
virtual void | unregister ()=0 |
| Unregisters proxy's signal handlers and stops receving replies to pending async calls. More...
|
|
MethodInvoker | callMethod (const std::string &methodName) |
| Calls method on the proxied D-Bus object. More...
|
|
AsyncMethodInvoker | callMethodAsync (const std::string &methodName) |
| Calls method on the proxied D-Bus object asynchronously. More...
|
|
SignalSubscriber | uponSignal (const std::string &signalName) |
| Registers signal handler for a given signal of the proxied D-Bus object. More...
|
|
PropertyGetter | getProperty (const std::string &propertyName) |
| Gets value of a property of the proxied D-Bus object. More...
|
|
PropertySetter | setProperty (const std::string &propertyName) |
| Sets value of a property of the proxied D-Bus object. More...
|
|
virtual const std::string & | getObjectPath () const =0 |
| Returns object path of the underlying DBus object.
|
|
IProxy class represents a proxy object, which is a convenient local object created to represent a remote D-Bus object in another process. The proxy enables calling methods on remote objects, receiving signals from remote objects, and getting/setting properties of remote objects.
All IProxy member methods throw sdbus::Error
in case of D-Bus or sdbus-c++ error. The IProxy class has been designed as thread-aware. However, the operation of creating and sending method calls (both synchronously and asynchronously) is thread-safe by design.
template<typename _Rep , typename _Period >
PendingAsyncCall sdbus::IProxy::callMethod |
( |
const MethodCall & |
message, |
|
|
async_reply_handler |
asyncReplyCallback, |
|
|
const std::chrono::duration< _Rep, _Period > & |
timeout |
|
) |
| |
|
inline |
Calls method on the proxied D-Bus object asynchronously.
- Parameters
-
[in] | message | Message representing an async method call |
[in] | asyncReplyCallback | Handler for the async reply |
[in] | timeout | Timeout for dbus call in microseconds |
- Returns
- Cookie for the the pending asynchronous call
The call is non-blocking. It doesn't wait for the reply. Once the reply arrives, the provided async reply handler will get invoked from the context of the connection I/O event loop thread.
Note: To avoid messing with messages, use higher-level API defined below.
- Exceptions
-
template<typename _Rep , typename _Period >
MethodReply sdbus::IProxy::callMethod |
( |
const MethodCall & |
message, |
|
|
const std::chrono::duration< _Rep, _Period > & |
timeout |
|
) |
| |
|
inline |
Calls method on the proxied D-Bus object.
- Parameters
-
[in] | message | Message representing a method call |
[in] | timeout | Timeout for dbus call in microseconds |
- Returns
- A method reply message
Normally, the call is blocking, i.e. it waits for the remote method to finish with either a return value or an error.
If the method call argument is set to not expect reply, the call will not wait for the remote method to finish, i.e. the call will be non-blocking, and the function will return an empty, invalid MethodReply object (representing void).
Note: To avoid messing with messages, use higher-level API defined below.
- Exceptions
-
Calls method on the proxied D-Bus object.
- Parameters
-
[in] | message | Message representing a method call |
[in] | timeout | Timeout for dbus call in microseconds |
- Returns
- A method reply message
Normally, the call is blocking, i.e. it waits for the remote method to finish with either a return value or an error.
If the method call argument is set to not expect reply, the call will not wait for the remote method to finish, i.e. the call will be non-blocking, and the function will return an empty, invalid MethodReply object (representing void).
Note: To avoid messing with messages, use higher-level API defined below.
- Exceptions
-