Patch Detail
Show a patch.
GET /api/patches/11240/?format=api
{ "id": 11240, "url": "https://patchwork.libcamera.org/api/patches/11240/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11240/", "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": "<20210211133444.764808-3-kieran.bingham@ideasonboard.com>", "date": "2021-02-11T13:34:40", "name": "[libcamera-devel,v2,2/6] libcamera: class: Provide move and copy disablers", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "f98406799a4c17e3b4cf22485f1c69098ba9bb38", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11240/mbox/", "series": [ { "id": 1679, "url": "https://patchwork.libcamera.org/api/series/1679/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1679", "date": "2021-02-11T13:34:38", "name": "Delete Copy-Move-Assign", "version": 2, "mbox": "https://patchwork.libcamera.org/series/1679/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11240/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11240/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 AD96EBD162\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 11 Feb 2021 13:34:52 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C86DC63733;\n\tThu, 11 Feb 2021 14:34:51 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 832C4601B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Feb 2021 14:34:48 +0100 (CET)", "from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net\n\t[86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2196999D;\n\tThu, 11 Feb 2021 14:34:48 +0100 (CET)" ], "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=\"jgioIMq0\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1613050488;\n\tbh=vaNO8wpv7TTP0Ei1xXlxB2UStxTDudgc0PVEQp5TYdA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=jgioIMq0x6FJkEyT9DN+ocILDhDgVQc9U4o7nliJMxcIJaxMykN46WTQPY6mLFdKF\n\t0Xc2SLFT73bcHsGbOUOtSWWtQZ7jz/TctjsPj2HFr6blIvwSbGiXk/W+BRVwTwjyGR\n\tYGzH0th+JokEjC5Hu9nPjeUIXqBtVXmWv9cAyR7A=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Date": "Thu, 11 Feb 2021 13:34:40 +0000", "Message-Id": "<20210211133444.764808-3-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210211133444.764808-1-kieran.bingham@ideasonboard.com>", "References": "<20210211133444.764808-1-kieran.bingham@ideasonboard.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v2 2/6] libcamera: class: Provide move and\n\tcopy disablers", "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=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "It can be difficult to correctly parse the syntax for copy/move and the\nassociated assignment operators.\n\nProvide helpers as syntactic sugar to facilitate disabling either the\ncopy constructor, and copy assignment operator, and the move constructor\nand move assignment operator in a way which is explicit and clear.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n include/libcamera/class.h | 12 ++++++++++++\n src/libcamera/class.cpp | 18 ++++++++++++++++++\n 2 files changed, 30 insertions(+)", "diff": "diff --git a/include/libcamera/class.h b/include/libcamera/class.h\nindex 2d9b7ebfdb08..5cd31d1b9f37 100644\n--- a/include/libcamera/class.h\n+++ b/include/libcamera/class.h\n@@ -11,6 +11,18 @@\n \n namespace libcamera {\n \n+#define LIBCAMERA_DISABLE_COPY(klass) \\\n+\tklass(const klass &) = delete; \\\n+\tklass &operator=(const klass &) = delete\n+\n+#define LIBCAMERA_DISABLE_MOVE(klass) \\\n+\tklass(klass &&) = delete; \\\n+\tklass &operator=(klass &&) = delete\n+\n+#define LIBCAMERA_DISABLE_COPY_AND_MOVE(klass) \\\n+\tLIBCAMERA_DISABLE_COPY(klass); \\\n+\tLIBCAMERA_DISABLE_MOVE(klass)\n+\n #ifndef __DOXYGEN__\n #define LIBCAMERA_DECLARE_PRIVATE(klass)\t\t\t\t\\\n public:\t\t\t\t\t\t\t\t\t\\\ndiff --git a/src/libcamera/class.cpp b/src/libcamera/class.cpp\nindex 8a608edb369b..b081d05ec3ac 100644\n--- a/src/libcamera/class.cpp\n+++ b/src/libcamera/class.cpp\n@@ -17,6 +17,24 @@\n \n namespace libcamera {\n \n+/**\n+ * \\def LIBCAMERA_DISABLE_COPY\n+ * \\brief Delete the copy constructor and assignment operator.\n+ * \\param klass The identifier of the class to modify\n+ */\n+\n+/**\n+ * \\def LIBCAMERA_DISABLE_MOVE\n+ * \\brief Delete the move construtor and assignment operator.\n+ * \\param klass The identifier of the class to modify\n+ */\n+\n+/**\n+ * \\def LIBCAMERA_DISABLE_COPY_AND_MOVE\n+ * \\brief Delete all copy and move constructors, and assignment operators.\n+ * \\param klass The identifier of the class to modify\n+ */\n+\n /**\n * \\def LIBCAMERA_DECLARE_PRIVATE\n * \\brief Declare private data for a public class\n", "prefixes": [ "libcamera-devel", "v2", "2/6" ] }