summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-02-14 17:02:18 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-06 18:10:23 +0200
commit954bf1f656e610474d9a582774690dc505fb821b (patch)
treef3cc3ae6444dfb81213c87061a9f01cf1cf3516f /include
parentb2710e8c3621cb5181f3f31c8856d4823666f891 (diff)
libcamera: controls: Move Control constructor to controls.h
To avoid defining all specializations of the Control constructor manually, move the definition of those functions to controls.h and turn them into a single template function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/controls.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index dfe69916..6f0ebf4f 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -146,7 +146,10 @@ class Control : public ControlId
public:
using type = T;
- Control(unsigned int id, const char *name);
+ Control(unsigned int id, const char *name)
+ : ControlId(id, name, details::control_type<std::remove_cv_t<T>>::value)
+ {
+ }
private:
Control(const Control &) = delete;