[libcamera-devel] [PATCH v2 06/24] libcamera: controls: Add move constructor to ControlInfoMap
Jacopo Mondi
jacopo at jmondi.org
Fri Nov 15 17:19:39 CET 2019
Hi Laurent,
On Fri, Nov 08, 2019 at 10:53:51PM +0200, Laurent Pinchart wrote:
> The ControlInfoMap class has a move assignment operator from a plain
> map, but on corresponding move constructor. Add one.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> include/libcamera/controls.h | 1 +
> src/libcamera/controls.cpp | 13 +++++++++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
> index f9979a466eaa..548c06c65bb6 100644
> --- a/include/libcamera/controls.h
> +++ b/include/libcamera/controls.h
> @@ -146,6 +146,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 021d5f0990e0..ae6ca2a7cf7e 100644
> --- a/src/libcamera/controls.cpp
> +++ b/src/libcamera/controls.cpp
> @@ -445,6 +445,19 @@ ControlInfoMap::ControlInfoMap(std::initializer_list<Map::value_type> init)
> generateIdmap();
> }
>
> +/**
> + * \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.
^ double space
> + */
> +ControlInfoMap::ControlInfoMap(Map &&info)
> + : Map(std::move(info))
> +{
> + generateIdmap();
> +}
> +
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
Thanks
j
> /**
> * \fn ControlInfoMap &ControlInfoMap::operator=(const ControlInfoMap &other)
> * \brief Copy assignment operator, replace the contents with a copy of \a other
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20191115/87cd40d7/attachment-0001.sig>
More information about the libcamera-devel
mailing list