diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-02-14 17:02:18 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-03-06 18:10:23 +0200 |
commit | b2710e8c3621cb5181f3f31c8856d4823666f891 (patch) | |
tree | ad8ef5548c66cac162adb2ddca5760314db902d8 /src | |
parent | eaa1297df0bc4c6620ccde171dc9dc088109e35e (diff) |
libcamera: controls: Move ControlValue constructor to controls.h
To avoid defining all specializations of the ControlValue constructor
manually, move the definition of those functions to controls.h and turn
them into a single template function. The default constructor is still
kept in controls.cpp.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/controls.cpp | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index f3d79785..5cc8ce21 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -74,31 +74,10 @@ ControlValue::ControlValue() } /** - * \brief Construct a Boolean ControlValue - * \param[in] value Boolean value to store + * \fn template<typename T> T ControlValue::ControlValue(T value) + * \brief Construct a ControlValue of type T + * \param[in] value Initial value */ -ControlValue::ControlValue(bool value) - : type_(ControlTypeBool), bool_(value) -{ -} - -/** - * \brief Construct an integer ControlValue - * \param[in] value Integer value to store - */ -ControlValue::ControlValue(int32_t value) - : type_(ControlTypeInteger32), integer32_(value) -{ -} - -/** - * \brief Construct a 64 bit integer ControlValue - * \param[in] value Integer value to store - */ -ControlValue::ControlValue(int64_t value) - : type_(ControlTypeInteger64), integer64_(value) -{ -} /** * \fn ControlValue::type() |