Merge "Clean up the code to build successfully on macOS" into devel/master
[platform/core/uifw/dali-core.git] / dali / internal / event / common / property-metadata.h
index 09b62ab..3dbf675 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_PROPERTY_METADATA_H__
-#define __DALI_INTERNAL_PROPERTY_METADATA_H__
+#ifndef DALI_INTERNAL_PROPERTY_METADATA_H
+#define DALI_INTERNAL_PROPERTY_METADATA_H
 
 /*
- * Copyright (c) 2018 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.
@@ -61,9 +61,7 @@ public:
   /**
    * @brief Virtual Destructor.
    */
-  virtual ~PropertyMetadata()
-  {
-  }
+  virtual ~PropertyMetadata() = default;
 
   /**
    * @brief Returns whether the property is animatable (i.e. if its a scene graph property).
@@ -71,7 +69,7 @@ public:
    */
   bool IsAnimatable( void ) const
   {
-    return NULL != mSceneGraphProperty;
+    return nullptr != mSceneGraphProperty;
   }
 
   /**
@@ -130,12 +128,12 @@ protected:
    * @param[in] sceneGraphProperty  A pointer to the scene-graph owned property
    * @param[in] writable            Whether the property is writable
    */
-  PropertyMetadata( const Property::Value& propertyValue,
+  PropertyMetadata( Property::Value propertyValue,
                     const SceneGraph::PropertyBase* sceneGraphProperty,
                     bool writable )
   : value( mStoredValue ),
     componentIndex( Property::INVALID_COMPONENT_INDEX ),
-    mStoredValue( propertyValue ),
+    mStoredValue( std::move(propertyValue) ),
     mSceneGraphProperty( sceneGraphProperty ),
     mWritable( writable )
   {
@@ -168,9 +166,9 @@ public: // Data
   /**
    * @brief The value of this property used to read/write by the event thread.
    *
-   * If a component index, then refers to the value in the PropertyMetatdata of the base property
+   * If this PropertyMetadata is for property component, then refers to the value in the PropertyMetadata of the base property
    * to ensure the components are kept in sync with the overall value on the event thread.
-   * Otherwise, this just refers to the storedValue.
+   * Otherwise, this refers to mStoredValue.
    */
   Property::Value& value;
 
@@ -181,7 +179,7 @@ public: // Data
 
 private:
 
-  Property::Value mStoredValue;                         ///< The stored property value used to read/write by the event thread
+  Property::Value mStoredValue;                         ///< The cached property value used to read/write by the event thread
   const SceneGraph::PropertyBase* mSceneGraphProperty;  ///< A pointer to a scene-graph property; should not be modified from actor-thread
   bool mWritable:1;                                     ///< Whether the property is writable
 };
@@ -233,9 +231,7 @@ public:
   /**
    * @brief Destructor.
    */
-  virtual ~AnimatablePropertyMetadata()
-  {
-  }
+  ~AnimatablePropertyMetadata() override = default;
 
 private:
 
@@ -262,12 +258,12 @@ public:
    *
    * @note A valid sceneGraphProperty is mandatory otherwise this will debug assert.
    */
-  CustomPropertyMetadata( const std::string& propertyName,
+  CustomPropertyMetadata( std::string propertyName,
                           Property::Index propertyKey,
-                          const Property::Value& propertyValue,
+                          Property::Value propertyValue,
                           const SceneGraph::PropertyBase* sceneGraphProperty )
-  : PropertyMetadata( propertyValue, sceneGraphProperty, true ),
-    name( propertyName ),
+  : PropertyMetadata( std::move(propertyValue), sceneGraphProperty, true ),
+    name( std::move(propertyName) ),
     key( propertyKey ),
     childPropertyIndex( Property::INVALID_INDEX )
   {
@@ -282,11 +278,11 @@ public:
    *
    * @note The access mode MUST NOT be animatable otherwise this will debug assert.
    */
-  CustomPropertyMetadata( const std::string& propertyName,
-                          const Property::Value& propertyValue,
+  CustomPropertyMetadata( std::string propertyName,
+                          Property::Value propertyValue,
                           Property::AccessMode accessMode )
-  : PropertyMetadata( propertyValue, NULL, ( accessMode != Property::READ_ONLY ) ),
-    name( propertyName ),
+  : PropertyMetadata( std::move(propertyValue), nullptr, ( accessMode != Property::READ_ONLY ) ),
+    name( std::move(propertyName) ),
     key( Property::INVALID_KEY ),
     childPropertyIndex( Property::INVALID_INDEX )
   {
@@ -296,9 +292,7 @@ public:
   /**
    * @brief Destructor.
    */
-  virtual ~CustomPropertyMetadata()
-  {
-  }
+  ~CustomPropertyMetadata() override = default;
 
 private:
 
@@ -318,4 +312,4 @@ public: // Data
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_PROPERTY_METADATA_H__
+#endif // DALI_INTERNAL_PROPERTY_METADATA_H