Ensure BaseHandle class move noexcept (core public-api)
[platform/core/uifw/dali-core.git] / dali / public-api / common / extents.h
1 #ifndef DALI_EXTENTS_H
2 #define DALI_EXTENTS_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <cstdint>
23 #include <ostream>
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/common/dali-common.h>
27
28 namespace Dali
29 {
30 /**
31  * @addtogroup dali_core_common
32  * @{
33  */
34
35 /**
36  * @brief Structure describing the a collection of uint16_t.
37  * @SINCE_1_2.62
38  */
39 struct DALI_CORE_API Extents
40 {
41   /**
42    * @brief Default constructor which provides an initialized Dali::Extents( 0u, 0u, 0u, 0u ).
43    * @SINCE_1_2.62
44    */
45   Extents();
46
47   /**
48    * @brief Copy constructor.
49    * @SINCE_1_2.62
50    * @param[in] copy A reference to the copied Extents
51    */
52   Extents(const Extents& copy) = default;
53
54   /**
55    * @brief Move constructor.
56    * @SINCE_2_2.17
57    * @param[in] move A reference to the moved Extents
58    */
59   Extents(Extents&& move) = default;
60
61   /**
62    * @brief Constructor.
63    *
64    * @SINCE_1_2.62
65    * @param[in] start     Start extent
66    * @param[in] end       End extent
67    * @param[in] top       Top extent
68    * @param[in] bottom    Bottom extent
69    */
70   Extents(uint16_t start, uint16_t end, uint16_t top, uint16_t bottom);
71
72   /**
73    * @brief Copy Assignment operator.
74    * @SINCE_1_2.62
75    * @param[in] copy A reference to the copied Extents
76    * @return Itself
77    */
78   Extents& operator=(const Extents& copy) = default;
79
80   /**
81    * @brief Move Assignment operator.
82    * @SINCE_2_2.17
83    * @param[in] move A reference to the moved Extents
84    * @return Itself
85    */
86   Extents& operator=(Extents&& move) = default;
87
88   /**
89    * @brief Assignment operator.
90    *
91    * @SINCE_1_2.62
92    * @param[in] array Array of uint16_t
93    * @return Itself
94    */
95   Extents& operator=(const uint16_t* array);
96
97   /**
98    * @brief Equality operator.
99    *
100    * @SINCE_1_2.62
101    * @param[in] rhs The Extents to test against
102    * @return True if the extents are equal
103    */
104   bool operator==(const Extents& rhs) const;
105
106   /**
107    * @brief Inequality operator.
108    *
109    * @SINCE_1_2.62
110    * @param[in] rhs The Extents to test against
111    * @return True if the extents are not equal
112    */
113   bool operator!=(const Extents& rhs) const;
114
115 public:
116   uint16_t start;  ///< The start extent.  @SINCE_1_2.62
117   uint16_t end;    ///< The end extent.    @SINCE_1_2.62
118   uint16_t top;    ///< The top extent.    @SINCE_1_2.62
119   uint16_t bottom; ///< The bottom extent. @SINCE_1_2.62
120 };
121
122 /**
123  * @brief Converts the value of the extents into a string and insert in to an output stream.
124  *
125  * @SINCE_1_2.62
126  * @param[in] stream The output stream operator
127  * @param[in] extents The Extents to output
128  * @return The output stream operator
129  */
130 DALI_CORE_API std::ostream& operator<<(std::ostream& stream, const Extents& extents);
131
132 /**
133  * @}
134  */
135 } // namespace Dali
136
137 #endif // DALI_EXTENTS_H