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_;
91 template <
typename... _Interfaces>
92 class AdaptorInterfaces
93 :
protected ObjectHolder
94 ,
public _Interfaces...
105 AdaptorInterfaces(IConnection& connection, ObjectPath objectPath)
106 : ObjectHolder(
createObject(connection, std::move(objectPath)))
107 , _Interfaces(getObject())...
118 void registerAdaptor()
120 (_Interfaces::registerAdaptor(), ...);
130 void unregisterAdaptor()
132 getObject().unregister();
138 using ObjectHolder::getObject;
141 using base_type = AdaptorInterfaces;
143 AdaptorInterfaces(
const AdaptorInterfaces&) =
delete;
144 AdaptorInterfaces& operator=(
const AdaptorInterfaces&) =
delete;
145 AdaptorInterfaces(AdaptorInterfaces&&) =
delete;
146 AdaptorInterfaces& operator=(AdaptorInterfaces&&) =
delete;
147 ~AdaptorInterfaces() =
default;
std::unique_ptr< sdbus::IObject > createObject(sdbus::IConnection &connection, ObjectPath objectPath)
Creates instance representing a D-Bus object.