@@ -470,6 +470,9 @@ public:
const ControlValue &get(unsigned int id) const;
void set(unsigned int id, const ControlValue &value);
+ bool erase(unsigned int id);
+ bool erase(const ControlId &ctrl) { return erase(ctrl.id()); }
+
const ControlInfoMap *infoMap() const { return infoMap_; }
const ControlIdMap *idMap() const { return idmap_; }
@@ -1156,6 +1156,23 @@ void ControlList::set(unsigned int id, const ControlValue &value)
*val = value;
}
+/**
+ * \brief Remove the value of control \a id
+ * \param[in] id The control ID
+ * \return \a true if \a id was present, \a false otherwise
+ */
+bool ControlList::erase(unsigned int id)
+{
+ return controls_.erase(id);
+}
+
+/**
+ * \fn ControlList::erase(const ControlId &ctrl)
+ * \brief Remove the value of control \a ctrl
+ * \param[in] ctrl The control
+ * \return \a true if \a ctrl was present, \a false otherwise
+ */
+
/**
* \fn ControlList::infoMap()
* \brief Retrieve the ControlInfoMap used to construct the ControlList
Add two `erase()` functions that can be used to remove elements from a `ControlList` instance. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- include/libcamera/controls.h | 3 +++ src/libcamera/controls.cpp | 17 +++++++++++++++++ 2 files changed, 20 insertions(+)