From patchwork Tue Nov 3 01:02:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10312 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 E5634BDB1E for ; Tue, 3 Nov 2020 01:03:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7389C60345; Tue, 3 Nov 2020 02:03:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kmYeOTG5"; 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 674EC60345 for ; Tue, 3 Nov 2020 02:03:43 +0100 (CET) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E3C9E332 for ; Tue, 3 Nov 2020 02:03:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1604365423; bh=Nq0sZbagtqaUmgPe7gZKxM6QpmN7xgapARNBYf+IO2w=; h=From:To:Subject:Date:From; b=kmYeOTG5NAQSLBqkyGnq0L4cbOaPQOKTU2Pc2jKQ0xAWO/FZK4VIkCZFBGMxGDdwO 8wV5gD6VgvhcZNtD4L/ylDFv14BnmMbRrya1zjT83thgZSfK76WheDz0zHCUaUBrBF FG2GMbJQVXHfqbB3gPYzy21OZEpXen5nrEy+0ENs= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Tue, 3 Nov 2020 03:02:47 +0200 Message-Id: <20201103010251.14689-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 0/4] libcamera: Implement d-pointer design pattern 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" Hello, This patch series implements the d-pointer design pattern in a base class, generalizing the custom implementations from the Camera and CameraManager classes. This was mostly developed as a base for the reprocessing API (the reworked camera configuration API will make use of d-pointers), but I believe it makes sense on its own. The series is quite straightforward. Patch 1/4 adds a formatter to checkstyle.py to ensure consistent naming of variables related to this design pattern. This stems from patch 2/4, which implements the framework, not hiding variable declarations in the LIBCAMERA_D_PTR() and LIBCAMERA_O_PTR() macros anymore. Patches 4/5 and 5/5 replace the manual implementations. Please see individual patches for details. Laurent Pinchart (4): utils: checkstyle.py: Add d-pointer formatter libcamera: Add a base class to implement the d-pointer design pattern libcamera: camera_manager: Inherit from Extensible libcamera: camera: Inherit from Extensible include/libcamera/camera.h | 9 +- include/libcamera/camera_manager.h | 7 +- include/libcamera/extensible.h | 87 +++++++++++++++++++ include/libcamera/meson.build | 1 + src/libcamera/camera.cpp | 123 +++++++++++++++----------- src/libcamera/camera_manager.cpp | 55 +++++++----- src/libcamera/extensible.cpp | 134 +++++++++++++++++++++++++++++ src/libcamera/meson.build | 1 + utils/checkstyle.py | 32 +++++++ 9 files changed, 373 insertions(+), 76 deletions(-) create mode 100644 include/libcamera/extensible.h create mode 100644 src/libcamera/extensible.cpp