From c27b7c103a7d0e8a6ca02b5f6e42372d1ee6993e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 27 Oct 2019 07:30:43 +0200 Subject: libcamera: controls: Add operator== and operator!= to ControlRange MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow comparision of control ranges by adding the required operators. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- include/libcamera/controls.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/libcamera/controls.h') diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index 42e6df7e..f24dc764 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -112,6 +112,16 @@ public: 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: ControlValue min_; ControlValue max_; -- cgit v1.2.1