Merge "Add GetLogicalKey API in DevelKeyEvent" into devel/master
[platform/core/uifw/dali-core.git] / dali / public-api / object / property-array.h
old mode 100644 (file)
new mode 100755 (executable)
index 790043b..a862704
@@ -1,8 +1,8 @@
-#ifndef __DALI_PROPERTY_ARRAY_H__
-#define __DALI_PROPERTY_ARRAY_H__
+#ifndef DALI_PROPERTY_ARRAY_H
+#define DALI_PROPERTY_ARRAY_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <initializer_list>
 #include <string>
 
 // INTERNAL INCLUDES
@@ -37,7 +38,7 @@ namespace Dali
  * @brief A Array of property values.
  * @SINCE_1_0.0
  */
-class DALI_IMPORT_API Property::Array
+class DALI_CORE_API Property::Array
 {
 public:
 
@@ -50,24 +51,42 @@ public:
   Array();
 
   /**
-   * @brief Copy Constructor.
+   * @brief Constructor from initializer_list.
+   *
+   * @SINCE_1_4.17
+   * @param[in] values An initializer_list of values
+   */
+  Array( const std::initializer_list< Value >& values );
+
+  /**
+   * @brief Copy constructor.
    *
    * @SINCE_1_0.0
-   * @param[in] other The Array to copy from.
+   * @param[in] other The Array to copy from
    */
   Array( const Array& other );
 
   /**
+   * @brief Move constructor.
+   *
+   * A move constructor enables the resources owned by an r-value object to be moved into an l-value without copying.
+   * @SINCE_1_4.17
+   * @param[in] other The Array to move from
+   * @note After the @a other array is used, it becomes invalid and is no longer usable.
+   */
+  Array( Array&& other );
+
+  /**
    * @brief Non-virtual destructor.
    * @SINCE_1_0.0
    */
   ~Array();
 
   /**
-   * @brief Retrieve the number of elements in the array.
+   * @brief Retrieves the number of elements in the array.
    *
    * @SINCE_1_0.0
-   * @return The number of elements in the array.
+   * @return The number of elements in the array
    */
   SizeType Size() const
   {
@@ -75,10 +94,10 @@ public:
   }
 
   /**
-   * @brief Retrieve the number of elements in the array.
+   * @brief Retrieves the number of elements in the array.
    *
    * @SINCE_1_0.0
-   * @return The number of elements in the array.
+   * @return The number of elements in the array
    */
   SizeType Count() const;
 
@@ -86,7 +105,7 @@ public:
    * @brief Returns whether the array is empty.
    *
    * @SINCE_1_0.0
-   * @return true if empty, false otherwise
+   * @return @c true if empty, @c false otherwise
    */
   bool Empty() const
   {
@@ -100,21 +119,21 @@ public:
   void Clear();
 
   /**
-   * @brief Increase the capcity of the array.
+   * @brief Increases the capacity of the array.
    * @SINCE_1_0.0
    * @param[in] size The size to reserve
    */
   void Reserve( SizeType size );
 
   /**
-   * @brief Resize to size.
+   * @brief Resizes to size.
    * @SINCE_1_0.0
    * @param[in] size The size to resize
    */
   void Resize( SizeType size );
 
   /**
-   * @brief Retrieve the capacity of the array.
+   * @brief Retrieves the capacity of the array.
    *
    * @SINCE_1_0.0
    * @return The allocated capacity of the array
@@ -122,7 +141,7 @@ public:
   SizeType Capacity();
 
   /**
-   * @brief Add an element to the array.
+   * @brief Adds an element to the array.
    *
    * @SINCE_1_0.0
    * @param[in] value The value to add to the end of the array
@@ -130,12 +149,24 @@ public:
   void PushBack( const Value& value );
 
   /**
+   * @brief Add an element to the array.
+   *
+   * @SINCE_1_2.11
+   * @param[in] value The value to add to the end of the array
+   * @return A reference to this object
+   */
+  inline Property::Array& Add( const Value& value )
+  {
+    PushBack( value );
+    return *this;
+  }
+
+  /**
    * @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.
+   * @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
   {
@@ -143,12 +174,11 @@ public:
   }
 
   /**
-   * @brief Access an element.
+   * @brief Accesses 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.
+   * @param[in] index The element index to access. No bounds checking is performed
+   * @return The a reference to the element
    */
   Value& GetElementAt( SizeType index )
   {
@@ -159,9 +189,8 @@ public:
    * @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.
+   * @param[in] index The element index to access. No bounds checking is performed
+   * @return The a reference to the element
    *
    */
   const Value& operator[]( SizeType index ) const;
@@ -170,28 +199,39 @@ public:
    * @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.
+   * @param[in] index The element index to access. No bounds checking is performed
+   * @return The a reference to the element
    *
    */
   Value& operator[]( SizeType index );
 
   /**
-   * @brief Assignment Operator
+   * @brief Assignment operator.
    *
    * @SINCE_1_0.0
-   * @param[in] other The array to copy from.
+   * @param[in] other The array to copy from
    *
    * @return The copied array.
    */
   Array& operator=( const Array& other );
 
   /**
-   * @brief output to stream
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_4.17
+   * @param[in] other The array to copy from
+   *
+   * @return The moved array.
+   *
+   * @note After the @a other array is used, it becomes invalid and is no longer usable.
+   */
+  Array& operator=( Array&& other );
+
+  /**
+   * @brief Output to stream.
    * @SINCE_1_1.28
    */
-  friend std::ostream& operator<<( std::ostream& stream, const Property::Array& array );
+  friend DALI_CORE_API std::ostream& operator<<( std::ostream& stream, const Property::Array& array );
 
 private:
   struct DALI_INTERNAL Impl; ///< Private data
@@ -199,18 +239,18 @@ private:
 };
 
 /**
- * @brief Convert the values of the property array into a string and append to an output stream.
+ * @brief Converts 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.
+ * @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 );
+DALI_CORE_API std::ostream& operator<<( std::ostream& stream, const Property::Array& array );
 
 /**
  * @}
  */
 } // namespace Dali
 
-#endif // __DALI_PROPERTY_ARRAY_H__
+#endif // DALI_PROPERTY_ARRAY_H