From patchwork Thu Sep 3 09:18:38 2026 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: 28180 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 9D655C3348 for ; Thu, 3 Sep 2026 09:18:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9A179685EE; Thu, 3 Sep 2026 11:18:51 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="u5l/J4nQ"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9FFCE6838A for ; Thu, 3 Sep 2026 11:18:47 +0200 (CEST) Received: from pb-laptop.local (185.221.143.32.nat.pool.zt.hu [185.221.143.32]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ED49E1CF5 for ; Thu, 3 Sep 2026 11:17:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1788427035; bh=+LHGqyE5/rKvVEHXnKdtvE4qfIZ+722EpcEs021X7c0=; h=From:To:Subject:Date:From; b=u5l/J4nQRYY5CujKHPYzzzW7ciuYOG/0MZgZOWhx+sC0WEHwa4WQ3er6GDuTRPEzJ 3/bWvLRczjrLu9C/38cQCoWK0v7h60FoHbmlN5Wcvh/UsWMOBTVuBV98RK2P2VlDDP m4lEil81h2ulOkEtuM9z4v9obQoy1HJyBedIx1+U= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v3 0/5] libcamera: controls: Move constructor/assignment + swap Date: Thu, 3 Sep 2026 11:18:38 +0200 Message-ID: <20260903091843.85548-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.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 v3: * remove `type_` bitfield as well changes in v2: * remove `numElements_` bit field to simplify swap * add `ControlList::set(unsigned int, ControlValue&&)` overload v2: https://patchwork.libcamera.org/cover/23190/ 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: Remove bit fields libcamera: controls: Implement move ctor/assignment libcamera: controls: Implement `swap()` libcamera: controls: Add rvalue overload for `ControlList::set()` include/libcamera/controls.h | 49 +++++++++++++++++++++++++---- src/libcamera/controls.cpp | 61 +++++++++++++++++++++++++++++++----- 2 files changed, 96 insertions(+), 14 deletions(-) --- 2.55.0