From patchwork Fri Feb 12 13:30:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11264 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 04813BD16C for ; Fri, 12 Feb 2021 13:31:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D920D63785; Fri, 12 Feb 2021 14:31:04 +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="S+IRGq3s"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6526763772 for ; Fri, 12 Feb 2021 14:31:01 +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 0D2C31540; 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=zb+6P1jPo6STlRX9YTnt+JJYz8sHeSHJsB9lYrNZm8s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S+IRGq3so1lm8EQ/T7TyNgoCAI30f8k0qnqJrxZpmJWIUGteKhr3bEXEW3t/9aICj RfMPHEnZL2BdCY9grcDTGxpfxWCno/OkMoxLdWifRcge1s2nAIhwGyMVj2Lu4onSn3 BIEX3ZSg53wiV2ab8xS9v6J+8o3LCtXuwMn1TPAA= From: Kieran Bingham To: libcamera devel Date: Fri, 12 Feb 2021 13:30:53 +0000 Message-Id: <20210212133056.873230-5-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 4/7] libcamera: media_object: Utilise LIBCAMERA_DISABLE_COPY_AND_MOVE 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_AND_MOVE. These classes already deleted their copy constructor but not the assignment operator. They should also not be movable, so expand to fully disable both copying and moving. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- include/libcamera/internal/media_object.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h index 2b336961f98d..1c82c27928a8 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_AND_MOVE(MediaLink) + friend class MediaDevice; MediaLink(const struct media_v2_link *link, MediaPad *source, MediaPad *sink); - MediaLink(const MediaLink &) = delete; MediaPad *source_; MediaPad *sink_; @@ -69,10 +72,11 @@ public: void addLink(MediaLink *link); private: + LIBCAMERA_DISABLE_COPY_AND_MOVE(MediaPad) + friend class MediaDevice; MediaPad(const struct media_v2_pad *pad, MediaEntity *entity); - MediaPad(const MediaPad &) = delete; unsigned int index_; MediaEntity *entity_; @@ -99,11 +103,12 @@ public: int setDeviceNode(const std::string &deviceNode); private: + LIBCAMERA_DISABLE_COPY_AND_MOVE(MediaEntity) + friend class MediaDevice; MediaEntity(MediaDevice *dev, const struct media_v2_entity *entity, unsigned int major = 0, unsigned int minor = 0); - MediaEntity(const MediaEntity &) = delete; void addPad(MediaPad *pad);