{"id":17515,"url":"https://patchwork.libcamera.org/api/patches/17515/?format=json","web_url":"https://patchwork.libcamera.org/patch/17515/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20221003212128.32429-6-laurent.pinchart@ideasonboard.com>","date":"2022-10-03T21:21:25","name":"[libcamera-devel,5/8] libcamera: pipeline_handler: Make factory create() function const","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"5ee5e6a7638e7e960cdd45f0d57d0ec8639c29b8","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17515/mbox/","series":[{"id":3528,"url":"https://patchwork.libcamera.org/api/series/3528/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3528","date":"2022-10-03T21:21:20","name":"libcamera: Use class templates for auto-registration","version":1,"mbox":"https://patchwork.libcamera.org/series/3528/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17515/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17515/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 27AC6C327C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Oct 2022 21:21:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B829860A7B;\n\tMon,  3 Oct 2022 23:21:40 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0172D60A76\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Oct 2022 23:21:39 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7F455440\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Oct 2022 23:21:38 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664832100;\n\tbh=jHUug7L17lPRLcPRGS03wEx6CP6ZMUfB7Em4rB37JqU=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=mTZA/r4bX1xjI/gT1/Hu6bJLf4zuXr3y1yDGqacpurjiDEIZdaogtOJQ5rFXDK6Ei\n\toYxw/tZuz96j/VoGvtOtYFXCoErgCoDeZ3KXVjH8bSZF3Xn1Pfbj8XI9UEHsHFsH+T\n\tanKISYKZ7YgZjeWok8rPdIx2UttYajWnHUuF+fSYzhyAXOp99hAO6fryGWBepauv3T\n\tUbmtYhF4OGmVRsyxuOLN6opN7JNZ8pAjHTXxqM5lEwUVz7wBB9+FMzHiYRI2WVAmOy\n\txFnBWjToiGee1mgtIk3ncyQ8somEvVJs5/C62GJRSzBN8VRdIL1me6+LuaSnzA/zrl\n\ts4KtkhP09T8RA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664832098;\n\tbh=jHUug7L17lPRLcPRGS03wEx6CP6ZMUfB7Em4rB37JqU=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=IuKQtgWzbzq2pq2BHhtAh2UwsIOZ99Xvbg+lTmaM6hVIFOGJdAicHRcq9TABjvk72\n\tKXSyzirxBNaT1lQGFnOSSpcaWXR1mA4JCcv6800+aSipiJQCYcSDlOHic1YTd3q25W\n\txFOTVAWaAfVQzAkePfjhzRj1jT5OexJimzJb/hgk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"IuKQtgWz\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  4 Oct 2022 00:21:25 +0300","Message-Id":"<20221003212128.32429-6-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","In-Reply-To":"<20221003212128.32429-1-laurent.pinchart@ideasonboard.com>","References":"<20221003212128.32429-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 5/8] libcamera: pipeline_handler: Make\n\tfactory create() function const","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The PipelineHandlerFactory::create() function has no need to modify the\nfactory instance. Make it const, as well as the createInstance()\nfunction.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/pipeline_handler.h | 6 +++---\n src/libcamera/pipeline_handler.cpp            | 4 ++--\n 2 files changed, 5 insertions(+), 5 deletions(-)","diff":"diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\nindex 20f1cbb07fea..46df69dc789a 100644\n--- a/include/libcamera/internal/pipeline_handler.h\n+++ b/include/libcamera/internal/pipeline_handler.h\n@@ -104,7 +104,7 @@ public:\n \tPipelineHandlerFactory(const char *name);\n \tvirtual ~PipelineHandlerFactory() = default;\n \n-\tstd::shared_ptr<PipelineHandler> create(CameraManager *manager);\n+\tstd::shared_ptr<PipelineHandler> create(CameraManager *manager) const;\n \n \tconst std::string &name() const { return name_; }\n \n@@ -112,7 +112,7 @@ public:\n \tstatic std::vector<PipelineHandlerFactory *> &factories();\n \n private:\n-\tvirtual PipelineHandler *createInstance(CameraManager *manager) = 0;\n+\tvirtual PipelineHandler *createInstance(CameraManager *manager) const = 0;\n \n \tstd::string name_;\n };\n@@ -124,7 +124,7 @@ public:\t\t\t\t\t\t\t\t\t\\\n \thandler##Factory() : PipelineHandlerFactory(#handler) {}\t\\\n \t\t\t\t\t\t\t\t\t\\\n private:\t\t\t\t\t\t\t\t\\\n-\tPipelineHandler *createInstance(CameraManager *manager)\t\t\\\n+\tPipelineHandler *createInstance(CameraManager *manager) const\t\\\n \t{\t\t\t\t\t\t\t\t\\\n \t\treturn new handler(manager);\t\t\t\t\\\n \t}\t\t\t\t\t\t\t\t\\\ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex e5cb751cc743..4470e9041e8e 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -676,7 +676,7 @@ PipelineHandlerFactory::PipelineHandlerFactory(const char *name)\n  * \\return A shared pointer to a new instance of the PipelineHandler subclass\n  * corresponding to the factory\n  */\n-std::shared_ptr<PipelineHandler> PipelineHandlerFactory::create(CameraManager *manager)\n+std::shared_ptr<PipelineHandler> PipelineHandlerFactory::create(CameraManager *manager) const\n {\n \tPipelineHandler *handler = createInstance(manager);\n \thandler->name_ = name_.c_str();\n@@ -719,7 +719,7 @@ std::vector<PipelineHandlerFactory *> &PipelineHandlerFactory::factories()\n }\n \n /**\n- * \\fn PipelineHandlerFactory::createInstance()\n+ * \\fn PipelineHandlerFactory::createInstance() const\n  * \\brief Create an instance of the PipelineHandler corresponding to the factory\n  * \\param[in] manager The camera manager\n  *\n","prefixes":["libcamera-devel","5/8"]}