{"id":11267,"url":"https://patchwork.libcamera.org/api/1.1/patches/11267/?format=json","web_url":"https://patchwork.libcamera.org/patch/11267/","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":"<20210212133056.873230-8-kieran.bingham@ideasonboard.com>","date":"2021-02-12T13:30:56","name":"[libcamera-devel,v3,7/7] libcamera: MappedBuffer: Disable copy and assignment","commit_ref":"f9c0cf2a3a32ff9306da9931218909fa222e8295","pull_url":null,"state":"accepted","archived":false,"hash":"12ad1723395390ae5a4ba11aa243565b4b37424c","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/1.1/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11267/mbox/","series":[{"id":1685,"url":"https://patchwork.libcamera.org/api/1.1/series/1685/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1685","date":"2021-02-12T13:30:49","name":"Delete Copy-Move-Assign","version":3,"mbox":"https://patchwork.libcamera.org/series/1685/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11267/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11267/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 D8CA7BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Feb 2021 13:31:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A6BDA6378E;\n\tFri, 12 Feb 2021 14:31:07 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 303BF6378C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Feb 2021 14:31:02 +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 C8F8118B7;\n\tFri, 12 Feb 2021 14:31:01 +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=\"qWo4TboI\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1613136661;\n\tbh=lYER7QGNxRrkOAKs3CDEPvulHJ1wAhygdZmALp9pvAs=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=qWo4TboIc9vsaOT871njk2NWZsrLzYL+StAv1Tcqx4XWDK4oUh1+4GlGBPEr/sbEB\n\t9VlvfeY5/USSw8kmTR0uk4VMce0ISCv2xoGzH/IeW5LkVEC+YWZ1fALAIGdejHA6Nm\n\tYpBg8w8ynVpwYUjdFcu16xL1PiHrFfqTW4CkuCyA=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Fri, 12 Feb 2021 13:30:56 +0000","Message-Id":"<20210212133056.873230-8-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210212133056.873230-1-kieran.bingham@ideasonboard.com>","References":"<20210212133056.873230-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v3 7/7] libcamera: MappedBuffer: Disable\n\tcopy and assignment","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":"MappedBuffers have a custom move constructor and assignment operator to\nensure that memory is not unmapped during object manipulation.\n\nBecause of the user-defined move constructor, the implicitly-declared\ncopy-constructor will already be deleted, however delete it explicitly\nto help readability of the code, and make it clear that the object can\nnot be copied.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n include/libcamera/internal/buffer.h | 4 ++++\n 1 file changed, 4 insertions(+)","diff":"diff --git a/include/libcamera/internal/buffer.h b/include/libcamera/internal/buffer.h\nindex b7b0173f93f5..9da1fbd12c27 100644\n--- a/include/libcamera/internal/buffer.h\n+++ b/include/libcamera/internal/buffer.h\n@@ -10,6 +10,7 @@\n #include <sys/mman.h>\n #include <vector>\n \n+#include <libcamera/class.h>\n #include <libcamera/buffer.h>\n #include <libcamera/span.h>\n \n@@ -34,6 +35,9 @@ protected:\n \n \tint error_;\n \tstd::vector<Plane> maps_;\n+\n+private:\n+\tLIBCAMERA_DISABLE_COPY(MappedBuffer)\n };\n \n class MappedFrameBuffer : public MappedBuffer\n","prefixes":["libcamera-devel","v3","7/7"]}