From patchwork Fri Nov 8 20:53:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2302 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 62F6761373 for ; Fri, 8 Nov 2019 21:54:24 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0DC4A2D1 for ; Fri, 8 Nov 2019 21:54:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1573246464; bh=O+T5l8wGjneoI9bPSa6I1IA4dwhgv70DhQpQ0caJs/w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TqGaZJ73j0hEhXtU02Jsddb2ro6FwFLgaeJ+F8lRaMel8M8HLeUnsJhrabQ4Q5l0m ERw38PGFrn5AM4JG9zOb9YX0RjXqQDrslak3Z+B8UYX0DglSayqzavC6RkLdtQeNrD q1pUhVJ7V46Z1l5l8rCco1IYkIq3P0mzyqHOp43s= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 8 Nov 2019 22:53:51 +0200 Message-Id: <20191108205409.18845-7-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191108205409.18845-1-laurent.pinchart@ideasonboard.com> References: <20191108205409.18845-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 06/24] libcamera: controls: Add move constructor to ControlInfoMap X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 20:54:25 -0000 The ControlInfoMap class has a move assignment operator from a plain map, but on corresponding move constructor. Add one. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- 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 init); + ControlInfoMap(Map &&info); ControlInfoMap &operator=(const ControlInfoMap &other) = default; ControlInfoMap &operator=(std::initializer_list 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 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. + */ +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