sdbus-c++: sdbus::AdaptorInterfaces< _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::AdaptorInterfaces< _Interfaces > Class Template Reference

`#include <AdaptorInterfaces.h>`

Inheritance diagram for sdbus::AdaptorInterfaces< _Interfaces >:

## Public Member Functions
| AdaptorInterfaces (IConnection &connection, std::string objectPath)
| Creates object instance.
void | registerAdaptor ()
| Finishes adaptor API registration and publishes the adaptor on the bus.
void | unregisterAdaptor ()
| Unregisters adaptors's API and removes it from the bus.
const std::string & | getObjectPath () const
| Returns object path of the underlying DBus object.

## Protected Types
using | base_type = AdaptorInterfaces

## Protected Member Functions
| AdaptorInterfaces (const AdaptorInterfaces &)=delete
AdaptorInterfaces & | operator= (const AdaptorInterfaces &)=delete
| AdaptorInterfaces (AdaptorInterfaces &&)=default
AdaptorInterfaces & | operator= (AdaptorInterfaces &&)=default
Protected Member Functions inherited from sdbus::ObjectHolder
| ObjectHolder (std::unique_ptr< IObject > &&object)
const IObject & | getObject () const
IObject & | getObject ()

## Detailed Description

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

AdaptorInterfaces 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 server (the adaptor) side, including some auxiliary classes. AdaptorInterfaces is the class that native-like object 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 adaptor-side interface classes representing interfaces (with methods, signals and properties) of the D-Bus object.

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

## Constructor & Destructor Documentation

## ◆ AdaptorInterfaces()

template<typename... _Interfaces>

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

Creates object instance.

Parameters

  [in] | connection | D-Bus connection where the object will publish itself
  [in] | objectPath | Path of the D-Bus object

For more information, consult createObject(sdbus::IConnection&,std::string)

## Member Function Documentation

## ◆ registerAdaptor()

template<typename... _Interfaces>

void sdbus::AdaptorInterfaces< _Interfaces >::registerAdaptor | ( |  | ) |
| inline

Finishes adaptor API registration and publishes the adaptor on the bus.

This function must be called in the constructor of the final adaptor class that implements AdaptorInterfaces.

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

## ◆ unregisterAdaptor()

template<typename... _Interfaces>

void sdbus::AdaptorInterfaces< _Interfaces >::unregisterAdaptor | ( |  | ) |
| inline

Unregisters adaptors's API and removes it from the bus.

This function must be called in the destructor of the final adaptor class that implements AdaptorInterfaces.

For more information, see underlying IObject::unregister()

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

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