Add associations::Manager class
This class will handle creating the org.openbmc.Associations
D-Bus interfaces on inventory paths if it has been told to
by a JSON configuration file.
Every time PIM creates a new inventory path, this class will
check to see if any associations need to be created.
This functionality is optional, and is off by default. To
enable it, the --enable-associations configure option needs to
be used.
This commit just introduces the class.
Change-Id: I70045b768f3db683bcfac0c7d4bc9798eb10a5c5
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/manager.cpp b/manager.cpp
index a665ea8..c9d84c6 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -60,6 +60,10 @@
const char* root, const char* iface) :
ServerObject<ManagerIface>(bus, root),
_shutdown(false), _root(root), _bus(std::move(bus)), _manager(_bus, root)
+#ifdef CREATE_ASSOCIATIONS
+ ,
+ _associations(_bus)
+#endif
{
for (auto& group : _events)
{
@@ -237,6 +241,12 @@
updateInterfaces(absPath, objit->second, refit, newObj,
restoreFromCache);
+#ifdef CREATE_ASSOCIATIONS
+ if (newObj)
+ {
+ _associations.createAssociations(absPath);
+ }
+#endif
++objit;
}
}