Patch Detail
Show a patch.
GET /api/patches/25746/?format=api
{ "id": 25746, "url": "https://patchwork.libcamera.org/api/patches/25746/?format=api", "web_url": "https://patchwork.libcamera.org/patch/25746/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260113000808.15395-27-laurent.pinchart@ideasonboard.com>", "date": "2026-01-13T00:07:58", "name": "[26/36] libcamera: value_node: Rework templates to prepare for mutable views", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "737cf40945077caca8d10412435041079cb33f08", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/25746/mbox/", "series": [ { "id": 5703, "url": "https://patchwork.libcamera.org/api/series/5703/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5703", "date": "2026-01-13T00:07:32", "name": "libcamera: Global configuration file improvements", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5703/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/25746/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/25746/checks/", "tags": {}, "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 321D3C32EA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Jan 2026 00:09:14 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CD7E961FFC;\n\tTue, 13 Jan 2026 01:09:13 +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 811B161FD9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Jan 2026 01:09:12 +0100 (CET)", "from pendragon.ideasonboard.com (81-175-209-152.bb.dnainternet.fi\n\t[81.175.209.152])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id D5618BCA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Jan 2026 01:08:46 +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=\"bJnY2hW0\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768262927;\n\tbh=G5F6ILJj2jySIS86YLqqeBaHY9/JGqHNy0/Rhw+qV38=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=bJnY2hW0MO1Kk45/JcTmkGaPeP+EX+Xc2h9wci6sXJK95Z2xqZtymzQEKDN1ARxvH\n\tOIR0kkIPi2YkbCEi0fJL6/q2KBW6iDqIrS6LPO5YRXJUDGZd4KOBq4b8jWP8EYsJvn\n\tLjmpsTSjrXtXz1sjA3yNaqm0d9SPgbSnyBoJJ+vM=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[PATCH 26/36] libcamera: value_node: Rework templates to prepare for\n\tmutable views", "Date": "Tue, 13 Jan 2026 02:07:58 +0200", "Message-ID": "<20260113000808.15395-27-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", "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>" }, "content": "ValueNode provides adapter classes to expose the object as an iteratable\nlist or dictionary. The Iterator and Adapter classes hardcode the\nassumption that the ValueNode is const. To prepare for mutable views,\nmove the const specifier to the top-level DictAdapter and ListAdapter\nclass templates.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/value_node.h | 54 ++++++++++++++++---------\n 1 file changed, 35 insertions(+), 19 deletions(-)", "diff": "diff --git a/include/libcamera/internal/value_node.h b/include/libcamera/internal/value_node.h\nindex eb509d855810..dd45859f3501 100644\n--- a/include/libcamera/internal/value_node.h\n+++ b/include/libcamera/internal/value_node.h\n@@ -38,14 +38,14 @@ private:\n \n public:\n #ifndef __DOXYGEN__\n-\ttemplate<typename Derived>\n+\ttemplate<typename Derived, typename ContainerIterator>\n \tclass Iterator\n \t{\n \tpublic:\n \t\tusing difference_type = std::ptrdiff_t;\n \t\tusing iterator_category = std::forward_iterator_tag;\n \n-\t\tIterator(typename ValueContainer::const_iterator it)\n+\t\tIterator(ContainerIterator it)\n \t\t\t: it_(it)\n \t\t{\n \t\t}\n@@ -74,14 +74,14 @@ public:\n \t\t}\n \n \tprotected:\n-\t\tValueContainer::const_iterator it_;\n+\t\tContainerIterator it_;\n \t};\n \n-\ttemplate<typename Iterator>\n+\ttemplate<typename Iterator, typename Container>\n \tclass Adapter\n \t{\n \tpublic:\n-\t\tAdapter(const ValueContainer &container)\n+\t\tAdapter(Container &container)\n \t\t\t: container_(container)\n \t\t{\n \t\t}\n@@ -97,47 +97,63 @@ public:\n \t\t}\n \n \tprotected:\n-\t\tconst ValueContainer &container_;\n+\t\tContainer &container_;\n \t};\n \n-\tclass ListIterator : public Iterator<ListIterator>\n+\ttemplate<typename Value, typename ContainerIterator>\n+\tclass ListIterator : public Iterator<ListIterator<Value, ContainerIterator>,\n+\t\t\t\t\t ContainerIterator>\n \t{\n-\tpublic:\n-\t\tusing value_type = const ValueNode &;\n-\t\tusing pointer = const ValueNode *;\n-\t\tusing reference = value_type;\n+\tprivate:\n+\t\tusing Base = Iterator<ListIterator<Value, ContainerIterator>,\n+\t\t\t\t ContainerIterator>;\n \n-\t\tvalue_type operator*() const\n+\tpublic:\n+\t\tusing value_type = Value;\n+\t\tusing pointer = value_type *;\n+\t\tusing reference = value_type &;\n+\n+\t\treference operator*() const\n \t\t{\n-\t\t\treturn *it_->value.get();\n+\t\t\treturn *Base::it_->value.get();\n \t\t}\n \n \t\tpointer operator->() const\n \t\t{\n-\t\t\treturn it_->value.get();\n+\t\t\treturn Base::it_->value.get();\n \t\t}\n \t};\n \n-\tclass DictIterator : public Iterator<DictIterator>\n+\ttemplate<typename Value, typename ContainerIterator>\n+\tclass DictIterator : public Iterator<DictIterator<Value, ContainerIterator>,\n+\t\t\t\t\t ContainerIterator>\n \t{\n+\tprivate:\n+\t\tusing Base = Iterator<DictIterator<Value, ContainerIterator>,\n+\t\t\t\t ContainerIterator>;\n+\n \tpublic:\n-\t\tusing value_type = std::pair<const std::string &, const ValueNode &>;\n+\t\tusing value_type = std::pair<const std::string &, Value &>;\n \t\tusing pointer = value_type *;\n \t\tusing reference = value_type &;\n \n \t\tvalue_type operator*() const\n \t\t{\n-\t\t\treturn { it_->key, *it_->value.get() };\n+\t\t\treturn { Base::it_->key, *Base::it_->value.get() };\n \t\t}\n \t};\n \n-\tclass DictAdapter : public Adapter<DictIterator>\n+\tclass DictAdapter : public Adapter<DictIterator<const ValueNode,\n+\t\t\t\t\t\t\tValueContainer::const_iterator>,\n+\t\t\t\t\t const ValueContainer>\n \t{\n \tpublic:\n \t\tusing key_type = std::string;\n \t};\n \n-\tclass ListAdapter : public Adapter<ListIterator>\n+\tclass ListAdapter : public Adapter<ListIterator<const ValueNode,\n+\t\t\t\t\t\t\tValueContainer::const_iterator>,\n+\t\t\t\t\t const ValueContainer>\n \t{\n \t};\n #endif /* __DOXYGEN__ */\n", "prefixes": [ "26/36" ] }