{"id":12237,"url":"https://patchwork.libcamera.org/api/patches/12237/?format=json","web_url":"https://patchwork.libcamera.org/patch/12237/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20210510095814.3732400-5-naush@raspberrypi.com>","date":"2021-05-10T09:58:13","name":"[libcamera-devel,v6,4/6] ipa: raspberrypi: Add move/copy ctors and operators to Metadata class","commit_ref":"2bbd1e4766c3cabf810bf06191ad9d747e278189","pull_url":null,"state":"accepted","archived":false,"hash":"cbff79b5788219d018b4751dc2d78357cc3ea16f","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12237/mbox/","series":[{"id":2015,"url":"https://patchwork.libcamera.org/api/series/2015/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2015","date":"2021-05-10T09:58:09","name":"ipa: raspberrypi: Rate-limit the controller algorithms","version":6,"mbox":"https://patchwork.libcamera.org/series/2015/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12237/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12237/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 4E350BF829\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 10 May 2021 09:59:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CA4426892A;\n\tMon, 10 May 2021 11:59:12 +0200 (CEST)","from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n\t[IPv6:2a00:1450:4864:20::329])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 13EF76890C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 May 2021 11:59:09 +0200 (CEST)","by mail-wm1-x329.google.com with SMTP id\n\to26-20020a1c4d1a0000b0290146e1feccdaso9386547wmh.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 May 2021 02:59:09 -0700 (PDT)","from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:e710:3ec:6dad:dc2])\n\tby smtp.gmail.com with ESMTPSA id\n\ty17sm24767917wrw.90.2021.05.10.02.59.07\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 10 May 2021 02:59:08 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"SKFO0IHu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=6nvwrdwFQFfVWryhozrzfX48ubzoceWz0iZ+FUQS5OE=;\n\tb=SKFO0IHuND9o7ofr1KZo3H8T7S3MskA+meZeU+XjcJgt99ePzN3UyDczWF/DTP5SBX\n\tMDpt/1+a6zcXS6JrfO8k3cdnD//AN8JAqIcp91N3WVb+awDjIcSqTkl3IfJ0G7RLfwx3\n\t57mJtxx6h2t6XoJqux9NUy8i9a7j0mtjRTN6Z0Ds9hXMbdft6PovmCIBc6WIpUpCD24C\n\t8CALAKUu5cVb6I9n4yXDqSmEwh/ECe6mRcNIyDP6OcfowacxuNSU9X8GsaYBomdIMylD\n\tq/G29vAvIkEFRGx85sFpIvF8M5Wh1onmxVYhMtpgzq+imwN2u5mBAHdhJAyyVYr5NTys\n\thL/g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=6nvwrdwFQFfVWryhozrzfX48ubzoceWz0iZ+FUQS5OE=;\n\tb=SFEWJ7Puy2fB3DYojDzpud450NNPrHsf/PZkzskY5LyETxN/MFhXmsEHRDFPPEeoHg\n\td35sFIVu5IpMfr7VpvSshBk8k4lNzBgcpW0fmsy1z6FWpiJefgWsBavdc4JXUAJxrSU/\n\taNWsjkLCqAYZYNGPIPO2RPr9y+ffWZcExMv07ek07Rha8Y/CwmQnaCiCBcVxj0SrXaIB\n\td67Ykc4A6nZ0hLaMITWv2AxfgI0hRO0SLTwM+LIsMC/4CSxYuPt6a40QA5OZHGWfN1K4\n\tyXvBk0U0qNTgq4eAwmM+YkwwRA1g5oGhvQhl9PFyqE3hQPFLkNMlthFgPXkjdYQfCZ5r\n\tSZNg==","X-Gm-Message-State":"AOAM530poYVYn7aM4jdjo6VPC5Yr/CIqKrCmHrgrytZmfWhjzovybck+\n\tTN0ctkOgi4FJP++DwigZCBSNQNRmspa99g==","X-Google-Smtp-Source":"ABdhPJyvaUPXez0HtgFCAFd84L5FKGUl0mOLk3ApdiGP7egdp7DV5zdDRoJ18H0P+7eb9eU+szDKAQ==","X-Received":"by 2002:a7b:c191:: with SMTP id\n\ty17mr35920580wmi.19.1620640748581; \n\tMon, 10 May 2021 02:59:08 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 10 May 2021 10:58:13 +0100","Message-Id":"<20210510095814.3732400-5-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210510095814.3732400-1-naush@raspberrypi.com>","References":"<20210510095814.3732400-1-naush@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v6 4/6] ipa: raspberrypi: Add move/copy\n\tctors and operators to Metadata class","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":"Add a default, move and copy constructor as well as a move operator\nimplementation RPiController::Metadata class.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/raspberrypi/controller/metadata.hpp | 23 +++++++++++++++++++++\n 1 file changed, 23 insertions(+)","diff":"diff --git a/src/ipa/raspberrypi/controller/metadata.hpp b/src/ipa/raspberrypi/controller/metadata.hpp\nindex e735cfbe0480..3a97a5f5c502 100644\n--- a/src/ipa/raspberrypi/controller/metadata.hpp\n+++ b/src/ipa/raspberrypi/controller/metadata.hpp\n@@ -19,6 +19,21 @@ namespace RPiController {\n class Metadata\n {\n public:\n+\tMetadata() = default;\n+\n+\tMetadata(Metadata const &other)\n+\t{\n+\t\tstd::scoped_lock other_lock(other.mutex_);\n+\t\tdata_ = other.data_;\n+\t}\n+\n+\tMetadata(Metadata &&other)\n+\t{\n+\t\tstd::scoped_lock other_lock(other.mutex_);\n+\t\tdata_ = std::move(other.data_);\n+\t\tother.data_.clear();\n+\t}\n+\n \ttemplate<typename T>\n \tvoid Set(std::string const &tag, T const &value)\n \t{\n@@ -50,6 +65,14 @@ public:\n \t\treturn *this;\n \t}\n \n+\tMetadata &operator=(Metadata &&other)\n+\t{\n+\t\tstd::scoped_lock lock(mutex_, other.mutex_);\n+\t\tdata_ = std::move(other.data_);\n+\t\tother.data_.clear();\n+\t\treturn *this;\n+\t}\n+\n \ttemplate<typename T>\n \tT *GetLocked(std::string const &tag)\n \t{\n","prefixes":["libcamera-devel","v6","4/6"]}