@@ -516,6 +516,7 @@ public:
const ControlValue &get(unsigned int id) const;
void set(unsigned int id, const ControlValue &value);
+ void set(unsigned int id, ControlValue &&value);
const ControlInfoMap *infoMap() const { return infoMap_; }
const ControlIdMap *idMap() const { return idmap_; }
@@ -1189,6 +1189,18 @@ void ControlList::set(unsigned int id, const ControlValue &value)
*val = value;
}
+/**
+ * \copydoc ControlList::set(unsigned int, const ControlValue &)
+ */
+void ControlList::set(unsigned int id, ControlValue &&value)
+{
+ ControlValue *val = find(id);
+ if (!val)
+ return;
+
+ *val = std::move(value);
+}
+
/**
* \fn ControlList::infoMap()
* \brief Retrieve the ControlInfoMap used to construct the ControlList
Add an overload of `ControlList::set()` that takes the `ControlValue` argument as an rvalue reference, therefore enabling the use of move assignment. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- include/libcamera/controls.h | 1 + src/libcamera/controls.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+)