08a61d02b98a1577a952897b4dbea62af6139469
[platform/core/uifw/aurum.git] / libaurum / inc / Misc / Point2D.h
1 #pragma once
2
3 /**
4  * @brief Point2d Class
5  * @since_tizen 5.5
6  */
7 template <typename T>
8 class Point2D {
9 public:
10     /**
11      * @brief TBD
12      * @since_tizen 5.5
13      */
14     Point2D() : x{0}, y{0} {}
15
16     /**
17      * @brief TBD
18      * @since_tizen 5.5
19      */
20     Point2D(const Point2D &src)
21     {
22         x = src.x;
23         y = src.y;
24     }
25
26     /**
27      * @brief TBD
28      * @since_tizen 5.5
29      */
30     Point2D(const T &x, const T &y)
31     {
32         this->x = x;
33         this->y = y;
34     }
35
36     /**
37      * @brief TBD
38      * @since_tizen 5.5
39      */
40     inline bool operator==(const Point2D<T>& rhs)
41     {
42         return this->x == rhs.x && this->y == rhs.y;
43     }
44
45     /**
46      * @brief TBD
47      * @since_tizen 5.5
48      */
49     inline bool operator!=(const Point2D<T>& rhs)
50     {
51         return !(*this == rhs);
52     }
53
54     /**
55      * @brief TBD
56      */
57     T x;
58
59     /**
60      * @brief TBD
61      */
62     T y;
63 };