summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-24 01:05:37 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-11-20 21:47:35 +0200
commit6d492c2d758f7ab958f9d4afe1b157b59bb41c34 (patch)
tree798cd7d27fe31451b725db03319d60baf9fcde70 /src
parente89c2b22957b9faa2d9521dd8d696ed1cefc7dda (diff)
libcamera: controls: Add move constructor to ControlInfoMap
The ControlInfoMap class has a move assignment operator from a plain map, but no corresponding move constructor. Add one. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/controls.cpp13
1 files changed, 13 insertions, 0 deletions
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