refactor: object manager API (#438)

This makes the signature of addObjectManager() function overloads consistent with common API design of the library.
This commit is contained in:
Stanislav Angelovič
2024-04-24 20:20:29 +02:00
parent 26c6da11be
commit 2bc9d3ebb3
9 changed files with 45 additions and 26 deletions
+21 -3
View File
@@ -223,6 +223,7 @@ namespace sdbus {
/*!
* @brief Adds an ObjectManager at the specified D-Bus object path
* @param[in] objectPath Object path at which the ObjectManager interface shall be installed
*
* Creates an ObjectManager interface at the specified object path on
* the connection. This is a convenient way to interrogate a connection
@@ -231,12 +232,29 @@ namespace sdbus {
* This call creates a floating registration. The ObjectManager will
* be there for the object path until the connection is destroyed.
*
* Another, recommended way to add object managers is directly through
* IObject API.
* Another, recommended way to add object managers is directly through IObject API.
*
* @throws sdbus::Error in case of failure
*/
virtual void addObjectManager(const ObjectPath& objectPath, floating_slot_t) = 0;
virtual void addObjectManager(const ObjectPath& objectPath) = 0;
/*!
* @brief Adds an ObjectManager at the specified D-Bus object path
* @param[in] objectPath Object path at which the ObjectManager interface shall be installed
* @return Slot handle owning the registration
*
* Creates an ObjectManager interface at the specified object path on
* the connection. This is a convenient way to interrogate a connection
* to see what objects it has.
*
* This call returns an owning slot. The lifetime of the ObjectManager
* interface is bound to the lifetime of the returned slot instance.
*
* Another, recommended way to add object managers is directly through IObject API.
*
* @throws sdbus::Error in case of failure
*/
[[nodiscard]] virtual Slot addObjectManager(const ObjectPath& objectPath, return_slot_t) = 0;
/*!
* @brief Installs a match rule for messages received on this bus connection
+14 -8
View File
@@ -247,22 +247,28 @@ namespace sdbus {
* the connection. This is a convenient way to interrogate a connection
* to see what objects it has.
*
* This call creates a so-called floating registration. This means that
* the ObjectManager interface stays there for the lifetime of the object.
*
* @throws sdbus::Error in case of failure
*/
virtual void addObjectManager() = 0;
/*!
* @brief Removes an ObjectManager interface from the path of this D-Bus object
* @brief Adds an ObjectManager interface at the path of this D-Bus object
*
* @return Slot handle owning the registration
*
* Creates an ObjectManager interface at the specified object path on
* the connection. This is a convenient way to interrogate a connection
* to see what objects it has.
*
* The lifetime of the ObjectManager interface is bound to the lifetime
* of the returned slot instance.
*
* @throws sdbus::Error in case of failure
*/
virtual void removeObjectManager() = 0;
/*!
* @brief Tests whether ObjectManager interface is added at the path of this D-Bus object
* @return True if ObjectManager interface is there, false otherwise
*/
[[nodiscard]] virtual bool hasObjectManager() const = 0;
[[nodiscard]] virtual Slot addObjectManager(return_slot_t) = 0;
/*!
* @brief Provides D-Bus connection used by the object