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>
32 * @addtogroup dali-core-object
37 * @brief A Array of property values.
39 class DALI_IMPORT_API Property::Array
43 typedef std::size_t SizeType;
46 * @brief Default constructor.
51 * @brief Copy Constructor.
53 * @param[in] other The Array to copy from.
55 Array( const Array& other );
58 * @brief Non-virtual destructor.
63 * @brief Retrieve the number of elements in the array.
65 * @return The number of elements in the array.
73 * @brief Retrieve the number of elements in the array.
75 * @return The number of elements in the array.
77 SizeType Count() const;
80 * @brief Returns whether the array is empty.
82 * @return true if empty, false otherwise
90 * @brief Clears the array.
95 * @brief Increase the capcity of the array.
97 void Reserve( SizeType size );
100 * @brief Resize to size.
102 void Resize( SizeType size );
105 * @brief Retrieve the capacity of the array.
107 * @return The allocated capacity of the array
112 * @brief Add an element to the array.
114 * @param[in] value The value to add to the end of the array
116 void PushBack( const Value& value );
119 * @brief Const access an element.
121 * @param[in] index The element index to access. No bounds checking is performed.
123 * @return The a reference to the element.
125 const Value& GetElementAt( SizeType index ) const
127 return operator[]( index );
131 * @brief Access an element.
133 * @param[in] index The element index to access. No bounds checking is performed.
135 * @return The a reference to the element.
137 Value& GetElementAt( SizeType index )
139 return operator[]( index );
143 * @brief Const operator to access an element.
145 * @param[in] index The element index to access. No bounds checking is performed.
147 * @return The a reference to the element.
150 const Value& operator[]( SizeType index ) const;
153 * @brief Operator to access an element.
155 * @param[in] index The element index to access. No bounds checking is performed.
157 * @return The a reference to the element.
160 Value& operator[]( SizeType index );
163 * @brief Assignment Operator
165 * @param[in] other The array to copy from.
167 * @return The copied array.
169 Array& operator=( const Array& other );
172 struct DALI_INTERNAL Impl; ///< Private data
173 Impl* mImpl; ///< Pointer to private data
181 #endif // __DALI_PROPERTY_ARRAY_H__