sdbus-c++ 1.1.0
High-level C++ D-Bus library based on systemd D-Bus implementation
Loading...
Searching...
No Matches
sdbus::AdaptorInterfaces< _Interfaces > Class Template Reference

#include <AdaptorInterfaces.h>

Inheritance diagram for sdbus::AdaptorInterfaces< _Interfaces >:
sdbus::ObjectHolder

Public Member Functions

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

Protected Types

using base_type = AdaptorInterfaces
 

Additional Inherited Members

- Protected Member Functions inherited from sdbus::ObjectHolder
 ObjectHolder (std::unique_ptr< IObject > &&object)
 
const IObjectgetObject () const
 
IObjectgetObject ()
 

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]connectionD-Bus connection where the object will publish itself
[in]objectPathPath 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: