summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libcamera/controls.h1
-rw-r--r--src/libcamera/controls.cpp13
2 files changed, 14 insertions, 0 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index 1ecc8fcb..1468326d 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -147,6 +147,7 @@ public:
ControlInfoMap() = default;
ControlInfoMap(const ControlInfoMap &other) = default;
ControlInfoMap(std::initializer_list<Map::value_type> init);
+ ControlInfoMap(Map &&info);
ControlInfoMap &operator=(const ControlInfoMap &other) = default;
ControlInfoMap &operator=(std::initializer_list<Map::value_type> init);
diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
index a6223b82..50f37c6b 100644
--- a/src/libcamera/controls.cpp
+++ b/src/libcamera/controls.cpp
@@ -447,6 +447,19 @@ ControlInfoMap::ControlInfoMap(std::initializer_list<Map::value_type> init)
}
/**
+ * \brief Construct a ControlInfoMap from a plain map
+ * \param[in] info The control info plain map
+ *
+ * Construct a new ControlInfoMap and populate its contents with those of
+ * \a info using move semantics. Upon return the \a info map will be empty.
+ */
+ControlInfoMap::ControlInfoMap(Map &&info)
+ : Map(std::move(info))
+{
+ generateIdmap();
+}
+
+/**
* \fn ControlInfoMap &ControlInfoMap::operator=(const ControlInfoMap &other)
* \brief Copy assignment operator, replace the contents with a copy of \a other
* \param[in] other The other ControlInfoMap