{"id":2276,"url":"https://patchwork.libcamera.org/api/1.1/patches/2276/?format=json","web_url":"https://patchwork.libcamera.org/patch/2276/","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":"<20191028104913.14985-4-laurent.pinchart@ideasonboard.com>","date":"2019-10-28T10:49:07","name":"[libcamera-devel,v2,3/9] libcamera: bound_method: Store connection type in BoundMethodBase","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"a0f0f7d91e09831cd940ea640a11e2d9bdbf0d26","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2276/mbox/","series":[{"id":562,"url":"https://patchwork.libcamera.org/api/1.1/series/562/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=562","date":"2019-10-28T10:49:04","name":"Add support for blocking method invocation","version":2,"mbox":"https://patchwork.libcamera.org/series/562/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2276/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2276/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 31D226017E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Oct 2019 11:49:26 +0100 (CET)","from pendragon.ideasonboard.com (unknown [91.217.168.176])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DF000A4C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Oct 2019 11:49:25 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1572259766;\n\tbh=GPxlhK6U01oMVH8OGNLeyCuixGsGDfei1PeXb8w4vFo=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=QzfrqDvj0MnB0OtAQFa7HAaDJIp4pQAq/P9D5ShVvQSLdgzy5JCDH0rnNqJJlzYG7\n\tKmO5LQTb2I9gn8JW25PVY7w6YxyxW44LWhLMkwgrp+dU8nPMI1gtq3SV5PMKS1cGaN\n\tsoJf1wANZhgiGSAx9SSMEb1w6Fzk4pJ4eAnk/wgk=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 28 Oct 2019 12:49:07 +0200","Message-Id":"<20191028104913.14985-4-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.23.0","In-Reply-To":"<20191028104913.14985-1-laurent.pinchart@ideasonboard.com>","References":"<20191028104913.14985-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 3/9] libcamera: bound_method: Store\n\tconnection type in BoundMethodBase","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>","X-List-Received-Date":"Mon, 28 Oct 2019 10:49:26 -0000"},"content":"Store the connection type in the base BoundMethodBase class to make it\naccessible to all bound methods. The default type is ConnectionTypeAuto.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/bound_method.h | 24 +++++++++++++++++-------\n 1 file changed, 17 insertions(+), 7 deletions(-)","diff":"diff --git a/include/libcamera/bound_method.h b/include/libcamera/bound_method.h\nindex e1524c917e4b..06c5a3b12305 100644\n--- a/include/libcamera/bound_method.h\n+++ b/include/libcamera/bound_method.h\n@@ -24,8 +24,10 @@ enum ConnectionType {\n class BoundMethodBase\n {\n public:\n-\tBoundMethodBase(void *obj, Object *object)\n-\t\t: obj_(obj), object_(object) {}\n+\tBoundMethodBase(void *obj, Object *object, ConnectionType type)\n+\t\t: obj_(obj), object_(object), connectionType_(type)\n+\t{\n+\t}\n \tvirtual ~BoundMethodBase() {}\n \n \ttemplate<typename T, typename std::enable_if<!std::is_same<Object, T>::value>::type * = nullptr>\n@@ -33,6 +35,7 @@ public:\n \tbool match(Object *object) { return object == object_; }\n \n \tObject *object() const { return object_; }\n+\tConnectionType connectionType() const { return connectionType_; }\n \n \tvoid activatePack(void *pack);\n \tvirtual void invokePack(void *pack) = 0;\n@@ -40,6 +43,7 @@ public:\n protected:\n \tvoid *obj_;\n \tObject *object_;\n+\tConnectionType connectionType_;\n };\n \n template<typename... Args>\n@@ -76,8 +80,8 @@ private:\n \t}\n \n public:\n-\tBoundMethodArgs(void *obj, Object *object)\n-\t\t: BoundMethodBase(obj, object) {}\n+\tBoundMethodArgs(void *obj, Object *object, ConnectionType type)\n+\t\t: BoundMethodBase(obj, object, type) {}\n \n \tvoid invokePack(void *pack) override\n \t{\n@@ -94,8 +98,11 @@ class BoundMemberMethod : public BoundMethodArgs<Args...>\n public:\n \tusing PackType = std::tuple<typename std::remove_reference<Args>::type...>;\n \n-\tBoundMemberMethod(T *obj, Object *object, void (T::*func)(Args...))\n-\t\t: BoundMethodArgs<Args...>(obj, object), func_(func) {}\n+\tBoundMemberMethod(T *obj, Object *object, void (T::*func)(Args...),\n+\t\t\t  ConnectionType type = ConnectionTypeAuto)\n+\t\t: BoundMethodArgs<Args...>(obj, object, type), func_(func)\n+\t{\n+\t}\n \n \tbool match(void (T::*func)(Args...)) const { return func == func_; }\n \n@@ -121,7 +128,10 @@ class BoundStaticMethod : public BoundMethodArgs<Args...>\n {\n public:\n \tBoundStaticMethod(void (*func)(Args...))\n-\t\t: BoundMethodArgs<Args...>(nullptr, nullptr), func_(func) {}\n+\t\t: BoundMethodArgs<Args...>(nullptr, nullptr, ConnectionTypeAuto),\n+\t\t  func_(func)\n+\t{\n+\t}\n \n \tbool match(void (*func)(Args...)) const { return func == func_; }\n \n","prefixes":["libcamera-devel","v2","3/9"]}