Service-agnostic observer for org.freedesktop.DBus.ObjectManager.
More...
#include <phosphor-dbus/include/PhosphorDBus/ObjectManager.h>
Signals | |
| void | interfacesAdded (const QString &path, const PhosphorDBus::InterfaceMap &interfaces) |
| A managed object appeared, or the initial walk surfaced it. | |
| void | interfacesRemoved (const QString &path, const QStringList &interfaces) |
| Some of an object's interfaces went away. | |
| void | ready () |
Emitted once after the initial GetManagedObjects round-trip completes. | |
Public Member Functions | |
| ObjectManager (QDBusConnection connection, QString service, QString rootPath=QStringLiteral("/"), QObject *parent=nullptr, const QLoggingCategory *log=nullptr) | |
| ~ObjectManager () override | |
| QString | service () const |
| QString | rootPath () const |
| bool | isReady () const |
True once the initial GetManagedObjects round-trip has completed (success or error). | |
Service-agnostic observer for org.freedesktop.DBus.ObjectManager.
Binds a (connection, service, rootPath) triple, issues an async GetManagedObjects on construction, and subscribes to InterfacesAdded / InterfacesRemoved. It does NOT materialise typed objects — it emits the raw (path, interfaces) payloads and lets each consumer build its own domain objects from them. This keeps the helper reusable across every ObjectManager-rooted service (BlueZ devices, logind sessions, etc.).
The initial enumeration and both signals are delivered as raw QDBusMessages and demarshalled by hand, so no nested-container metatype (a{oa{sa{sv}}}) ever needs registering.
Lifetime: the observer is inert if the bus is disconnected at construction (no call is issued and ready never fires). Otherwise ready fires exactly once, after the initial GetManagedObjects round-trip completes — whether it succeeded or errored — so consumers get a deterministic "initial snapshot delivered" edge before relying on incremental signals.
|
explicit |
| connection | Bus the service lives on (e.g. system bus for BlueZ). |
| service | Destination D-Bus service name (e.g. org.bluez). |
| rootPath | Path of the ObjectManager (the GetManagedObjects target and the signal-match path); BlueZ uses /. |
| parent | QObject parent. |
| log | Logging category for call-failure warnings; when null, lcPhosphorDBus() is used. Must have static / program lifetime (an async callback dereferences it). |
|
override |
|
signal |
A managed object appeared, or the initial walk surfaced it.
Carries the object path and every interface (with properties) the object exposes.
|
signal |
Some of an object's interfaces went away.
interfaces lists the interface names removed; when it covers the object's last interface the object itself is gone.
| bool PhosphorDBus::ObjectManager::isReady | ( | ) | const |
True once the initial GetManagedObjects round-trip has completed (success or error).
Always false while the bus is disconnected.
|
signal |
Emitted once after the initial GetManagedObjects round-trip completes.
| QString PhosphorDBus::ObjectManager::rootPath | ( | ) | const |
| QString PhosphorDBus::ObjectManager::service | ( | ) | const |