mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-22 16:15:09 +03:00
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>
This commit is contained in:
parent
b2710e8c36
commit
954bf1f656
2 changed files with 4 additions and 27 deletions
|
@ -146,7 +146,10 @@ class Control : public ControlId
|
||||||
public:
|
public:
|
||||||
using type = T;
|
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:
|
private:
|
||||||
Control(const Control &) = delete;
|
Control(const Control &) = delete;
|
||||||
|
|
|
@ -249,32 +249,6 @@ bool ControlValue::operator==(const ControlValue &other) const
|
||||||
* \brief The Control template type T
|
* \brief The Control template type T
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __DOXYGEN__
|
|
||||||
template<>
|
|
||||||
Control<void>::Control(unsigned int id, const char *name)
|
|
||||||
: ControlId(id, name, ControlTypeNone)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
Control<bool>::Control(unsigned int id, const char *name)
|
|
||||||
: ControlId(id, name, ControlTypeBool)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
Control<int32_t>::Control(unsigned int id, const char *name)
|
|
||||||
: ControlId(id, name, ControlTypeInteger32)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
Control<int64_t>::Control(unsigned int id, const char *name)
|
|
||||||
: ControlId(id, name, ControlTypeInteger64)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif /* __DOXYGEN__ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class ControlRange
|
* \class ControlRange
|
||||||
* \brief Describe the limits of valid values for a Control
|
* \brief Describe the limits of valid values for a Control
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue