From eaa1297df0bc4c6620ccde171dc9dc088109e35e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 14 Feb 2020 17:02:18 +0200 Subject: libcamera: controls: Move ControlValue get() and set() to controls.h To avoid defining all specializations of ControlValue::get() and ControlValue::set() manually, move the definition of those functions to controls.h and turn them into single template functions. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/controls.cpp | 47 ---------------------------------------------- 1 file changed, 47 deletions(-) (limited to 'src/libcamera/controls.cpp') diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index 6a0d66fb..f3d79785 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -175,53 +175,6 @@ bool ControlValue::operator==(const ControlValue &other) const * \param[in] value The control value */ -#ifndef __DOXYGEN__ -template<> -bool ControlValue::get() const -{ - ASSERT(type_ == ControlTypeBool); - - return bool_; -} - -template<> -int32_t ControlValue::get() const -{ - ASSERT(type_ == ControlTypeInteger32); - - return integer32_; -} - -template<> -int64_t ControlValue::get() const -{ - ASSERT(type_ == ControlTypeInteger64); - - return integer64_; -} - -template<> -void ControlValue::set(const bool &value) -{ - type_ = ControlTypeBool; - bool_ = value; -} - -template<> -void ControlValue::set(const int32_t &value) -{ - type_ = ControlTypeInteger32; - integer32_ = value; -} - -template<> -void ControlValue::set(const int64_t &value) -{ - type_ = ControlTypeInteger64; - integer64_ = value; -} -#endif /* __DOXYGEN__ */ - /** * \class ControlId * \brief Control static metadata -- cgit v1.2.1