From patchwork Tue Apr 20 09:38:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 12008 X-Patchwork-Delegate: jacopo@jmondi.org 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 94A99BD816 for ; Tue, 20 Apr 2021 09:38:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 853CD68845; Tue, 20 Apr 2021 11:38:24 +0200 (CEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 10F1B68835 for ; Tue, 20 Apr 2021 11:38:23 +0200 (CEST) X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 78CA01BF214; Tue, 20 Apr 2021 09:38:22 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 20 Apr 2021 11:38:58 +0200 Message-Id: <20210420093859.14280-2-jacopo@jmondi.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210420093859.14280-1-jacopo@jmondi.org> References: <20210420093859.14280-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/2] libcamera: Drop argument from LIBCAMERA_DECLARE_PRIVATE 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" The LIBCAMERA_DECLARE_PRIVATE() macro, used by the library classes that inherits from libcamera::Extensible in order to implement the PIMPL pattern, expands to: public: \ class Private; \ friend class Private; The 'klass' argument is not used and it might confuse developers as it might hint that the class that defines the pattern's implementation can be freely named, while it is actually hardcoded to 'Private'. Drop the argument from the macro definition. Reviewed-by: Hanlin Chen Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- include/libcamera/camera.h | 2 +- include/libcamera/camera_manager.h | 2 +- include/libcamera/class.h | 4 ++-- src/android/camera_buffer.h | 2 +- src/libcamera/class.cpp | 4 +--- 5 files changed, 6 insertions(+), 8 deletions(-) -- 2.31.1 diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h index 326b14d0ca01..d71641805c0a 100644 --- a/include/libcamera/camera.h +++ b/include/libcamera/camera.h @@ -74,7 +74,7 @@ protected: class Camera final : public Object, public std::enable_shared_from_this, public Extensible { - LIBCAMERA_DECLARE_PRIVATE(Camera) + LIBCAMERA_DECLARE_PRIVATE() public: static std::shared_ptr create(PipelineHandler *pipe, diff --git a/include/libcamera/camera_manager.h b/include/libcamera/camera_manager.h index 35a59f0df4ca..c2f0b786da8e 100644 --- a/include/libcamera/camera_manager.h +++ b/include/libcamera/camera_manager.h @@ -22,7 +22,7 @@ class Camera; class CameraManager : public Object, public Extensible { - LIBCAMERA_DECLARE_PRIVATE(CameraManager) + LIBCAMERA_DECLARE_PRIVATE() public: CameraManager(); ~CameraManager(); diff --git a/include/libcamera/class.h b/include/libcamera/class.h index 920624d8e726..466114ecfaf4 100644 --- a/include/libcamera/class.h +++ b/include/libcamera/class.h @@ -30,7 +30,7 @@ namespace libcamera { #endif #ifndef __DOXYGEN__ -#define LIBCAMERA_DECLARE_PRIVATE(klass) \ +#define LIBCAMERA_DECLARE_PRIVATE() \ public: \ class Private; \ friend class Private; @@ -46,7 +46,7 @@ public: \ _o(); #else -#define LIBCAMERA_DECLARE_PRIVATE(klass) +#define LIBCAMERA_DECLARE_PRIVATE() #define LIBCAMERA_DECLARE_PUBLIC(klass) #define LIBCAMERA_D_PTR(klass) #define LIBCAMERA_O_PTR(klass) diff --git a/src/android/camera_buffer.h b/src/android/camera_buffer.h index 7e8970b49f49..c88124b2b3f3 100644 --- a/src/android/camera_buffer.h +++ b/src/android/camera_buffer.h @@ -14,7 +14,7 @@ class CameraBuffer final : public libcamera::Extensible { - LIBCAMERA_DECLARE_PRIVATE(CameraBuffer) + LIBCAMERA_DECLARE_PRIVATE() public: CameraBuffer(buffer_handle_t camera3Buffer, int flags); diff --git a/src/libcamera/class.cpp b/src/libcamera/class.cpp index 340b7de7911c..171f7c0a927b 100644 --- a/src/libcamera/class.cpp +++ b/src/libcamera/class.cpp @@ -77,12 +77,10 @@ namespace libcamera { /** * \def LIBCAMERA_DECLARE_PRIVATE * \brief Declare private data for a public class - * \param klass The public class name * * The LIBCAMERA_DECLARE_PRIVATE() macro plumbs the infrastructure necessary to * make a class manage its private data through a d-pointer. It shall be used at - * the very top of the class definition, with the public class name passed as - * the \a klass parameter. + * the very top of the class definition. */ /** From patchwork Tue Apr 20 09:38:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 12009 X-Patchwork-Delegate: jacopo@jmondi.org 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 4B12DBD816 for ; Tue, 20 Apr 2021 09:38:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B10CE68848; Tue, 20 Apr 2021 11:38:24 +0200 (CEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 93A1C68835 for ; Tue, 20 Apr 2021 11:38:23 +0200 (CEST) X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 38B471BF218; Tue, 20 Apr 2021 09:38:23 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 20 Apr 2021 11:38:59 +0200 Message-Id: <20210420093859.14280-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210420093859.14280-1-jacopo@jmondi.org> References: <20210420093859.14280-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/2] libcamera: class: Drop 'klass' argument from documentation 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" The LIBCAMERA_D_PTR() and LIBCAMERA_O_PTR() macros do not require an argument, but the version of the macro consumed by Doxygen does. Fix this by removing the klass parameter from both macros in their documentation version. Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- include/libcamera/class.h | 4 ++-- src/libcamera/class.cpp | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/libcamera/class.h b/include/libcamera/class.h index 466114ecfaf4..f384a4889588 100644 --- a/include/libcamera/class.h +++ b/include/libcamera/class.h @@ -48,8 +48,8 @@ public: \ #else #define LIBCAMERA_DECLARE_PRIVATE() #define LIBCAMERA_DECLARE_PUBLIC(klass) -#define LIBCAMERA_D_PTR(klass) -#define LIBCAMERA_O_PTR(klass) +#define LIBCAMERA_D_PTR() +#define LIBCAMERA_O_PTR() #endif class Extensible diff --git a/src/libcamera/class.cpp b/src/libcamera/class.cpp index 171f7c0a927b..28c35633d7db 100644 --- a/src/libcamera/class.cpp +++ b/src/libcamera/class.cpp @@ -95,9 +95,8 @@ namespace libcamera { */ /** - * \def LIBCAMERA_D_PTR(klass) + * \def LIBCAMERA_D_PTR() * \brief Retrieve the private data pointer - * \param[in] klass The public class name * * This macro can be used in any member function of a class that inherits, * directly or indirectly, from the Extensible class, to create a local @@ -105,9 +104,8 @@ namespace libcamera { */ /** - * \def LIBCAMERA_O_PTR(klass) + * \def LIBCAMERA_O_PTR() * \brief Retrieve the public instance corresponding to the private data - * \param[in] klass The public class name * * This macro is the counterpart of LIBCAMERA_D_PTR() for private data classes. * It can be used in any member function of the private data class to create a