From patchwork Thu Oct 22 13:56:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10201 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 36013C3D3C for ; Thu, 22 Oct 2020 13:56:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 04B8061454; Thu, 22 Oct 2020 15:56:15 +0200 (CEST) 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="nxJflIFB"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 522E16145E for ; Thu, 22 Oct 2020 15:56:11 +0200 (CEST) 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 B1FB6A43; Thu, 22 Oct 2020 15:56:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603374970; bh=cIbVd7dh1s4WlnHThYctC8seCrPnYhJyU/p31yBgpjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nxJflIFBXZCLfui/KiwTT5/ZUh9hZrnnfCWDvl+Q20pN8gks1LoFiqCnBoB42AqzI nysGF22izx43aEW3XaxRkKGzhWvVrilFmbOb38WTfDWSIrSKQu2KWmDLAjipebMtDP dGc0Ku7iHnn8kUBTsJ6VwtlXtrw1EuS+8BiXQZEo= From: Kieran Bingham To: libcamera devel Date: Thu, 22 Oct 2020 14:56:03 +0100 Message-Id: <20201022135605.614240-4-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201022135605.614240-1-kieran.bingham@ideasonboard.com> References: <20201022135605.614240-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/5] libcamera: media_object: Utilise DELETE_COPY_AND_ASSIGN 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" Convert MediaLink, MediaPad, and MediaEntity to declare DELETE_COPY_AND_ASSIGN. These classes already deleted their copy constructor but not the assignment operator. Utilising the DELETE_COPY_AND_ASSIGN prevents all copying of these classes. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- include/libcamera/internal/media_object.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h index be6fb8961349..f467883072d2 100644 --- a/include/libcamera/internal/media_object.h +++ b/include/libcamera/internal/media_object.h @@ -12,6 +12,8 @@ #include +#include + namespace libcamera { class MediaDevice; @@ -50,7 +52,7 @@ private: MediaLink(const struct media_v2_link *link, MediaPad *source, MediaPad *sink); - MediaLink(const MediaLink &) = delete; + DELETE_COPY_AND_ASSIGN(MediaLink); ~MediaLink() {} MediaPad *source_; @@ -72,7 +74,7 @@ private: friend class MediaDevice; MediaPad(const struct media_v2_pad *pad, MediaEntity *entity); - MediaPad(const MediaPad &) = delete; + DELETE_COPY_AND_ASSIGN(MediaPad); ~MediaPad(); unsigned int index_; @@ -104,7 +106,7 @@ private: MediaEntity(MediaDevice *dev, const struct media_v2_entity *entity, unsigned int major = 0, unsigned int minor = 0); - MediaEntity(const MediaEntity &) = delete; + DELETE_COPY_AND_ASSIGN(MediaEntity); ~MediaEntity(); void addPad(MediaPad *pad);