namespace Dali
{
+/**
+ * @addtogroup dali_core_object
+ * @{
+ */
/**
* @brief A Array of property values.
+ * @SINCE_1_0.0
*/
class DALI_IMPORT_API Property::Array
{
public:
+ typedef std::size_t SizeType;
+
/**
* @brief Default constructor.
+ * @SINCE_1_0.0
*/
Array();
/**
* @brief Copy Constructor.
*
+ * @SINCE_1_0.0
* @param[in] other The Array to copy from.
*/
Array( const Array& other );
/**
* @brief Non-virtual destructor.
+ * @SINCE_1_0.0
*/
~Array();
/**
* @brief Retrieve the number of elements in the array.
*
+ * @SINCE_1_0.0
* @return The number of elements in the array.
*/
- unsigned int Size() const;
+ SizeType Size() const
+ {
+ return Count();
+ }
/**
* @brief Retrieve the number of elements in the array.
*
+ * @SINCE_1_0.0
* @return The number of elements in the array.
*/
- unsigned int Count() const;
+ SizeType Count() const;
/**
* @brief Returns whether the array is empty.
*
+ * @SINCE_1_0.0
* @return true if empty, false otherwise
*/
- bool Empty() const;
+ bool Empty() const
+ {
+ return Count() == 0;
+ }
/**
* @brief Clears the array.
+ * @SINCE_1_0.0
*/
void Clear();
/**
* @brief Increase the capcity of the array.
+ * @SINCE_1_0.0
*/
- void Reserve(size_t size);
+ void Reserve( SizeType size );
/**
* @brief Resize to size.
+ * @SINCE_1_0.0
*/
- void Resize(size_t size);
+ void Resize( SizeType size );
/**
* @brief Retrieve the capacity of the array.
*
+ * @SINCE_1_0.0
* @return The allocated capacity of the array
*/
- size_t Capacity();
+ SizeType Capacity();
/**
* @brief Add an element to the array.
*
+ * @SINCE_1_0.0
* @param[in] value The value to add to the end of the array
+ */
+ void PushBack( const Value& value );
+
+ /**
+ * @brief Const access an element.
+ *
+ * @SINCE_1_0.0
+ * @param[in] index The element index to access. No bounds checking is performed.
*
* @return The a reference to the element.
+ */
+ const Value& GetElementAt( SizeType index ) const
+ {
+ return operator[]( index );
+ }
+
+ /**
+ * @brief Access an element.
*
+ * @SINCE_1_0.0
+ * @param[in] index The element index to access. No bounds checking is performed.
+ *
+ * @return The a reference to the element.
*/
- void PushBack(const Value& value);
+ Value& GetElementAt( SizeType index )
+ {
+ return operator[]( index );
+ }
/**
* @brief Const operator to access an element.
*
+ * @SINCE_1_0.0
* @param[in] index The element index to access. No bounds checking is performed.
*
* @return The a reference to the element.
*
*/
- const Value& operator[]( const size_t index ) const;
+ const Value& operator[]( SizeType index ) const;
/**
* @brief Operator to access an element.
*
+ * @SINCE_1_0.0
* @param[in] index The element index to access. No bounds checking is performed.
*
* @return The a reference to the element.
*
*/
- Value& operator[]( const size_t index );
+ Value& operator[]( SizeType index );
/**
* @brief Assignment Operator
*
+ * @SINCE_1_0.0
* @param[in] other The array to copy from.
*
* @return The copied array.
*/
Array& operator=( const Array& other );
+ /**
+ * @brief output to stream
+ * @SINCE_1_1.28
+ */
+ friend std::ostream& operator<<( std::ostream& stream, const Property::Array& array );
+
private:
struct DALI_INTERNAL Impl; ///< Private data
Impl* mImpl; ///< Pointer to private data
};
+/**
+ * @brief Convert the values of the property array into a string and append to an output stream.
+ *
+ * @SINCE_1_1.28
+ * @param [in] stream The output stream operator.
+ * @param [in] array The array to insert
+ * @return The output stream operator.
+ */
+DALI_IMPORT_API std::ostream& operator<<( std::ostream& stream, const Property::Array& array );
+
+/**
+ * @}
+ */
} // namespace Dali
#endif // __DALI_PROPERTY_ARRAY_H__