libcamera: controls: Add operator== and operator!= to ControlRange
Allow comparision of control ranges by adding the required operators. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
76b9923e55
commit
c27b7c103a
2 changed files with 22 additions and 0 deletions
|
@ -112,6 +112,16 @@ public:
|
||||||
|
|
||||||
std::string toString() const;
|
std::string toString() const;
|
||||||
|
|
||||||
|
bool operator==(const ControlRange &other) const
|
||||||
|
{
|
||||||
|
return min_ == other.min_ && max_ == other.max_;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator!=(const ControlRange &other) const
|
||||||
|
{
|
||||||
|
return !(*this == other);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ControlValue min_;
|
ControlValue min_;
|
||||||
ControlValue max_;
|
ControlValue max_;
|
||||||
|
|
|
@ -383,6 +383,18 @@ std::string ControlRange::toString() const
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \fn bool ControlRange::operator==()
|
||||||
|
* \brief Compare ControlRange instances for equality
|
||||||
|
* \return True if the ranges have identical min and max, false otherwise
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \fn bool ControlRange::operator!=()
|
||||||
|
* \brief Compare ControlRange instances for non equality
|
||||||
|
* \return False if the ranges have identical min and max, true otherwise
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \typedef ControlIdMap
|
* \typedef ControlIdMap
|
||||||
* \brief A map of numerical control ID to ControlId
|
* \brief A map of numerical control ID to ControlId
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue