control: Add Zone::hasFloorHold() function
Add this to the Zone class so actions can check if they currently have a
floor hold.
Change-Id: I84d0cec7bc3d45feab0ae2c4b08acf6832337f8f
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/control/json/zone.hpp b/control/json/zone.hpp
index d94e064..21fccbc 100644
--- a/control/json/zone.hpp
+++ b/control/json/zone.hpp
@@ -264,6 +264,17 @@
void setFloorHold(const std::string& ident, uint64_t target, bool hold);
/**
+ * @brief Says if the passed in identity has a floor hold
+ *
+ * @param ident - The identity key to check
+ * @return bool - If it has a floor hold or not
+ */
+ inline bool hasFloorHold(const std::string& ident) const
+ {
+ return _floorHolds.contains(ident);
+ }
+
+ /**
* @brief Set the default floor to the given value
*
* @param[in] value - Value to set the default floor to