sdbus-c++ 1.5.0
High-level C++ D-Bus library based on systemd D-Bus implementation
|
#include <AdaptorInterfaces.h>
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 |
![]() | |
ObjectHolder (std::unique_ptr< IObject > &&object) | |
const IObject & | getObject () const |
IObject & | getObject () |
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();`).
|
inline |
Creates object instance.
[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)
|
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()
|
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()