overload equal operator for some data structures
authorWonki Kim <wonki_.kim@samsung.com>
Fri, 11 Sep 2020 03:10:39 +0000 (12:10 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Fri, 11 Sep 2020 05:32:29 +0000 (14:32 +0900)
Rect and Point2D didn't have == operator overloadded.
now they have.

Change-Id: I47ec30ae1c2d506ccb2ac8b7bf8867009cf340d4

libaurum/inc/Misc/Point2D.h
libaurum/inc/Misc/Rect.h

index 9bb304fba6af8930ea99553e8f4e9c9b6b1b45c5..08a61d02b98a1577a952897b4dbea62af6139469 100644 (file)
@@ -33,6 +33,24 @@ public:
         this->y = y;
     }
 
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    inline bool operator==(const Point2D<T>& rhs)
+    {
+        return this->x == rhs.x && this->y == rhs.y;
+    }
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    inline bool operator!=(const Point2D<T>& rhs)
+    {
+        return !(*this == rhs);
+    }
+
     /**
      * @brief TBD
      */
@@ -42,4 +60,4 @@ public:
      * @brief TBD
      */
     T y;
-};
\ No newline at end of file
+};
index 62aa39edc6c8d3560c801b5c4229ec95f729da67..18e9a91ec1f01c0bca2be663bcee407bcec46130 100644 (file)
@@ -65,6 +65,23 @@ public:
      */
     T height() const { return mBottomRight.y - mTopLeft.y; }
 
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    inline bool operator==(const Rect<T>& rhs)
+    {
+        return this->mTopLeft == rhs.mTopLeft && this->mBottomRight == rhs.mBottomRight;
+    }
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    inline bool operator!=(const Rect<T>& rhs){
+        return !(*this == rhs);
+    }
+
     /**
      * @brief TBD
      */