{"id":13523,"url":"https://patchwork.libcamera.org/api/patches/13523/?format=json","web_url":"https://patchwork.libcamera.org/patch/13523/","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":"<20210827023829.5871-3-laurent.pinchart@ideasonboard.com>","date":"2021-08-27T02:38:25","name":"[libcamera-devel,v1,2/6] libcamera: base: bound_method: Remove BoundMethodMember specialization","commit_ref":"d1315600b8d406291215efc2be722dd93a38e481","pull_url":null,"state":"accepted","archived":false,"hash":"baa8b9589942946e075b1108dfd3826fc25cd818","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/13523/mbox/","series":[{"id":2402,"url":"https://patchwork.libcamera.org/api/series/2402/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2402","date":"2021-08-27T02:38:23","name":"libcamera: Drop emitter object pointer from signal arguments","version":1,"mbox":"https://patchwork.libcamera.org/series/2402/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13523/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13523/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 2DC54C3241\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Aug 2021 02:38:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B92BD6894A;\n\tFri, 27 Aug 2021 04:38:50 +0200 (CEST)","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 9518B68932\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Aug 2021 04:38:46 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 34E4FBB0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Aug 2021 04:38:46 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ljlryFUz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630031926;\n\tbh=X2IyT8bRk8g/GguloMinx4pjAVyKjtFSpK3MPSOqeI8=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=ljlryFUzhXHfR+cWUbphYYnUFjiS4rye4brVxXiWE0KBysnjLd7ftkbU/IImBNpvF\n\tTMdjRFF3CB3hjN3qFKblgPtkFI8miRAmeaTDQq605w0RCbbzZNpoqjq7E5QleUg1dD\n\tj29vpppPlFIJxs4Sdwac8N8pB0xyjj0tkCSrYWk4=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 27 Aug 2021 05:38:25 +0300","Message-Id":"<20210827023829.5871-3-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.31.1","In-Reply-To":"<20210827023829.5871-1-laurent.pinchart@ideasonboard.com>","References":"<20210827023829.5871-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v1 2/6] libcamera: base: bound_method:\n\tRemove BoundMethodMember specialization","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":"The BoundMethodMember specialization for the void return type is only\nneeded to avoid accessing the ret_ member variable that is lacking from\nthe corresponding BoundMethodPack specialization. By adding a\nBoundMethodPack::returnValue() function to read the member variable, we\ncan remove the complete BoundMethodMember specialization.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/base/bound_method.h | 46 ++++++---------------------\n 1 file changed, 10 insertions(+), 36 deletions(-)","diff":"diff --git a/include/libcamera/base/bound_method.h b/include/libcamera/base/bound_method.h\nindex 282f9b58ab60..9c212f1ecc3a 100644\n--- a/include/libcamera/base/bound_method.h\n+++ b/include/libcamera/base/bound_method.h\n@@ -38,6 +38,11 @@ public:\n \t{\n \t}\n \n+\tR returnValue()\n+\t{\n+\t\treturn ret_;\n+\t}\n+\n \tstd::tuple<typename std::remove_reference_t<Args>...> args_;\n \tR ret_;\n };\n@@ -51,6 +56,10 @@ public:\n \t{\n \t}\n \n+\tvoid returnValue()\n+\t{\n+\t}\n+\n \tstd::tuple<typename std::remove_reference_t<Args>...> args_;\n };\n \n@@ -160,7 +169,7 @@ public:\n \n \t\tauto pack = std::make_shared<PackType>(args...);\n \t\tbool sync = BoundMethodBase::activatePack(pack, deleteMethod);\n-\t\treturn sync ? pack->ret_ : R();\n+\t\treturn sync ? pack->returnValue() : R();\n \t}\n \n \tR invoke(Args... args) override\n@@ -173,41 +182,6 @@ private:\n \tR (T::*func_)(Args...);\n };\n \n-template<typename T, typename... Args>\n-class BoundMethodMember<T, void, Args...> : public BoundMethodArgs<void, Args...>\n-{\n-public:\n-\tusing PackType = typename BoundMethodArgs<void, Args...>::PackType;\n-\n-\tBoundMethodMember(T *obj, Object *object, void (T::*func)(Args...),\n-\t\t\t  ConnectionType type = ConnectionTypeAuto)\n-\t\t: BoundMethodArgs<void, Args...>(obj, object, type), func_(func)\n-\t{\n-\t}\n-\n-\tbool match(void (T::*func)(Args...)) const { return func == func_; }\n-\n-\tvoid activate(Args... args, bool deleteMethod = false) override\n-\t{\n-\t\tif (!this->object_) {\n-\t\t\tT *obj = static_cast<T *>(this->obj_);\n-\t\t\treturn (obj->*func_)(args...);\n-\t\t}\n-\n-\t\tauto pack = std::make_shared<PackType>(args...);\n-\t\tBoundMethodBase::activatePack(pack, deleteMethod);\n-\t}\n-\n-\tvoid invoke(Args... args) override\n-\t{\n-\t\tT *obj = static_cast<T *>(this->obj_);\n-\t\treturn (obj->*func_)(args...);\n-\t}\n-\n-private:\n-\tvoid (T::*func_)(Args...);\n-};\n-\n template<typename R, typename... Args>\n class BoundMethodStatic : public BoundMethodArgs<R, Args...>\n {\n","prefixes":["libcamera-devel","v1","2/6"]}