[{"id":16233,"web_url":"https://patchwork.libcamera.org/comment/16233/","msgid":"<YHXX1kMklRsYVtQk@pendragon.ideasonboard.com>","date":"2021-04-13T17:41:42","subject":"Re: [libcamera-devel] [PATCH 1/3] libcamera: ipa_proxy: Scope\n\tProxyState to IPAProxy","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Tue, Apr 13, 2021 at 01:25:32PM +0100, Kieran Bingham wrote:\n> The ProxyState is only used by the IPAProxy, so it should remain inside\n> that scope.  This helps clarify the usage, and improves the\n> documentation by bringing the (future) ProxyState documentation into the\n> class.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  include/libcamera/internal/ipa_proxy.h | 12 ++++++------\n>  1 file changed, 6 insertions(+), 6 deletions(-)\n> \n> diff --git a/include/libcamera/internal/ipa_proxy.h b/include/libcamera/internal/ipa_proxy.h\n> index 9fe446c35f04..ea9f0760c2fc 100644\n> --- a/include/libcamera/internal/ipa_proxy.h\n> +++ b/include/libcamera/internal/ipa_proxy.h\n> @@ -17,15 +17,15 @@ namespace libcamera {\n>  \n>  class IPAModule;\n>  \n> -enum ProxyState {\n> -\tProxyStopped,\n> -\tProxyStopping,\n> -\tProxyRunning,\n> -};\n> -\n>  class IPAProxy : public IPAInterface\n>  {\n>  public:\n> +\tenum ProxyState {\n> +\t\tProxyStopped,\n> +\t\tProxyStopping,\n> +\t\tProxyRunning,\n> +\t};\n\nThis looks good to me, but I'm wondering if we shouldn't use a scoped\nenum instead.\n\n\tenum class State {\n\t\tStopped,\n\t\tStopping,\n\t\tRunning,\n\t};\n\nScoped enums require prefixing the enumerator name with the enumeration\nname, so code would need to replace ProxyStopped with State::Stopped\n(when used inside the IPAProxy class) or IPAPProxy::State::Stopped (when\nused outside).\n\nThis could be done on top.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\n>  \tIPAProxy(IPAModule *ipam);\n>  \t~IPAProxy();\n>","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 B3A5BBD224\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Apr 2021 17:42:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 12AED687D6;\n\tTue, 13 Apr 2021 19:42:35 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 54DF3602D1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Apr 2021 19:42:33 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CF8679F0;\n\tTue, 13 Apr 2021 19:42:32 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"PUnDDG4h\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1618335753;\n\tbh=nurcEDPPGnHwQNFhd9RyhXVBbhF9lom4SjTi2ZvETKQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=PUnDDG4hm45T2s7mWHscSHiK1jYjgrCpbVUrwSuh4U/HidiVWYkAzkEIRPZXWZgFW\n\tacC9N3oMVPr7UvqeA1rmsNsmFWgZdPu8ukzta/n4y8PiuxgecgnhRzpGP/05UD/MEF\n\tlZcWqSFIrQGUxCKbUVFRs4C3i1VPqjhmvGlRp9rg=","Date":"Tue, 13 Apr 2021 20:41:42 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YHXX1kMklRsYVtQk@pendragon.ideasonboard.com>","References":"<20210413122534.342138-1-kieran.bingham@ideasonboard.com>\n\t<20210413122534.342138-2-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210413122534.342138-2-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 1/3] libcamera: ipa_proxy: Scope\n\tProxyState to IPAProxy","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","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>"}}]