[{"id":37614,"web_url":"https://patchwork.libcamera.org/comment/37614/","msgid":"<268b628f-fbb5-40c1-9ab8-f5d17a7dd1f1@ideasonboard.com>","date":"2026-01-13T16:02:02","subject":"Re: [PATCH 10/36] libcamera: yaml_parser: Rename Getter to Accessor","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 01. 13. 1:07 keltezéssel, Laurent Pinchart írta:\n> In preparation for support to set the value of a YamlObject, rename the\n> Getter structure to Accessor. The structure will be extended with a\n> set() function.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n\nLooks ok.\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n\n>   include/libcamera/internal/matrix.h      |  2 +-\n>   include/libcamera/internal/vector.h      |  2 +-\n>   include/libcamera/internal/yaml_parser.h |  6 +++---\n>   src/ipa/libipa/lsc_polynomial.h          |  2 +-\n>   src/ipa/libipa/pwl.cpp                   |  2 +-\n>   src/libcamera/yaml_parser.cpp            | 24 ++++++++++++------------\n>   6 files changed, 19 insertions(+), 19 deletions(-)\n> \n> diff --git a/include/libcamera/internal/matrix.h b/include/libcamera/internal/matrix.h\n> index 1842389f2b22..67761cb6037d 100644\n> --- a/include/libcamera/internal/matrix.h\n> +++ b/include/libcamera/internal/matrix.h\n> @@ -200,7 +200,7 @@ std::ostream &operator<<(std::ostream &out, const Matrix<T, Rows, Cols> &m)\n>   }\n>   \n>   template<typename T, unsigned int Rows, unsigned int Cols>\n> -struct YamlObject::Getter<Matrix<T, Rows, Cols>> {\n> +struct YamlObject::Accessor<Matrix<T, Rows, Cols>> {\n>   \tstd::optional<Matrix<T, Rows, Cols>> get(const YamlObject &obj) const\n>   \t{\n>   \t\tif (!matrixValidateYaml(obj, Rows * Cols))\n> diff --git a/include/libcamera/internal/vector.h b/include/libcamera/internal/vector.h\n> index 16b6aef0b38f..cfd8882ce0e6 100644\n> --- a/include/libcamera/internal/vector.h\n> +++ b/include/libcamera/internal/vector.h\n> @@ -347,7 +347,7 @@ std::ostream &operator<<(std::ostream &out, const Vector<T, Rows> &v)\n>   }\n>   \n>   template<typename T, unsigned int Rows>\n> -struct YamlObject::Getter<Vector<T, Rows>> {\n> +struct YamlObject::Accessor<Vector<T, Rows>> {\n>   \tstd::optional<Vector<T, Rows>> get(const YamlObject &obj) const\n>   \t{\n>   \t\tif (!vectorValidateYaml(obj, Rows))\n> diff --git a/include/libcamera/internal/yaml_parser.h b/include/libcamera/internal/yaml_parser.h\n> index 03d6a05e2d0f..0ff026706682 100644\n> --- a/include/libcamera/internal/yaml_parser.h\n> +++ b/include/libcamera/internal/yaml_parser.h\n> @@ -173,7 +173,7 @@ public:\n>   \ttemplate<typename T>\n>   \tstd::optional<T> get() const\n>   \t{\n> -\t\treturn Getter<T>{}.get(*this);\n> +\t\treturn Accessor<T>{}.get(*this);\n>   \t}\n>   \n>   \ttemplate<typename T, typename U>\n> @@ -213,7 +213,7 @@ private:\n>   \tLIBCAMERA_DISABLE_COPY_AND_MOVE(YamlObject)\n>   \n>   \ttemplate<typename T>\n> -\tfriend struct Getter;\n> +\tfriend struct Accessor;\n>   \tfriend class YamlParserContext;\n>   \n>   \tenum class Type {\n> @@ -224,7 +224,7 @@ private:\n>   \t};\n>   \n>   \ttemplate<typename T, typename Enable = void>\n> -\tstruct Getter {\n> +\tstruct Accessor {\n>   \t\tstd::optional<T> get(const YamlObject &obj) const;\n>   \t};\n>   \n> diff --git a/src/ipa/libipa/lsc_polynomial.h b/src/ipa/libipa/lsc_polynomial.h\n> index c898faeb13db..df3a0d4b39c4 100644\n> --- a/src/ipa/libipa/lsc_polynomial.h\n> +++ b/src/ipa/libipa/lsc_polynomial.h\n> @@ -81,7 +81,7 @@ private:\n>   #ifndef __DOXYGEN__\n>   \n>   template<>\n> -struct YamlObject::Getter<ipa::LscPolynomial> {\n> +struct YamlObject::Accessor<ipa::LscPolynomial> {\n>   \tstd::optional<ipa::LscPolynomial> get(const YamlObject &obj) const\n>   \t{\n>   \t\tstd::optional<double> cx = obj[\"cx\"].get<double>();\n> diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp\n> index 72b63c4d068d..f38573e69c13 100644\n> --- a/src/ipa/libipa/pwl.cpp\n> +++ b/src/ipa/libipa/pwl.cpp\n> @@ -435,7 +435,7 @@ std::string Pwl::toString() const\n>    */\n>   template<>\n>   std::optional<ipa::Pwl>\n> -YamlObject::Getter<ipa::Pwl>::get(const YamlObject &obj) const\n> +YamlObject::Accessor<ipa::Pwl>::get(const YamlObject &obj) const\n>   {\n>   \t/* Treat a single value as single point PWL. */\n>   \tif (obj.isValue()) {\n> diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp\n> index 72580e901ddd..a21e589fdd86 100644\n> --- a/src/libcamera/yaml_parser.cpp\n> +++ b/src/libcamera/yaml_parser.cpp\n> @@ -134,7 +134,7 @@ std::size_t YamlObject::size() const\n>   \n>   template<>\n>   std::optional<bool>\n> -YamlObject::Getter<bool>::get(const YamlObject &obj) const\n> +YamlObject::Accessor<bool>::get(const YamlObject &obj) const\n>   {\n>   \tif (obj.type_ != Type::Value)\n>   \t\treturn std::nullopt;\n> @@ -148,7 +148,7 @@ YamlObject::Getter<bool>::get(const YamlObject &obj) const\n>   }\n>   \n>   template<typename T>\n> -struct YamlObject::Getter<T, std::enable_if_t<\n> +struct YamlObject::Accessor<T, std::enable_if_t<\n>   \tstd::is_same_v<int8_t, T> ||\n>   \tstd::is_same_v<uint8_t, T> ||\n>   \tstd::is_same_v<int16_t, T> ||\n> @@ -173,23 +173,23 @@ struct YamlObject::Getter<T, std::enable_if_t<\n>   \t}\n>   };\n>   \n> -template struct YamlObject::Getter<int8_t>;\n> -template struct YamlObject::Getter<uint8_t>;\n> -template struct YamlObject::Getter<int16_t>;\n> -template struct YamlObject::Getter<uint16_t>;\n> -template struct YamlObject::Getter<int32_t>;\n> -template struct YamlObject::Getter<uint32_t>;\n> +template struct YamlObject::Accessor<int8_t>;\n> +template struct YamlObject::Accessor<uint8_t>;\n> +template struct YamlObject::Accessor<int16_t>;\n> +template struct YamlObject::Accessor<uint16_t>;\n> +template struct YamlObject::Accessor<int32_t>;\n> +template struct YamlObject::Accessor<uint32_t>;\n>   \n>   template<>\n>   std::optional<float>\n> -YamlObject::Getter<float>::get(const YamlObject &obj) const\n> +YamlObject::Accessor<float>::get(const YamlObject &obj) const\n>   {\n>   \treturn obj.get<double>();\n>   }\n>   \n>   template<>\n>   std::optional<double>\n> -YamlObject::Getter<double>::get(const YamlObject &obj) const\n> +YamlObject::Accessor<double>::get(const YamlObject &obj) const\n>   {\n>   \tif (obj.type_ != Type::Value)\n>   \t\treturn std::nullopt;\n> @@ -210,7 +210,7 @@ YamlObject::Getter<double>::get(const YamlObject &obj) const\n>   \n>   template<>\n>   std::optional<std::string>\n> -YamlObject::Getter<std::string>::get(const YamlObject &obj) const\n> +YamlObject::Accessor<std::string>::get(const YamlObject &obj) const\n>   {\n>   \tif (obj.type_ != Type::Value)\n>   \t\treturn std::nullopt;\n> @@ -220,7 +220,7 @@ YamlObject::Getter<std::string>::get(const YamlObject &obj) const\n>   \n>   template<>\n>   std::optional<Size>\n> -YamlObject::Getter<Size>::get(const YamlObject &obj) const\n> +YamlObject::Accessor<Size>::get(const YamlObject &obj) const\n>   {\n>   \tif (obj.type_ != Type::List)\n>   \t\treturn std::nullopt;","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 14004BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Jan 2026 16:02:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5579261FA3;\n\tTue, 13 Jan 2026 17:02:08 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DE1B061FA0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Jan 2026 17:02:06 +0100 (CET)","from [192.168.33.30] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B56A450A;\n\tTue, 13 Jan 2026 17:01:40 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"jUjI31Ut\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768320100;\n\tbh=WAS2/06BEBS37jb8/iWSdrCCEA5OAT2pBPk1zjBNUGk=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=jUjI31UtqTDqMJ4dHhaWb/0fjs0oSgpejr6EHeqhBcUAmotmtdsmZcnqipHSfA3Cj\n\t0GwWcaFPRqLk03L55zNs3hmJQLLMeQPn6ow8m+dvwM61lM+uMNdnhe9zHXOdMPqC8z\n\tLDBuTIPTNmoNOgSOB/rVO8MCLXWootn2BOdAJSvg=","Message-ID":"<268b628f-fbb5-40c1-9ab8-f5d17a7dd1f1@ideasonboard.com>","Date":"Tue, 13 Jan 2026 17:02:02 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 10/36] libcamera: yaml_parser: Rename Getter to Accessor","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260113000808.15395-1-laurent.pinchart@ideasonboard.com>\n\t<20260113000808.15395-11-laurent.pinchart@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260113000808.15395-11-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]