27#ifndef SDBUS_CXX_ADAPTORINTERFACES_H_
28#define SDBUS_CXX_ADAPTORINTERFACES_H_
53 ObjectHolder(std::unique_ptr<IObject>&&
object)
54 : object_(std::move(
object))
58 const IObject& getObject()
const
60 assert(object_ !=
nullptr);
66 assert(object_ !=
nullptr);
71 std::unique_ptr<IObject> object_;
90 template <
typename... _Interfaces>
92 :
protected ObjectHolder
93 ,
public _Interfaces...
105 : ObjectHolder(
createObject(connection, std::move(objectPath)))
106 , _Interfaces(getObject())...
119 getObject().finishRegistration();
131 getObject().unregister();
139 return getObject().getObjectPath();
std::unique_ptr< sdbus::IObject > createObject(sdbus::IConnection &connection, std::string objectPath)
Creates instance representing a D-Bus object.
Definition AdaptorInterfaces.h:94
const std::string & getObjectPath() const
Returns object path of the underlying DBus object.
Definition AdaptorInterfaces.h:137
AdaptorInterfaces(IConnection &connection, std::string objectPath)
Creates object instance.
Definition AdaptorInterfaces.h:104
void unregisterAdaptor()
Unregisters adaptors's API and removes it from the bus.
Definition AdaptorInterfaces.h:129
void registerAdaptor()
Finishes adaptor API registration and publishes the adaptor on the bus.
Definition AdaptorInterfaces.h:117
Definition IConnection.h:52