1 #ifndef __DALI_PROPERTY_ARRAY_H__
2 #define __DALI_PROPERTY_ARRAY_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
25 #include <dali/public-api/common/dali-common.h>
26 #include <dali/public-api/object/property-value.h>
27 #include <dali/public-api/object/property.h>
33 * @brief A Array of property values.
35 class DALI_IMPORT_API Property::Array
39 typedef std::size_t SizeType;
42 * @brief Default constructor.
47 * @brief Copy Constructor.
49 * @param[in] other The Array to copy from.
51 Array( const Array& other );
54 * @brief Non-virtual destructor.
59 * @brief Retrieve the number of elements in the array.
61 * @return The number of elements in the array.
69 * @brief Retrieve the number of elements in the array.
71 * @return The number of elements in the array.
73 SizeType Count() const;
76 * @brief Returns whether the array is empty.
78 * @return true if empty, false otherwise
86 * @brief Clears the array.
91 * @brief Increase the capcity of the array.
93 void Reserve( SizeType size );
96 * @brief Resize to size.
98 void Resize( SizeType size );
101 * @brief Retrieve the capacity of the array.
103 * @return The allocated capacity of the array
108 * @brief Add an element to the array.
110 * @param[in] value The value to add to the end of the array
112 void PushBack( const Value& value );
115 * @brief Const access an element.
117 * @param[in] index The element index to access. No bounds checking is performed.
119 * @return The a reference to the element.
121 const Value& GetElementAt( SizeType index ) const
123 return operator[]( index );
127 * @brief Access an element.
129 * @param[in] index The element index to access. No bounds checking is performed.
131 * @return The a reference to the element.
133 Value& GetElementAt( SizeType index )
135 return operator[]( index );
139 * @brief Const operator to access an element.
141 * @param[in] index The element index to access. No bounds checking is performed.
143 * @return The a reference to the element.
146 const Value& operator[]( SizeType index ) const;
149 * @brief Operator to access an element.
151 * @param[in] index The element index to access. No bounds checking is performed.
153 * @return The a reference to the element.
156 Value& operator[]( SizeType index );
159 * @brief Assignment Operator
161 * @param[in] other The array to copy from.
163 * @return The copied array.
165 Array& operator=( const Array& other );
168 struct DALI_INTERNAL Impl; ///< Private data
169 Impl* mImpl; ///< Pointer to private data
174 #endif // __DALI_PROPERTY_ARRAY_H__