From patchwork Fri Feb 12 13:30:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11267 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D8CA7BD160 for ; Fri, 12 Feb 2021 13:31:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A6BDA6378E; Fri, 12 Feb 2021 14:31:07 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="qWo4TboI"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 303BF6378C for ; Fri, 12 Feb 2021 14:31:02 +0100 (CET) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C8F8118B7; Fri, 12 Feb 2021 14:31:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613136661; bh=lYER7QGNxRrkOAKs3CDEPvulHJ1wAhygdZmALp9pvAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qWo4TboIc9vsaOT871njk2NWZsrLzYL+StAv1Tcqx4XWDK4oUh1+4GlGBPEr/sbEB 9VlvfeY5/USSw8kmTR0uk4VMce0ISCv2xoGzH/IeW5LkVEC+YWZ1fALAIGdejHA6Nm YpBg8w8ynVpwYUjdFcu16xL1PiHrFfqTW4CkuCyA= From: Kieran Bingham To: libcamera devel 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 copy and assignment X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" MappedBuffers have a custom move constructor and assignment operator to ensure that memory is not unmapped during object manipulation. Because of the user-defined move constructor, the implicitly-declared copy-constructor will already be deleted, however delete it explicitly to help readability of the code, and make it clear that the object can not be copied. Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- include/libcamera/internal/buffer.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/libcamera/internal/buffer.h b/include/libcamera/internal/buffer.h index b7b0173f93f5..9da1fbd12c27 100644 --- a/include/libcamera/internal/buffer.h +++ b/include/libcamera/internal/buffer.h @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -34,6 +35,9 @@ protected: int error_; std::vector maps_; + +private: + LIBCAMERA_DISABLE_COPY(MappedBuffer) }; class MappedFrameBuffer : public MappedBuffer