sdbus-c++ 2.1.0
High-level C++ D-Bus library based on systemd D-Bus implementation
|
#include <AdaptorInterfaces.h>
Public Member Functions | |
AdaptorInterfaces (IConnection &connection, ObjectPath objectPath) | |
Creates object instance. | |
void | registerAdaptor () |
Adds object vtable (i.e. D-Bus API) definitions for all interfaces it implements. | |
void | unregisterAdaptor () |
Unregisters adaptors's API and removes it from the bus. | |
const IObject & | getObject () const |
Returns reference to the underlying IObject instance. | |
IObject & | getObject () |
Returns reference to the underlying IObject instance. | |
Protected Types | |
using | base_type = AdaptorInterfaces |
Protected Member Functions | |
AdaptorInterfaces (const AdaptorInterfaces &)=delete | |
AdaptorInterfaces & | operator= (const AdaptorInterfaces &)=delete |
AdaptorInterfaces (AdaptorInterfaces &&)=delete | |
AdaptorInterfaces & | operator= (AdaptorInterfaces &&)=delete |
![]() | |
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, one needs to make sure:
registerAdaptor();
in the class constructor, and, conversely,unregisterAdaptor();
in the class destructor, so that the object API vtable is registered and unregistered at the proper time.
|
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 |
Adds object vtable (i.e. D-Bus API) definitions for all interfaces it implements.
This function must be called in the constructor of the final adaptor class that implements AdaptorInterfaces.
See also IObject::addVTable()
|
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()