{"id":2925,"url":"https://patchwork.libcamera.org/api/patches/2925/?format=json","web_url":"https://patchwork.libcamera.org/patch/2925/","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":"<20200229164254.23604-8-laurent.pinchart@ideasonboard.com>","date":"2020-02-29T16:42:30","name":"[libcamera-devel,07/31] libcamera: controls: Reorder ControlValue methods","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"28a4455b89ff386590c818a8b939c9760f8ac19c","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2925/mbox/","series":[{"id":696,"url":"https://patchwork.libcamera.org/api/series/696/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=696","date":"2020-02-29T16:42:23","name":"libcamera: Add support for array controls","version":1,"mbox":"https://patchwork.libcamera.org/series/696/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2925/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2925/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F291962783\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 29 Feb 2020 17:43:24 +0100 (CET)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 41197A28;\n\tSat, 29 Feb 2020 17:43:24 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1582994604;\n\tbh=weNm1FRPnhjQp5i7ZXRbAD1CWUXO3yjGiVw8iyxqydY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=BqVHm27U+jVdmqL2gUMpiQaUKjkQcJKZuVLoV1qpzvSQMQu3c0LJ8eGSa0/mtQ9rS\n\tPAlAK2K33qcX6hP0F7xp68MwuK6rO+0efWd0Yrt7b3QasZ8kcq/r1yFdStk3Owdgbw\n\t8CnnN/s++7JDEsThO+ulyIqLkFQfL780iYNZyWNA=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat, 29 Feb 2020 18:42:30 +0200","Message-Id":"<20200229164254.23604-8-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.24.1","In-Reply-To":"<20200229164254.23604-1-laurent.pinchart@ideasonboard.com>","References":"<20200229164254.23604-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 07/31] libcamera: controls: Reorder\n\tControlValue methods","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>","X-List-Received-Date":"Sat, 29 Feb 2020 16:43:25 -0000"},"content":"From: Jacopo Mondi <jacopo@jmondi.org>\n\nReorder functions in ControlValue class to group const methods together.\n\nCosmetic change only.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/controls.h | 10 ++--\n src/libcamera/controls.cpp   | 94 ++++++++++++++++++------------------\n 2 files changed, 52 insertions(+), 52 deletions(-)","diff":"diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 458b84e8fa8c..9f8a9031bd74 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -33,11 +33,6 @@ public:\n \tControlType type() const { return type_; }\n \tbool isNone() const { return type_ == ControlTypeNone; }\n \n-\ttemplate<typename T>\n-\tconst T &get() const;\n-\ttemplate<typename T>\n-\tvoid set(const T &value);\n-\n \tstd::string toString() const;\n \n \tbool operator==(const ControlValue &other) const;\n@@ -46,6 +41,11 @@ public:\n \t\treturn !(*this == other);\n \t}\n \n+\ttemplate<typename T>\n+\tconst T &get() const;\n+\ttemplate<typename T>\n+\tvoid set(const T &value);\n+\n private:\n \tControlType type_;\n \ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 0031cd064da9..613e6d768c0f 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -112,6 +112,53 @@ ControlValue::ControlValue(int64_t value)\n  * \\return True if the value type is ControlTypeNone, false otherwise\n  */\n \n+/**\n+ * \\brief Assemble and return a string describing the value\n+ * \\return A string describing the ControlValue\n+ */\n+std::string ControlValue::toString() const\n+{\n+\tswitch (type_) {\n+\tcase ControlTypeNone:\n+\t\treturn \"<None>\";\n+\tcase ControlTypeBool:\n+\t\treturn bool_ ? \"True\" : \"False\";\n+\tcase ControlTypeInteger32:\n+\t\treturn std::to_string(integer32_);\n+\tcase ControlTypeInteger64:\n+\t\treturn std::to_string(integer64_);\n+\t}\n+\n+\treturn \"<ValueType Error>\";\n+}\n+\n+/**\n+ * \\brief Compare ControlValue instances for equality\n+ * \\return True if the values have identical types and values, false otherwise\n+ */\n+bool ControlValue::operator==(const ControlValue &other) const\n+{\n+\tif (type_ != other.type_)\n+\t\treturn false;\n+\n+\tswitch (type_) {\n+\tcase ControlTypeBool:\n+\t\treturn bool_ == other.bool_;\n+\tcase ControlTypeInteger32:\n+\t\treturn integer32_ == other.integer32_;\n+\tcase ControlTypeInteger64:\n+\t\treturn integer64_ == other.integer64_;\n+\tdefault:\n+\t\treturn false;\n+\t}\n+}\n+\n+/**\n+ * \\fn bool ControlValue::operator!=()\n+ * \\brief Compare ControlValue instances for non equality\n+ * \\return False if the values have identical types and values, true otherwise\n+ */\n+\n /**\n  * \\fn template<typename T> const T &ControlValue::get() const\n  * \\brief Get the control value\n@@ -175,53 +222,6 @@ void ControlValue::set<int64_t>(const int64_t &value)\n }\n #endif /* __DOXYGEN__ */\n \n-/**\n- * \\brief Assemble and return a string describing the value\n- * \\return A string describing the ControlValue\n- */\n-std::string ControlValue::toString() const\n-{\n-\tswitch (type_) {\n-\tcase ControlTypeNone:\n-\t\treturn \"<None>\";\n-\tcase ControlTypeBool:\n-\t\treturn bool_ ? \"True\" : \"False\";\n-\tcase ControlTypeInteger32:\n-\t\treturn std::to_string(integer32_);\n-\tcase ControlTypeInteger64:\n-\t\treturn std::to_string(integer64_);\n-\t}\n-\n-\treturn \"<ValueType Error>\";\n-}\n-\n-/**\n- * \\brief Compare ControlValue instances for equality\n- * \\return True if the values have identical types and values, false otherwise\n- */\n-bool ControlValue::operator==(const ControlValue &other) const\n-{\n-\tif (type_ != other.type_)\n-\t\treturn false;\n-\n-\tswitch (type_) {\n-\tcase ControlTypeBool:\n-\t\treturn bool_ == other.bool_;\n-\tcase ControlTypeInteger32:\n-\t\treturn integer32_ == other.integer32_;\n-\tcase ControlTypeInteger64:\n-\t\treturn integer64_ == other.integer64_;\n-\tdefault:\n-\t\treturn false;\n-\t}\n-}\n-\n-/**\n- * \\fn bool ControlValue::operator!=()\n- * \\brief Compare ControlValue instances for non equality\n- * \\return False if the values have identical types and values, true otherwise\n- */\n-\n /**\n  * \\class ControlId\n  * \\brief Control static metadata\n","prefixes":["libcamera-devel","07/31"]}