From patchwork Mon Apr 21 15:35:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 23190 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 05641C327D for ; Mon, 21 Apr 2025 15:36:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9894368ACC; Mon, 21 Apr 2025 17:36:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="UI1Jnx+P"; dkim-atps=neutral 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 CF11E68ABA for ; Mon, 21 Apr 2025 17:35:59 +0200 (CEST) Received: from pb-laptop.local (185.221.143.16.nat.pool.zt.hu [185.221.143.16]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1C0DC6D5 for ; Mon, 21 Apr 2025 17:33:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745249633; bh=RkCC2XgS/ijoUy1BJvPRoloxfXSDvx+SGgOcvAMmr4k=; h=From:To:Subject:Date:From; b=UI1Jnx+Pa/Ho6sXCCfK/JJ766OsR2J7smVCXJiFtG9yADRlpMhL4ZFB8DU2KlLkhO ZT4TFY1Lkb1oQ7fTz9m1ypssVNV3x1EeQfobv1HVOQlG2KDjoS1Lx6TOOC+3Brbtvv uK5NsoAPo63uvmmineYhbmwKtLe85S+w2499gP+I= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 0/5] libcamera: controls: Move constructor/assignment + swap Date: Mon, 21 Apr 2025 17:35:51 +0200 Message-ID: <20250421153556.171192-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Implement move constructor / assignment operator for `ControlValue` since the type already has an "empty" state that can be used for this purpose. Also add `swap()` since that can also be implemented more efficiently than the default move construction + 2 move assignment that `std::swap()` implements. And lastly add an rvalue overload for `ControlList::set()` to make use of move assignment. changes in v2: * remove `numElements_` bit field to simplify swap * add `ControlList::set(unsigned int, ControlValue&&)` overload v1: https://patchwork.libcamera.org/project/libcamera/list/?series=5131 Barnabás Pőcze (5): libcamera: controls: Give name to the union containing storage libcamera: controls: Replace `numElements_` bit field libcamera: controls: Implement move ctor/assignment libcamera: controls: Implement `swap()` libcamera: controls: Add rvalue overload for `ControlList::set()` include/libcamera/controls.h | 54 ++++++++++++++++++++++++++++--- src/libcamera/controls.cpp | 62 ++++++++++++++++++++++++++++++------ 2 files changed, 103 insertions(+), 13 deletions(-) --- 2.49.0