{"id":9325,"url":"https://patchwork.libcamera.org/api/1.1/patches/9325/?format=json","web_url":"https://patchwork.libcamera.org/patch/9325/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200814104509.189023-2-niklas.soderlund@ragnatech.se>","date":"2020-08-14T10:45:07","name":"[libcamera-devel,v2,1/3] libcamera: pipeline_handler: Add const version of cameraData()","commit_ref":"ef5f5c4db05e5d88d58b0d565f7716c59751b991","pull_url":null,"state":"accepted","archived":false,"hash":"e0dc646339093272de6f7c1b92409b500fe127b3","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/1.1/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/9325/mbox/","series":[{"id":1220,"url":"https://patchwork.libcamera.org/api/1.1/series/1220/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1220","date":"2020-08-14T10:45:06","name":"libcamera: Mark controls and property accessors as const operations","version":2,"mbox":"https://patchwork.libcamera.org/series/1220/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/9325/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/9325/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 17478BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 Aug 2020 10:45:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E13C56163B;\n\tFri, 14 Aug 2020 12:45:21 +0200 (CEST)","from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B9723613D6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Aug 2020 12:45:19 +0200 (CEST)","from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de\n\t[84.172.82.168]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid 3edc9712-de1b-11ea-a39b-005056917f90;\n\tFri, 14 Aug 2020 12:45:19 +0200 (CEST)"],"X-Halon-ID":"3edc9712-de1b-11ea-a39b-005056917f90","Authorized-sender":"niklas.soderlund@fsdn.se","From":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 14 Aug 2020 12:45:07 +0200","Message-Id":"<20200814104509.189023-2-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.28.0","In-Reply-To":"<20200814104509.189023-1-niklas.soderlund@ragnatech.se>","References":"<20200814104509.189023-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 1/3] libcamera: pipeline_handler: Add\n\tconst version of cameraData()","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>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add a version of camerData() that returns a const pointer and mark it as\na const operation. The assert in the non-const version of the function\nalready enforces that a std::map::at() operation would always succeed so\nthere is no change in operation from the non-const version.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n* Changes since v1\n- Do not change current implementation add a new version that returns a\n  const pointer.\n---\n include/libcamera/internal/pipeline_handler.h |  1 +\n src/libcamera/pipeline_handler.cpp            | 13 +++++++++++++\n 2 files changed, 14 insertions(+)","diff":"diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\nindex 22e629a8401d1e4e..c1873df00b6a2a28 100644\n--- a/include/libcamera/internal/pipeline_handler.h\n+++ b/include/libcamera/internal/pipeline_handler.h\n@@ -97,6 +97,7 @@ protected:\n \tvirtual int queueRequestDevice(Camera *camera, Request *request) = 0;\n \n \tCameraData *cameraData(const Camera *camera);\n+\tconst CameraData *cameraData(const Camera *camera) const;\n \n \tCameraManager *manager_;\n \ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex ccd45edc847b9e3f..73c51972a225a247 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -601,6 +601,19 @@ CameraData *PipelineHandler::cameraData(const Camera *camera)\n \treturn cameraData_[camera].get();\n }\n \n+/**\n+ * \\brief Retrieve the pipeline-specific data associated with a Camera\n+ * \\param[in] camera The camera whose data to retrieve\n+ * \\sa cameraData()\n+ * \\return A const pointer to the pipeline-specific data passed to\n+ * registerCamera().\n+ */\n+const CameraData *PipelineHandler::cameraData(const Camera *camera) const\n+{\n+\tASSERT(cameraData_.count(camera));\n+\treturn cameraData_.at(camera).get();\n+}\n+\n /**\n  * \\var PipelineHandler::manager_\n  * \\brief The Camera manager associated with the pipeline handler\n","prefixes":["libcamera-devel","v2","1/3"]}