From patchwork Sat Feb 29 16:42:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2929 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 07E1262789 for ; Sat, 29 Feb 2020 17:43:26 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A507033E for ; Sat, 29 Feb 2020 17:43:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1582994605; bh=9jDC8xaUozZIOtVPQBHRJ+FMhjCUXQ/Or5ur1AT8m00=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rj1pLBXGfSwrVHuwPPORyHNJkvsw/zmC0emi0xQ5HAUEefdAPcPbBjSIHKhggSRdL Ho/qt8EWvZ+SSB+pI17srV0QsnsZb1zBe6rifhFBHL3dp54f5Yi/3wROIY0AT0yV1r 8QYzl3jlw6bAkW+15Lz/PFdY2VYPURRMvBLc+ay4= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 29 Feb 2020 18:42:34 +0200 Message-Id: <20200229164254.23604-12-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 Subject: [libcamera-devel] [PATCH 11/31] libcamera: controls: Add templates to convert a type T to a ControlType 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: , X-List-Received-Date: Sat, 29 Feb 2020 16:43:26 -0000 This will be used to implement ControlValue::get() and set() as template functions. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- Documentation/Doxyfile.in | 2 +- include/libcamera/controls.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Documentation/Doxyfile.in b/Documentation/Doxyfile.in index 457e23a086a2..430d80d5f21b 100644 --- a/Documentation/Doxyfile.in +++ b/Documentation/Doxyfile.in @@ -882,7 +882,7 @@ EXCLUDE_SYMBOLS = libcamera::BoundMethodArgs \ libcamera::BoundMethodStatic \ libcamera::SignalBase \ libcamera::*::Private \ - libcamera::*::details::* \ + *::details::* \ std::* # The EXAMPLE_PATH tag can be used to specify one or more files or directories diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index 3b6b231c7c64..429f01b0fd24 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -22,6 +22,34 @@ enum ControlType { ControlTypeInteger64, }; +namespace details { + +template +struct control_type { +}; + +template<> +struct control_type { + static constexpr ControlType value = ControlTypeNone; +}; + +template<> +struct control_type { + static constexpr ControlType value = ControlTypeBool; +}; + +template<> +struct control_type { + static constexpr ControlType value = ControlTypeInteger32; +}; + +template<> +struct control_type { + static constexpr ControlType value = ControlTypeInteger64; +}; + +} /* namespace details */ + class ControlValue { public: