summaryrefslogtreecommitdiffstats
path: root/control/handlers.hpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2018-03-20 15:52:33 -0500
committerMatthew Barth <msbarth@us.ibm.com>2018-03-30 09:48:49 -0500
commit1499a5c3635f22a3607c19c836bc00deb671ad10 (patch)
treec5380107b706f951bdddd3966a1509146d1482e9 /control/handlers.hpp
parentc72b891193f15622de56f086311ef494cda046ea (diff)
downloadphosphor-fan-presence-1499a5c3635f22a3607c19c836bc00deb671ad10.tar.gz
phosphor-fan-presence-1499a5c3635f22a3607c19c836bc00deb671ad10.zip
Add InterfacesRemoved signal handling
When an InterfacesRemoved signal is received for a subscribed object path, each interface returned is checked against the interface which was defined for each object on the event. When these are equal, the interface (and all associated properties) are removed from the shared cache of event properties. Tested: Manually added an InterfacesRemoved signal Verified interface was removed from object path in cache Change-Id: I348d82f14e0cfba2b18a81a9f54c6cb06b586797 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'control/handlers.hpp')
-rw-r--r--control/handlers.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/control/handlers.hpp b/control/handlers.hpp
index 96cfa2f..ef5d5d8 100644
--- a/control/handlers.hpp
+++ b/control/handlers.hpp
@@ -49,6 +49,25 @@ auto setService(Group&& group)
};
}
+/**
+ * @brief A handler function to remove an interface from an object path
+ * @details Removes an interface from an object's path which includes removing
+ * all properties that would be under that interface
+ *
+ * @param[in] path - Object's path name
+ * @param[in] interface - Object's interface name
+ *
+ * @return Lambda function
+ * A lambda function to remove the interface
+ */
+auto removeInterface(const char* path, const char* interface)
+{
+ return[=](auto& zone)
+ {
+ zone.removeObjIntf(path, interface);
+ };
+}
+
} // namespace handler
} // namespace control
} // namespace fan
OpenPOWER on IntegriCloud