sdbus-c++: sdbus::ProxyInterfaces< _Interfaces > Class Template Reference

sdbus-c++ 1.3.0 High-level C++ D-Bus library based on systemd D-Bus implementation

Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Member Functions | List of all members
sdbus::ProxyInterfaces< _Interfaces > Class Template Reference

`#include <ProxyInterfaces.h>`

Inheritance diagram for sdbus::ProxyInterfaces< _Interfaces >:

## Public Member Functions
| ProxyInterfaces (std::string destination, std::string objectPath)
| Creates native-like proxy object instance.
| ProxyInterfaces (std::string destination, std::string objectPath, dont_run_event_loop_thread_t)
| Creates native-like proxy object instance.
| ProxyInterfaces (IConnection &connection, std::string destination, std::string objectPath)
| Creates native-like proxy object instance.
| ProxyInterfaces (std::unique_ptr< sdbus::IConnection > &&connection, std::string destination, std::string objectPath)
| Creates native-like proxy object instance.
| ProxyInterfaces (std::unique_ptr< sdbus::IConnection > &&connection, std::string destination, std::string objectPath, dont_run_event_loop_thread_t)
| Creates native-like proxy object instance.
void | registerProxy ()
| Finishes proxy registration and makes the proxy ready for use.
void | unregisterProxy ()
| Unregisters the proxy so it no more receives signals and async call replies.
const std::string & | getObjectPath () const
| Returns object path of the underlying DBus object.

## Protected Types
using | base_type = ProxyInterfaces

## Protected Member Functions
| ProxyInterfaces (const ProxyInterfaces &)=delete
ProxyInterfaces & | operator= (const ProxyInterfaces &)=delete
| ProxyInterfaces (ProxyInterfaces &&)=default
ProxyInterfaces & | operator= (ProxyInterfaces &&)=default
Protected Member Functions inherited from sdbus::ProxyObjectHolder
| ProxyObjectHolder (std::unique_ptr< IProxy > &&proxy)
const IProxy & | getProxy () const
IProxy & | getProxy ()

## Detailed Description

template<typename... _Interfaces>
class sdbus::ProxyInterfaces< _Interfaces >

ProxyInterfaces is a helper template class that joins all interface classes of a remote D-Bus object generated by sdbus-c++-xml2cpp to be used on the client (the proxy) side, including some auxiliary classes. ProxyInterfaces is the class that native-like proxy implementation classes written by users should inherit from and implement all pure virtual methods. So the _Interfaces template parameter is a list of sdbus-c++-xml2cpp-generated proxy-side interface classes representing interfaces of the corresponding remote D-Bus object.

In the final proxy class inherited from ProxyInterfaces, it is necessary to finish proxy registration in class constructor (`finishRegistration();`), and, conversely, unregister the proxy in class destructor (`unregister();`).

## Constructor & Destructor Documentation

## ◆ ProxyInterfaces() [1/5]

template<typename... _Interfaces>

sdbus::ProxyInterfaces< _Interfaces >::ProxyInterfaces | ( | std::string | destination,
|  | std::string | objectPath
| ) |  |
| inline

Creates native-like proxy object instance.

Parameters

  [in] | destination | Bus name that provides a D-Bus object
  [in] | objectPath | Path of the D-Bus object

This constructor overload creates a proxy that manages its own D-Bus connection(s). For more information on its behavior, consult createProxy(std::string,std::string)

## ◆ ProxyInterfaces() [2/5]

template<typename... _Interfaces>

sdbus::ProxyInterfaces< _Interfaces >::ProxyInterfaces | ( | std::string | destination,
|  | std::string | objectPath,
|  | dont_run_event_loop_thread_t |
| ) |  |
| inline

Creates native-like proxy object instance.

Parameters

  [in] | destination | Bus name that provides a D-Bus object
  [in] | objectPath | Path of the D-Bus object

This constructor overload creates a proxy that manages its own D-Bus connection(s). For more information on its behavior, consult createProxy(std::string,std::string,sdbus::dont_run_event_loop_thread_t)

## ◆ ProxyInterfaces() [3/5]

template<typename... _Interfaces>

sdbus::ProxyInterfaces< _Interfaces >::ProxyInterfaces | ( | IConnection & | connection,
|  | std::string | destination,
|  | std::string | objectPath
| ) |  |
| inline

Creates native-like proxy object instance.

Parameters

  [in] | connection | D-Bus connection to be used by the proxy object
  [in] | destination | Bus name that provides a D-Bus object
  [in] | objectPath | Path of the D-Bus object

The proxy created this way just references a D-Bus connection owned and managed by the user. For more information on its behavior, consult createProxy(IConnection&,std::string,std::string)

## ◆ ProxyInterfaces() [4/5]

template<typename... _Interfaces>

sdbus::ProxyInterfaces< _Interfaces >::ProxyInterfaces | ( | std::unique_ptr< sdbus::IConnection > && | connection,
|  | std::string | destination,
|  | std::string | objectPath
| ) |  |
| inline

Creates native-like proxy object instance.

Parameters

  [in] | connection | D-Bus connection to be used by the proxy object
  [in] | destination | Bus name that provides a D-Bus object
  [in] | objectPath | Path of the D-Bus object

The proxy created this way becomes an owner of the connection. For more information on its behavior, consult createProxy(std::unique_ptr<sdbus::IConnection>&&,std::string,std::string)

## ◆ ProxyInterfaces() [5/5]

template<typename... _Interfaces>

sdbus::ProxyInterfaces< _Interfaces >::ProxyInterfaces | ( | std::unique_ptr< sdbus::IConnection > && | connection,
|  | std::string | destination,
|  | std::string | objectPath,
|  | dont_run_event_loop_thread_t |
| ) |  |
| inline

Creates native-like proxy object instance.

Parameters

  [in] | connection | D-Bus connection to be used by the proxy object
  [in] | destination | Bus name that provides a D-Bus object
  [in] | objectPath | Path of the D-Bus object

The proxy created this way becomes an owner of the connection. For more information on its behavior, consult createProxy(std::unique_ptr<sdbus::IConnection>&&,std::string,std::string,sdbus::dont_run_event_loop_thread_t)

## Member Function Documentation

## ◆ registerProxy()

template<typename... _Interfaces>

void sdbus::ProxyInterfaces< _Interfaces >::registerProxy | ( |  | ) |
| inline

Finishes proxy registration and makes the proxy ready for use.

This function must be called in the constructor of the final proxy class that implements ProxyInterfaces.

For more information, see underlying IProxy::finishRegistration()

## ◆ unregisterProxy()

template<typename... _Interfaces>

void sdbus::ProxyInterfaces< _Interfaces >::unregisterProxy | ( |  | ) |
| inline

Unregisters the proxy so it no more receives signals and async call replies.

This function must be called in the destructor of the final proxy class that implements ProxyInterfaces.

See underlying IProxy::unregister()

The documentation for this class was generated from the following file:

- include/sdbus-c++/ProxyInterfaces.h