From patchwork Thu Feb 11 13:34:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11242 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 B26ADBD162 for ; Thu, 11 Feb 2021 13:34:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5EB6D601B5; Thu, 11 Feb 2021 14:34:52 +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="M6EpL+9f"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1FE37601B5 for ; Thu, 11 Feb 2021 14:34:49 +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 B4A71FDB; Thu, 11 Feb 2021 14:34:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613050488; bh=9aPHg1DTBI+FrTV/p638nYtS/E4azvN99HWBETb7zOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M6EpL+9fzyjyaH8OCOZEq2O3nTlzBU8gYVLhWNB5LnaCy60e/B/DHA7bNIsHEymc9 rxV1ZZpzT68+fEh/fZim1hbVxeQF6hD6bjEcL8UMgMhXqzpJyee15+gnYU5PSSkDTD ikSwcXTjHCBXH/0kG3EE2bHCv9Urc1L/vMuRhULQ= From: Kieran Bingham To: libcamera devel Date: Thu, 11 Feb 2021 13:34:42 +0000 Message-Id: <20210211133444.764808-5-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 4/6] libcamera: media_object: Utilise LIBCAMERA_DISABLE_COPY 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 LIBCAMERA_DISABLE_COPY. These classes already deleted their copy constructor but not the assignment operator. Utilising the LIBCAMERA_DISABLE_COPY fully prevents all copying of these classes. Signed-off-by: Kieran Bingham --- include/libcamera/internal/media_object.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h index 2b336961f98d..058f5b413837 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; @@ -47,11 +49,12 @@ public: int setEnabled(bool enable); private: + LIBCAMERA_DISABLE_COPY(MediaLink); + friend class MediaDevice; MediaLink(const struct media_v2_link *link, MediaPad *source, MediaPad *sink); - MediaLink(const MediaLink &) = delete; MediaPad *source_; MediaPad *sink_; @@ -72,7 +75,7 @@ private: friend class MediaDevice; MediaPad(const struct media_v2_pad *pad, MediaEntity *entity); - MediaPad(const MediaPad &) = delete; + LIBCAMERA_DISABLE_COPY(MediaPad); unsigned int index_; MediaEntity *entity_; @@ -103,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; + LIBCAMERA_DISABLE_COPY(MediaEntity); void addPad(MediaPad *pad);