From patchwork Tue Jan 13 00:07:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 25730 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 004C4BDCBF for ; Tue, 13 Jan 2026 00:08:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8EE9061FD9; Tue, 13 Jan 2026 01:08:46 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="BwYVPv/c"; 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 D001061FD1 for ; Tue, 13 Jan 2026 01:08:44 +0100 (CET) Received: from pendragon.ideasonboard.com (81-175-209-152.bb.dnainternet.fi [81.175.209.152]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 275DF50A for ; Tue, 13 Jan 2026 01:08:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768262899; bh=dcgyHiAYwxc6UdyxdPeoYi9mEglAy8imsqnuuKRslNc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BwYVPv/ckMcCjkGfDmO37kd3L0HqHIikQPYsT0s3al5PoLTCBegvN5G4B9EgZCm34 E/Y32ZQdAHlFAOHV3kb9/C3fOT25J/cWx6fuyuFgucxXOgHX0iEvXR3LGVEexW2bXU /9u71oqPpijqEvz55k6XFWG2hRdhgx6ha6LGwwwg= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH 10/36] libcamera: yaml_parser: Rename Getter to Accessor Date: Tue, 13 Jan 2026 02:07:42 +0200 Message-ID: <20260113000808.15395-11-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20260113000808.15395-1-laurent.pinchart@ideasonboard.com> References: <20260113000808.15395-1-laurent.pinchart@ideasonboard.com> 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" In preparation for support to set the value of a YamlObject, rename the Getter structure to Accessor. The structure will be extended with a set() function. Signed-off-by: Laurent Pinchart --- include/libcamera/internal/matrix.h | 2 +- include/libcamera/internal/vector.h | 2 +- include/libcamera/internal/yaml_parser.h | 6 +++--- src/ipa/libipa/lsc_polynomial.h | 2 +- src/ipa/libipa/pwl.cpp | 2 +- src/libcamera/yaml_parser.cpp | 24 ++++++++++++------------ 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/libcamera/internal/matrix.h b/include/libcamera/internal/matrix.h index 1842389f2b22..67761cb6037d 100644 --- a/include/libcamera/internal/matrix.h +++ b/include/libcamera/internal/matrix.h @@ -200,7 +200,7 @@ std::ostream &operator<<(std::ostream &out, const Matrix &m) } template -struct YamlObject::Getter> { +struct YamlObject::Accessor> { std::optional> get(const YamlObject &obj) const { if (!matrixValidateYaml(obj, Rows * Cols)) diff --git a/include/libcamera/internal/vector.h b/include/libcamera/internal/vector.h index 16b6aef0b38f..cfd8882ce0e6 100644 --- a/include/libcamera/internal/vector.h +++ b/include/libcamera/internal/vector.h @@ -347,7 +347,7 @@ std::ostream &operator<<(std::ostream &out, const Vector &v) } template -struct YamlObject::Getter> { +struct YamlObject::Accessor> { std::optional> get(const YamlObject &obj) const { if (!vectorValidateYaml(obj, Rows)) diff --git a/include/libcamera/internal/yaml_parser.h b/include/libcamera/internal/yaml_parser.h index 03d6a05e2d0f..0ff026706682 100644 --- a/include/libcamera/internal/yaml_parser.h +++ b/include/libcamera/internal/yaml_parser.h @@ -173,7 +173,7 @@ public: template std::optional get() const { - return Getter{}.get(*this); + return Accessor{}.get(*this); } template @@ -213,7 +213,7 @@ private: LIBCAMERA_DISABLE_COPY_AND_MOVE(YamlObject) template - friend struct Getter; + friend struct Accessor; friend class YamlParserContext; enum class Type { @@ -224,7 +224,7 @@ private: }; template - struct Getter { + struct Accessor { std::optional get(const YamlObject &obj) const; }; diff --git a/src/ipa/libipa/lsc_polynomial.h b/src/ipa/libipa/lsc_polynomial.h index c898faeb13db..df3a0d4b39c4 100644 --- a/src/ipa/libipa/lsc_polynomial.h +++ b/src/ipa/libipa/lsc_polynomial.h @@ -81,7 +81,7 @@ private: #ifndef __DOXYGEN__ template<> -struct YamlObject::Getter { +struct YamlObject::Accessor { std::optional get(const YamlObject &obj) const { std::optional cx = obj["cx"].get(); diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp index 72b63c4d068d..f38573e69c13 100644 --- a/src/ipa/libipa/pwl.cpp +++ b/src/ipa/libipa/pwl.cpp @@ -435,7 +435,7 @@ std::string Pwl::toString() const */ template<> std::optional -YamlObject::Getter::get(const YamlObject &obj) const +YamlObject::Accessor::get(const YamlObject &obj) const { /* Treat a single value as single point PWL. */ if (obj.isValue()) { diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp index 72580e901ddd..a21e589fdd86 100644 --- a/src/libcamera/yaml_parser.cpp +++ b/src/libcamera/yaml_parser.cpp @@ -134,7 +134,7 @@ std::size_t YamlObject::size() const template<> std::optional -YamlObject::Getter::get(const YamlObject &obj) const +YamlObject::Accessor::get(const YamlObject &obj) const { if (obj.type_ != Type::Value) return std::nullopt; @@ -148,7 +148,7 @@ YamlObject::Getter::get(const YamlObject &obj) const } template -struct YamlObject::Getter || std::is_same_v || std::is_same_v || @@ -173,23 +173,23 @@ struct YamlObject::Getter; -template struct YamlObject::Getter; -template struct YamlObject::Getter; -template struct YamlObject::Getter; -template struct YamlObject::Getter; -template struct YamlObject::Getter; +template struct YamlObject::Accessor; +template struct YamlObject::Accessor; +template struct YamlObject::Accessor; +template struct YamlObject::Accessor; +template struct YamlObject::Accessor; +template struct YamlObject::Accessor; template<> std::optional -YamlObject::Getter::get(const YamlObject &obj) const +YamlObject::Accessor::get(const YamlObject &obj) const { return obj.get(); } template<> std::optional -YamlObject::Getter::get(const YamlObject &obj) const +YamlObject::Accessor::get(const YamlObject &obj) const { if (obj.type_ != Type::Value) return std::nullopt; @@ -210,7 +210,7 @@ YamlObject::Getter::get(const YamlObject &obj) const template<> std::optional -YamlObject::Getter::get(const YamlObject &obj) const +YamlObject::Accessor::get(const YamlObject &obj) const { if (obj.type_ != Type::Value) return std::nullopt; @@ -220,7 +220,7 @@ YamlObject::Getter::get(const YamlObject &obj) const template<> std::optional -YamlObject::Getter::get(const YamlObject &obj) const +YamlObject::Accessor::get(const YamlObject &obj) const { if (obj.type_ != Type::List) return std::nullopt;