Fix interface to take sink argument by value. 61/242861/5
authorSubhransu Mohanty <sub.mohanty@samsung.com>
Tue, 1 Sep 2020 09:38:06 +0000 (18:38 +0900)
committerSubhransu Mohanty <sub.mohanty@samsung.com>
Mon, 21 Sep 2020 01:26:23 +0000 (10:26 +0900)
 -Fix RegisterProperty() interface to take name and property by value.
 -Fix SetProperty() interface to take property by value.
 -Fix RegisterProperty() interface to take name and property by value.

Change-Id: I04231da346a62d3aa56892453d36ed0c0b1657f5

dali/internal/event/common/object-impl.cpp
dali/internal/event/common/object-impl.h
dali/internal/event/common/type-info-impl.cpp
dali/internal/event/common/type-info-impl.h
dali/internal/event/common/type-registry-impl.cpp
dali/internal/event/common/type-registry-impl.h
dali/public-api/object/handle.cpp
dali/public-api/object/handle.h
dali/public-api/object/type-registry.cpp
dali/public-api/object/type-registry.h

index 63b809c..bc6f9e9 100644 (file)
@@ -282,7 +282,7 @@ Property::Type Object::GetPropertyType( Property::Index index ) const
   return Property::NONE;
 }
 
-void Object::SetProperty( Property::Index index, const Property::Value& propertyValue )
+void Object::SetProperty(Property::Index index, Property::Value propertyValue)
 {
   DALI_ASSERT_ALWAYS(index > Property::INVALID_INDEX && "Property index is out of bounds" );
 
@@ -385,8 +385,11 @@ void Object::SetProperty( Property::Index index, const Property::Value& property
   if ( propertySet )
   {
     OnPropertySet( index, propertyValue );
-    Dali::Handle handle( this );
-    mPropertySetSignal.Emit( handle, index, propertyValue );
+    if(!mPropertySetSignal.Empty())
+    {
+      Dali::Handle handle(this);
+      mPropertySetSignal.Emit(handle, index, propertyValue);
+    }
   }
 }
 
@@ -533,14 +536,14 @@ void Object::GetPropertyIndices( Property::IndexContainer& indices ) const
   }
 }
 
-Property::Index Object::RegisterProperty( const std::string& name, const Property::Value& propertyValue )
+Property::Index Object::RegisterProperty(std::string name, Property::Value propertyValue)
 {
-  return RegisterProperty( name, Property::INVALID_KEY, propertyValue, Property::ANIMATABLE );
+  return RegisterProperty(std::move(name), Property::INVALID_KEY, std::move(propertyValue), Property::ANIMATABLE);
 }
 
-Property::Index Object::RegisterProperty( const std::string& name, Property::Index key, const Property::Value& propertyValue )
+Property::Index Object::RegisterProperty(std::string name, Property::Index key, Property::Value propertyValue)
 {
-  return RegisterProperty( name, key, propertyValue, Property::ANIMATABLE );
+  return RegisterProperty(std::move(name), key, std::move(propertyValue), Property::ANIMATABLE);
 }
 
 void Object::SetProperties( const Property::Map& properties )
@@ -575,12 +578,17 @@ void Object::GetProperties( Property::Map& properties )
   }
 }
 
-Property::Index Object::RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode )
+Property::Index Object::RegisterProperty(std::string          name,
+                                         Property::Value      propertyValue,
+                                         Property::AccessMode accessMode)
 {
-  return RegisterProperty( name, Property::INVALID_KEY, propertyValue, accessMode );
+  return RegisterProperty(std::move(name), Property::INVALID_KEY, std::move(propertyValue), accessMode);
 }
 
-Property::Index Object::RegisterProperty( const std::string& name, Property::Index key, const Property::Value& propertyValue, Property::AccessMode accessMode )
+Property::Index Object::RegisterProperty(std::string          name,
+                                         Property::Index      key,
+                                         Property::Value      propertyValue,
+                                         Property::AccessMode accessMode)
 {
   // If property with the required key already exists, then just set it.
   Property::Index index = Property::INVALID_INDEX;
@@ -595,22 +603,27 @@ Property::Index Object::RegisterProperty( const std::string& name, Property::Ind
 
   if( index != Property::INVALID_INDEX ) // If there was a valid index found by either key, set it.
   {
-    SetProperty( index, propertyValue );
+    SetProperty(index, std::move(propertyValue));
   }
   else
   {
     // Otherwise register the property
     if( Property::ANIMATABLE == accessMode )
     {
-      index = RegisterSceneGraphProperty( name, key, PROPERTY_CUSTOM_START_INDEX + static_cast<Property::Index>( mCustomProperties.Count() ), propertyValue );
-      AddUniformMapping( index, name );
+      index = RegisterSceneGraphProperty(
+        name,
+        key,
+        PROPERTY_CUSTOM_START_INDEX + static_cast<Property::Index>(mCustomProperties.Count()),
+        std::move(propertyValue));
+      AddUniformMapping(index, std::move(name));
     }
     else
     {
       // Add entry to the property lookup
       index = PROPERTY_CUSTOM_START_INDEX + static_cast<Property::Index>( mCustomProperties.Count() );
 
-      CustomPropertyMetadata* customProperty = new CustomPropertyMetadata( name, propertyValue, accessMode );
+      CustomPropertyMetadata* customProperty =
+        new CustomPropertyMetadata(name, std::move(propertyValue), accessMode);
 
       // Resolve index for the child property
       Object* parent = GetParentObject();
index 5ef0f9e..a61fadd 100644 (file)
@@ -175,7 +175,7 @@ public:
   /**
    * @copydoc Dali::Handle::SetProperty()
    */
-  void SetProperty( Property::Index index, const Property::Value& propertyValue );
+  void SetProperty(Property::Index index, Property::Value propertyValue);
 
   /**
    * @copydoc Dali::Handle::GetProperty()
@@ -197,12 +197,12 @@ public:
   /**
    * @copydoc Dali::Handle::RegisterProperty()
    */
-  Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue );
+  Property::Index RegisterProperty(std::string name, Property::Value propertyValue);
 
   /**
    * @copydoc Dali::Handle::RegisterProperty()
    */
-  Property::Index RegisterProperty( const std::string& name, Property::Index key, const Property::Value& propertyValue );
+  Property::Index RegisterProperty(std::string name, Property::Index key, Property::Value propertyValue);
 
   /**
    * @copydoc Dali::DevelHandle::SetProperties()
@@ -217,12 +217,15 @@ public:
   /**
    * @copydoc Dali::Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode)
    */
-  Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode );
+  Property::Index RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode);
 
   /**
    * @brief Implementing method for this override
    */
-  Property::Index RegisterProperty( const std::string& name, Property::Index key, const Property::Value& propertyValue, Property::AccessMode accessMode );
+  Property::Index RegisterProperty(std::string          name,
+                                   Property::Index      key,
+                                   Property::Value      propertyValue,
+                                   Property::AccessMode accessMode);
 
   /**
    * @brief returns true if the custom property exists on this object.
index 48a549e..81155ef 100644 (file)
@@ -441,7 +441,7 @@ std::string TypeInfo::GetPropertyName( Property::Index index ) const
   return propertyName;
 }
 
-void TypeInfo::AddActionFunction( const std::string &actionName, Dali::TypeInfo::ActionFunction function )
+void TypeInfo::AddActionFunction(std::string actionName, Dali::TypeInfo::ActionFunction function)
 {
   if( nullptr == function)
   {
@@ -454,7 +454,7 @@ void TypeInfo::AddActionFunction( const std::string &actionName, Dali::TypeInfo:
 
     if( iter == mActions.end() )
     {
-      mActions.push_back( ActionPair( actionName, function ) );
+      mActions.push_back(ActionPair(std::move(actionName), function));
     }
     else
     {
@@ -463,7 +463,7 @@ void TypeInfo::AddActionFunction( const std::string &actionName, Dali::TypeInfo:
   }
 }
 
-void TypeInfo::AddConnectorFunction( const std::string& signalName, Dali::TypeInfo::SignalConnectorFunction function )
+void TypeInfo::AddConnectorFunction(std::string signalName, Dali::TypeInfo::SignalConnectorFunction function)
 {
   if( nullptr == function)
   {
@@ -476,7 +476,7 @@ void TypeInfo::AddConnectorFunction( const std::string& signalName, Dali::TypeIn
 
     if( iter == mSignalConnectors.end() )
     {
-      mSignalConnectors.push_back( ConnectionPair( signalName, function ) );
+      mSignalConnectors.push_back(ConnectionPair(std::move(signalName), function));
     }
     else
     {
@@ -485,7 +485,7 @@ void TypeInfo::AddConnectorFunction( const std::string& signalName, Dali::TypeIn
   }
 }
 
-void TypeInfo::AddProperty( const std::string& name, Property::Index index, Property::Type type, Dali::TypeInfo::SetPropertyFunction setFunc, Dali::TypeInfo::GetPropertyFunction getFunc )
+void TypeInfo::AddProperty(std::string name, Property::Index index, Property::Type type, Dali::TypeInfo::SetPropertyFunction setFunc, Dali::TypeInfo::GetPropertyFunction getFunc)
 {
   // The setter can be empty as a property can be read-only.
 
@@ -500,7 +500,7 @@ void TypeInfo::AddProperty( const std::string& name, Property::Index index, Prop
 
     if ( iter == mRegisteredProperties.end() )
     {
-      mRegisteredProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( type, setFunc, getFunc, name, Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX ) ) );
+      mRegisteredProperties.push_back(RegisteredPropertyPair(index, RegisteredProperty(type, setFunc, getFunc, std::move(name), Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX)));
     }
     else
     {
@@ -509,7 +509,7 @@ void TypeInfo::AddProperty( const std::string& name, Property::Index index, Prop
   }
 }
 
-void TypeInfo::AddProperty( const std::string& name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc)
+void TypeInfo::AddProperty(std::string name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc)
 {
 
   // The setter can be empty as a property can be read-only.
@@ -525,7 +525,7 @@ void TypeInfo::AddProperty( const std::string& name, Property::Index index, Prop
 
     if ( iter == mRegisteredProperties.end() )
     {
-      mRegisteredProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( type, setFunc, getFunc, name, Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX ) ) );
+      mRegisteredProperties.push_back(RegisteredPropertyPair(index, RegisteredProperty(type, setFunc, getFunc, std::move(name), Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX)));
     }
     else
     {
@@ -535,15 +535,14 @@ void TypeInfo::AddProperty( const std::string& name, Property::Index index, Prop
 
 }
 
-
-void TypeInfo::AddAnimatableProperty( const std::string& name, Property::Index index, Property::Type type )
+void TypeInfo::AddAnimatableProperty(std::string name, Property::Index index, Property::Type type)
 {
   RegisteredPropertyContainer::iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
                                                         PairFinder< Property::Index, RegisteredPropertyPair>(index) );
 
   if ( iter == mRegisteredProperties.end() )
   {
-    mRegisteredProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( type, name, Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX ) ) );
+    mRegisteredProperties.push_back(RegisteredPropertyPair(index, RegisteredProperty(type, std::move(name), Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX)));
   }
   else
   {
@@ -551,15 +550,15 @@ void TypeInfo::AddAnimatableProperty( const std::string& name, Property::Index i
   }
 }
 
-void TypeInfo::AddAnimatableProperty( const std::string& name, Property::Index index, const Property::Value& defaultValue )
+void TypeInfo::AddAnimatableProperty(std::string name, Property::Index index, Property::Value defaultValue)
 {
   RegisteredPropertyContainer::iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
                                                         PairFinder< Property::Index, RegisteredPropertyPair>(index) );
 
   if ( iter == mRegisteredProperties.end() )
   {
-    mRegisteredProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( defaultValue.GetType(), name, Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX ) ) );
-    mPropertyDefaultValues.push_back( PropertyDefaultValuePair( index, defaultValue ) );
+    mRegisteredProperties.push_back(RegisteredPropertyPair(index, RegisteredProperty(defaultValue.GetType(), std::move(name), Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX)));
+    mPropertyDefaultValues.push_back(PropertyDefaultValuePair(index, std::move(defaultValue)));
   }
   else
   {
@@ -567,7 +566,7 @@ void TypeInfo::AddAnimatableProperty( const std::string& name, Property::Index i
   }
 }
 
-void TypeInfo::AddAnimatablePropertyComponent( const std::string& name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex )
+void TypeInfo::AddAnimatablePropertyComponent(std::string name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex)
 {
   Property::Type type = GetPropertyType( baseIndex );
   DALI_ASSERT_ALWAYS( ( type == Property::VECTOR2 || type == Property::VECTOR3 || type == Property::VECTOR4 ) && "Base property does not support component" );
@@ -584,7 +583,7 @@ void TypeInfo::AddAnimatablePropertyComponent( const std::string& name, Property
 
     if ( iter == mRegisteredProperties.end() )
     {
-      mRegisteredProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( type, name, baseIndex, componentIndex ) ) );
+      mRegisteredProperties.push_back(RegisteredPropertyPair(index, RegisteredProperty(type, std::move(name), baseIndex, componentIndex)));
       success = true;
     }
   }
@@ -592,14 +591,14 @@ void TypeInfo::AddAnimatablePropertyComponent( const std::string& name, Property
   DALI_ASSERT_ALWAYS( success && "Property component already registered" );
 }
 
-void TypeInfo::AddChildProperty( const std::string& name, Property::Index index, Property::Type type )
+void TypeInfo::AddChildProperty(std::string name, Property::Index index, Property::Type type)
 {
   RegisteredPropertyContainer::iterator iter = find_if( mRegisteredChildProperties.begin(), mRegisteredChildProperties.end(),
                                                         PairFinder< Property::Index, RegisteredPropertyPair>(index) );
 
   if ( iter == mRegisteredChildProperties.end() )
   {
-    mRegisteredChildProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( type, name, Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX ) ) );
+    mRegisteredChildProperties.push_back(RegisteredPropertyPair(index, RegisteredProperty(type, std::move(name), Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX)));
   }
   else
   {
@@ -950,7 +949,7 @@ Property::Value TypeInfo::GetPropertyDefaultValue( Property::Index index ) const
   return Property::Value(); // return none
 }
 
-void TypeInfo::SetProperty( BaseObject *object, Property::Index index, const Property::Value& value ) const
+void TypeInfo::SetProperty(BaseObject* object, Property::Index index, Property::Value value) const
 {
   RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
                                                               PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
@@ -967,14 +966,14 @@ void TypeInfo::SetProperty( BaseObject *object, Property::Index index, const Pro
       }
       else
       {
-        iter->second.setFunc( object, index, value );
+        iter->second.setFunc(object, index, std::move(value));
       }
     }
   }
   else if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
     // call base type recursively
-    mBaseType->SetProperty( object, index, value );
+    mBaseType->SetProperty(object, index, std::move(value));
   }
   else
   {
@@ -982,7 +981,7 @@ void TypeInfo::SetProperty( BaseObject *object, Property::Index index, const Pro
   }
 }
 
-void TypeInfo::SetProperty( BaseObject *object, const std::string& name, const Property::Value& value ) const
+void TypeInfo::SetProperty(BaseObject* object, const std::string& name, Property::Value value) const
 {
   RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
                                                               PropertyNameFinder< RegisteredPropertyPair >( name ) );
@@ -997,13 +996,13 @@ void TypeInfo::SetProperty( BaseObject *object, const std::string& name, const P
     }
     else
     {
-      iter->second.setFunc( object, iter->first, value );
+      iter->second.setFunc(object, iter->first, std::move(value));
     }
   }
   else if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
     // call base type recursively
-    mBaseType->SetProperty( object, name, value );
+    mBaseType->SetProperty(object, name, std::move(value));
   }
   else
   {
index 6d90b75..8ea06a4 100644 (file)
@@ -138,14 +138,14 @@ public:
   /*
    * Add an action function
    */
-  void AddActionFunction( const std::string &actionName, Dali::TypeInfo::ActionFunction function );
+  void AddActionFunction(std::string actionName, Dali::TypeInfo::ActionFunction function);
 
   /*
    * Add a function for connecting a signal.
    * @param[in] signalName The name of the signal.
    * @param[in] function The function used for connecting to the signal.
    */
-  void AddConnectorFunction( const std::string& signalName, Dali::TypeInfo::SignalConnectorFunction function );
+  void AddConnectorFunction(std::string signalName, Dali::TypeInfo::SignalConnectorFunction function);
 
   /**
    * Adds an event-thread only property to the type.
@@ -155,7 +155,7 @@ public:
    * @param[in] setFunc The function to call to set the property (Can be nullptr).
    * @param[in] getFunc The function to call to retrieve the value of the property.
    */
-  void AddProperty( const std::string& name, Property::Index index, Property::Type type, Dali::TypeInfo::SetPropertyFunction setFunc, Dali::TypeInfo::GetPropertyFunction getFunc );
+  void AddProperty(std::string name, Property::Index index, Property::Type type, Dali::TypeInfo::SetPropertyFunction setFunc, Dali::TypeInfo::GetPropertyFunction getFunc);
 
   /**
    * Adds an event-thread only property to the type.
@@ -165,7 +165,7 @@ public:
    * @param[in] setFunc The function to call to set the property (Can be nullptr).
    * @param[in] getFunc The function to call to retrieve the value of the property.
    */
-  void AddProperty( const std::string& name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc);
+  void AddProperty(std::string name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc);
 
   /**
    * Adds an animatable property to the type.
@@ -173,7 +173,7 @@ public:
    * @param[in] index The index of the property
    * @param[in] type The Property::Type.
    */
-  void AddAnimatableProperty( const std::string& name, Property::Index index, Property::Type type );
+  void AddAnimatableProperty(std::string name, Property::Index index, Property::Type type);
 
   /**
    * Adds an animatable property with the given default value.
@@ -181,7 +181,7 @@ public:
    * @param[in] index The index of the property
    * @param[in] type The Property::Type.
    */
-  void AddAnimatableProperty( const std::string& name, Property::Index index, const Property::Value& defaultValue );
+  void AddAnimatableProperty(std::string name, Property::Index index, Property::Value defaultValue);
 
   /**
    * Adds a component of an animatable property to the type.
@@ -191,7 +191,7 @@ public:
    * @param[in] baseIndex The index of the base animatable property
    * @param[in] component The index The index of the component.
    */
-  void AddAnimatablePropertyComponent( const std::string& name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex );
+  void AddAnimatablePropertyComponent(std::string name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex);
 
   /**
    * Adds a child property to the type.
@@ -199,7 +199,7 @@ public:
    * @param[in] index The index of the property
    * @param[in] type The Property::Type.
    */
-  void AddChildProperty( const std::string& name, Property::Index index, Property::Type type );
+  void AddChildProperty(std::string name, Property::Index index, Property::Type type);
 
   /**
    * Do an action on base object
@@ -307,7 +307,7 @@ public:
    * @param[in] index The property index.
    * @param[in] value The value to set.
    */
-  void SetProperty( BaseObject *object, Property::Index index, const Property::Value& value ) const;
+  void SetProperty(BaseObject* object, Property::Index index, Property::Value value) const;
 
   /**
    * Sets the value of a property with the name specified for the given object.
@@ -315,7 +315,7 @@ public:
    * @param[in] name The property name.
    * @param[in] value The value to set.
    */
-  void SetProperty( BaseObject *object, const std::string& name, const Property::Value& value ) const;
+  void SetProperty(BaseObject* object, const std::string& name, Property::Value value) const;
 
   /**
    * Retrieves the value of a property at the index specified for the given object.
@@ -337,32 +337,31 @@ private:
 
   struct RegisteredProperty
   {
-    RegisteredProperty( Property::Type propType, const std::string& propName, Property::Index basePropertyIndex, int32_t componentIndex )
-        : type( propType ),
-          setFunc( nullptr ),
-          getFunc( nullptr ),
-          name( propName ),
-          basePropertyIndex(basePropertyIndex),
-          componentIndex(componentIndex)
+    RegisteredProperty(Property::Type propType, std::string propName, Property::Index basePropertyIndex, int32_t componentIndex)
+    : type(propType),
+      setFunc(nullptr),
+      getFunc(nullptr),
+      name(std::move(propName)),
+      basePropertyIndex(basePropertyIndex),
+      componentIndex(componentIndex)
     {
     }
 
-
-    RegisteredProperty( Property::Type propType, Dali::TypeInfo::SetPropertyFunction set, Dali::TypeInfo::GetPropertyFunction get, const std::string& propName, Property::Index basePropertyIndex, int componentIndex )
-    : type( propType ),
-      setFunc( set ),
-      getFunc( get ),
-      name( propName ),
+    RegisteredProperty(Property::Type propType, Dali::TypeInfo::SetPropertyFunction set, Dali::TypeInfo::GetPropertyFunction get, std::string propName, Property::Index basePropertyIndex, int componentIndex)
+    : type(propType),
+      setFunc(set),
+      getFunc(get),
+      name(std::move(propName)),
       basePropertyIndex(basePropertyIndex),
       componentIndex(componentIndex)
     {
     }
 
-    RegisteredProperty( Property::Type propType, Dali::CSharpTypeInfo::SetPropertyFunction set, Dali::CSharpTypeInfo::GetPropertyFunction get, const std::string& propName, Property::Index basePropertyIndex, int componentIndex )
-    : type( propType ),
-      cSharpSetFunc( set ),
-      cSharpGetFunc( get ),
-      name( propName ),
+    RegisteredProperty(Property::Type propType, Dali::CSharpTypeInfo::SetPropertyFunction set, Dali::CSharpTypeInfo::GetPropertyFunction get, std::string propName, Property::Index basePropertyIndex, int componentIndex)
+    : type(propType),
+      cSharpSetFunc(set),
+      cSharpGetFunc(get),
+      name(std::move(propName)),
       basePropertyIndex(basePropertyIndex),
       componentIndex(componentIndex)
     {
index ca86f6e..9c79314 100644 (file)
@@ -87,16 +87,16 @@ uint32_t TypeRegistry::GetTypeNameCount() const
   return static_cast<uint32_t>( mRegistryLut.size() );
 }
 
-std::string TypeRegistry::GetTypeName( uint32_t index ) const
+const std::string& TypeRegistry::GetTypeName(uint32_t index) const
 {
-  std::string name;
+  static std::string EMPTY_STRING{};
 
   if( index < mRegistryLut.size() )
   {
-    name = mRegistryLut[ index ]->GetName();
+    return mRegistryLut[index]->GetName();
   }
 
-  return name;
+  return EMPTY_STRING;
 }
 
 std::string TypeRegistry::Register( const std::type_info& theTypeInfo,
@@ -121,12 +121,12 @@ std::string TypeRegistry::Register( const std::type_info& theTypeInfo,
   return Register( uniqueTypeName, baseTypeInfo, createInstance, callCreateOnInit, defaultProperties, defaultPropertyCount );
 }
 
-std::string TypeRegistry::Register( const std::string& uniqueTypeName,
-                                    const std::type_info& baseTypeInfo,
-                                    Dali::TypeInfo::CreateFunction createInstance,
-                                    bool callCreateOnInit,
-                                    const Dali::PropertyDetails* defaultProperties,
-                                    Property::Index defaultPropertyCount )
+std::string TypeRegistry::Register(std::string                    uniqueTypeName,
+                                   const std::type_info&          baseTypeInfo,
+                                   Dali::TypeInfo::CreateFunction createInstance,
+                                   bool                           callCreateOnInit,
+                                   const Dali::PropertyDetails*   defaultProperties,
+                                   Property::Index                defaultPropertyCount)
 {
   std::string baseTypeName = DemangleClassName( baseTypeInfo.name() );
 
@@ -153,8 +153,7 @@ std::string TypeRegistry::Register( const std::string& uniqueTypeName,
   return uniqueTypeName;
 }
 
-void TypeRegistry::Register( const std::string& uniqueTypeName, const std::type_info& baseTypeInfo,
-    Dali::CSharpTypeInfo::CreateFunction createInstance )
+void TypeRegistry::Register(std::string uniqueTypeName, const std::type_info& baseTypeInfo, Dali::CSharpTypeInfo::CreateFunction createInstance)
 {
   std::string baseTypeName = DemangleClassName( baseTypeInfo.name() );
 
@@ -186,38 +185,38 @@ std::string TypeRegistry::RegistrationName( const std::type_info& registerType )
   return DemangleClassName( registerType.name() );
 }
 
-void TypeRegistry::RegisterSignal( TypeRegistration& typeRegistration, const std::string& name, Dali::TypeInfo::SignalConnectorFunction func )
+void TypeRegistry::RegisterSignal(TypeRegistration& typeRegistration, std::string name, Dali::TypeInfo::SignalConnectorFunction func)
 {
   for( auto&& iter : mRegistryLut )
   {
     if( iter->GetName() == typeRegistration.RegisteredName() )
     {
-      iter->AddConnectorFunction( name, func );
+      iter->AddConnectorFunction(std::move(name), func);
       break;
     }
   }
 }
 
-bool TypeRegistry::RegisterAction( TypeRegistration& typeRegistration, const std::string &name, Dali::TypeInfo::ActionFunction f )
+bool TypeRegistry::RegisterAction(TypeRegistration& typeRegistration, std::string name, Dali::TypeInfo::ActionFunction f)
 {
   for( auto&& iter : mRegistryLut )
   {
     if( iter->GetName() == typeRegistration.RegisteredName() )
     {
-      iter->AddActionFunction( name, f );
+      iter->AddActionFunction(std::move(name), f);
       return true;
     }
   }
   return false;
 }
 
-bool TypeRegistry::RegisterProperty( TypeRegistration& typeRegistration, const std::string& name, Property::Index index, Property::Type type, Dali::TypeInfo::SetPropertyFunction setFunc, Dali::TypeInfo::GetPropertyFunction getFunc )
+bool TypeRegistry::RegisterProperty(TypeRegistration& typeRegistration, std::string name, Property::Index index, Property::Type type, Dali::TypeInfo::SetPropertyFunction setFunc, Dali::TypeInfo::GetPropertyFunction getFunc)
 {
   for( auto&& iter : mRegistryLut )
   {
     if( iter->GetName() == typeRegistration.RegisteredName() )
     {
-      iter->AddProperty( name, index, type, setFunc, getFunc );
+      iter->AddProperty(std::move(name), index, type, setFunc, getFunc);
       return true;
     }
   }
@@ -225,13 +224,13 @@ bool TypeRegistry::RegisterProperty( TypeRegistration& typeRegistration, const s
   return false;
 }
 
-bool TypeRegistry::RegisterProperty( const std::string& objectName, const std::string& name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc )
+bool TypeRegistry::RegisterProperty(const std::string& objectName, std::string name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc)
 {
   for( auto&& iter : mRegistryLut )
   {
     if( iter->GetName() == objectName )
     {
-      iter->AddProperty( name, index, type, setFunc, getFunc );
+      iter->AddProperty(std::move(name), index, type, setFunc, getFunc);
       return true;
     }
   }
@@ -239,14 +238,13 @@ bool TypeRegistry::RegisterProperty( const std::string& objectName, const std::s
   return false;
 }
 
-
-bool TypeRegistry::RegisterAnimatableProperty( TypeRegistration& typeRegistration, const std::string& name, Property::Index index, Property::Type type )
+bool TypeRegistry::RegisterAnimatableProperty(TypeRegistration& typeRegistration, std::string name, Property::Index index, Property::Type type)
 {
   for( auto&& iter : mRegistryLut )
   {
     if( iter->GetName() == typeRegistration.RegisteredName() )
     {
-      iter->AddAnimatableProperty( name, index, type );
+      iter->AddAnimatableProperty(std::move(name), index, type);
       return true;
     }
   }
@@ -254,13 +252,13 @@ bool TypeRegistry::RegisterAnimatableProperty( TypeRegistration& typeRegistratio
   return false;
 }
 
-bool TypeRegistry::RegisterAnimatableProperty( TypeRegistration& typeRegistration, const std::string& name, Property::Index index, const Property::Value& value )
+bool TypeRegistry::RegisterAnimatableProperty(TypeRegistration& typeRegistration, std::string name, Property::Index index, Property::Value value)
 {
   for( auto&& iter : mRegistryLut )
   {
     if( iter->GetName() == typeRegistration.RegisteredName() )
     {
-      iter->AddAnimatableProperty( name, index, value );
+      iter->AddAnimatableProperty(std::move(name), index, std::move(value));
       return true;
     }
   }
@@ -268,13 +266,13 @@ bool TypeRegistry::RegisterAnimatableProperty( TypeRegistration& typeRegistratio
   return false;
 }
 
-bool TypeRegistry::RegisterAnimatablePropertyComponent( TypeRegistration& typeRegistration, const std::string& name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex )
+bool TypeRegistry::RegisterAnimatablePropertyComponent(TypeRegistration& typeRegistration, std::string name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex)
 {
   for( auto&& iter : mRegistryLut )
   {
     if( iter->GetName() == typeRegistration.RegisteredName() )
     {
-      iter->AddAnimatablePropertyComponent( name, index, baseIndex, componentIndex );
+      iter->AddAnimatablePropertyComponent(std::move(name), index, baseIndex, componentIndex);
       return true;
     }
   }
@@ -282,13 +280,13 @@ bool TypeRegistry::RegisterAnimatablePropertyComponent( TypeRegistration& typeRe
   return false;
 }
 
-bool TypeRegistry::RegisterChildProperty( const std::string& registeredType, const std::string& name, Property::Index index, Property::Type type )
+bool TypeRegistry::RegisterChildProperty(const std::string& registeredType, std::string name, Property::Index index, Property::Type type)
 {
   for( auto&& iter : mRegistryLut )
   {
     if( iter->GetName() == registeredType )
     {
-      iter->AddChildProperty( name, index, type );
+      iter->AddChildProperty(std::move(name), index, type);
       return true;
     }
   }
@@ -296,9 +294,9 @@ bool TypeRegistry::RegisterChildProperty( const std::string& registeredType, con
   return false;
 }
 
-bool TypeRegistry::RegisterChildProperty( TypeRegistration& typeRegistration, const std::string& name, Property::Index index, Property::Type type )
+bool TypeRegistry::RegisterChildProperty(TypeRegistration& typeRegistration, std::string name, Property::Index index, Property::Type type)
 {
-  return RegisterChildProperty( typeRegistration.RegisteredName(), name, index, type );
+  return RegisterChildProperty(typeRegistration.RegisteredName(), std::move(name), index, type);
 }
 
 bool TypeRegistry::DoActionTo( BaseObject * const object, const std::string& actionName, const Property::Map& properties )
index 35018b9..23daf87 100644 (file)
@@ -67,7 +67,7 @@ public:
   /**
    * @copydoc Dali::TypeRegistry::GetTypeName
    */
-  std::string GetTypeName( uint32_t index ) const;
+  const std::string& GetTypeName(uint32_t index) const;
 
   /**
    * Register a type
@@ -107,15 +107,12 @@ public:
    * @param [in] defaultPropertyCount count of default properties
    * @return the name of the registered type.
    */
-  std::string Register( const std::string& name, const std::type_info& baseTypeInfo,
-                        Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit,
-                        const Dali::PropertyDetails* defaultProperties = nullptr, Property::Index defaultPropertyCount = 0 );
+  std::string Register(std::string name, const std::type_info& baseTypeInfo, Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit, const Dali::PropertyDetails* defaultProperties = nullptr, Property::Index defaultPropertyCount = 0);
 
   /**
    * @copydoc CSharpTypeRegistry::TypeRegistration( const std::string&, const std::type_info&, TypeInfo::CreateFunction );
    */
-  void Register( const std::string& name, const std::type_info& baseTypeInfo,
-                 Dali::CSharpTypeInfo::CreateFunction createInstance );
+  void Register(std::string name, const std::type_info& baseTypeInfo, Dali::CSharpTypeInfo::CreateFunction createInstance);
 
   /**
    * Register a signal connector function to a type
@@ -123,7 +120,7 @@ public:
    * @param [in] name Signal name
    * @param [in] func Signal connector function
    */
-  void RegisterSignal( TypeRegistration& typeRegistration, const std::string& name, Dali::TypeInfo::SignalConnectorFunction func );
+  void RegisterSignal(TypeRegistration& typeRegistration, std::string name, Dali::TypeInfo::SignalConnectorFunction func);
 
   /**
    * Register an action function to a type
@@ -132,7 +129,7 @@ public:
    * @param [in] f Action function
    * @return true if registered
    */
-  bool RegisterAction( TypeRegistration& registered, const std::string& name, Dali::TypeInfo::ActionFunction f );
+  bool RegisterAction(TypeRegistration& registered, std::string name, Dali::TypeInfo::ActionFunction f);
 
   /**
    * Register an event-thread only property with a type
@@ -144,7 +141,7 @@ public:
    * @param [in] getFunc The function to get the value of a property.
    * @return true if registered
    */
-  bool RegisterProperty( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type, Dali::TypeInfo::SetPropertyFunction setFunc, Dali::TypeInfo::GetPropertyFunction getFunc );
+  bool RegisterProperty(TypeRegistration& registered, std::string name, Property::Index index, Property::Type type, Dali::TypeInfo::SetPropertyFunction setFunc, Dali::TypeInfo::GetPropertyFunction getFunc);
 
   /**
    * Register an event-thread only property with a type (used by C# Custom controls)
@@ -156,8 +153,7 @@ public:
    * @param [in] getFunc The function to get the value of a property.
    * @return true if registered
    */
-  bool RegisterProperty( const std::string& objectName, const std::string& name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc );
-
+  bool RegisterProperty(const std::string& objectName, std::string name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc);
 
   /**
    * Register a scene graph only property with a type
@@ -167,7 +163,7 @@ public:
    * @param [in] type Property type
    * @return true if registered
    */
-  bool RegisterAnimatableProperty( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type );
+  bool RegisterAnimatableProperty(TypeRegistration& registered, std::string name, Property::Index index, Property::Type type);
 
   /**
    * Register a scene graph only property with a default value
@@ -177,7 +173,7 @@ public:
    * @param [in] value Property default value
    * @return true if registered
    */
-  bool RegisterAnimatableProperty( TypeRegistration& registered, const std::string& name, Property::Index index, const Property::Value& defaultValue );
+  bool RegisterAnimatableProperty(TypeRegistration& registered, std::string name, Property::Index index, Property::Value defaultValue);
 
   /**
    * Register a component of a scene graph only property that supports components (i.e. Vector2, Vector3 and Vector4)
@@ -188,7 +184,7 @@ public:
    * @param [in] componentIndex Component index
    * @return true if registered
    */
-  bool RegisterAnimatablePropertyComponent( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex );
+  bool RegisterAnimatablePropertyComponent(TypeRegistration& registered, std::string name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex);
 
   /**
    * Register a event-thread only property with a type and a default value
@@ -198,7 +194,7 @@ public:
    * @param [in] type Property type
    * @return true if registered
    */
-  bool RegisterChildProperty( const std::string& registeredType, const std::string& name, Property::Index index, Property::Type type );
+  bool RegisterChildProperty(const std::string& registeredType, std::string name, Property::Index index, Property::Type type);
 
   /**
    * Register a event-thread only property with a type and a default value
@@ -208,7 +204,7 @@ public:
    * @param [in] type Property type
    * @return true if registered
    */
-  bool RegisterChildProperty( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type );
+  bool RegisterChildProperty(TypeRegistration& registered, std::string name, Property::Index index, Property::Type type);
 
   /**
    * @copydoc Dali::Internal::TypeInfo::DoActionTo
index 0f938d4..d765582 100644 (file)
@@ -99,24 +99,24 @@ Property::Type Handle::GetPropertyType(Property::Index index) const
   return GetImplementation(*this).GetPropertyType(index);
 }
 
-void Handle::SetProperty(Property::Index index, const Property::Value& propertyValue)
+void Handle::SetProperty(Property::Index index, Property::Value propertyValue)
 {
-  GetImplementation(*this).SetProperty(index, propertyValue);
+  GetImplementation(*this).SetProperty(index, std::move(propertyValue));
 }
 
-Property::Index Handle::RegisterProperty(const std::string& name, const Property::Value& propertyValue)
+Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue)
 {
-  return GetImplementation(*this).RegisterProperty(name, propertyValue);
+  return GetImplementation(*this).RegisterProperty(std::move(name), std::move(propertyValue));
 }
 
-Property::Index Handle::RegisterProperty(Property::Index key, const std::string& name, const Property::Value& propertyValue)
+Property::Index Handle::RegisterProperty(Property::Index key, std::string name, Property::Value propertyValue)
 {
-  return GetImplementation(*this).RegisterProperty(name, key, propertyValue);
+  return GetImplementation(*this).RegisterProperty(std::move(name), key, std::move(propertyValue));
 }
 
-Property::Index Handle::RegisterProperty(const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode)
+Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode)
 {
-  return GetImplementation(*this).RegisterProperty(name, propertyValue, accessMode);
+  return GetImplementation(*this).RegisterProperty(std::move(name), std::move(propertyValue), accessMode);
 }
 
 Property::Value Handle::GetProperty(Property::Index index) const
index 63270ba..b98df2f 100644 (file)
@@ -263,7 +263,7 @@ public:
    * @param[in] propertyValue The new value of the property
    * @pre The property types match i.e. propertyValue.GetType() is equal to GetPropertyType(index).
    */
-  void SetProperty(Property::Index index, const Property::Value& propertyValue);
+  void SetProperty(Property::Index index, Property::Value propertyValue);
 
   /**
    * @brief Registers a new animatable property.
@@ -289,7 +289,7 @@ public:
    *       - Property::ROTATION
    * @note If a property with the desired name already exists, then the value given is just set.
    */
-  Property::Index RegisterProperty(const std::string& name, const Property::Value& propertyValue);
+  Property::Index RegisterProperty(std::string name, Property::Value propertyValue);
 
   /**
    * @brief Register a new animatable property with an integer key.
@@ -329,9 +329,9 @@ public:
    *       - Property::ROTATION
    * @note If a property with the desired name already exists, then the value given is just set.
    */
-  Property::Index RegisterProperty(Property::Index        key,
-                                   const std::string&     name,
-                                   const Property::Value& propertyValue);
+  Property::Index RegisterProperty(Property::Index key,
+                                   std::string     name,
+                                   Property::Value propertyValue);
 
   /**
    * @brief Registers a new property.
@@ -356,7 +356,7 @@ public:
    *       - Property::ROTATION
    * @note If a property with the desired name already exists, then the value given is just set.
    */
-  Property::Index RegisterProperty(const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode);
+  Property::Index RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode);
 
   /**
    * @brief Retrieves a property value.
index 00b6bf9..e9a0ab2 100644 (file)
@@ -96,69 +96,69 @@ TypeRegistration::TypeRegistration(const std::type_info& registerType, const std
   mName = impl->Register(registerType, baseType, f, false, defaultProperties.propertyTable, defaultProperties.propertyCount);
 }
 
-TypeRegistration::TypeRegistration(const std::string& name, const std::type_info& baseType, TypeInfo::CreateFunction f)
+TypeRegistration::TypeRegistration(std::string name, const std::type_info& baseType, TypeInfo::CreateFunction f)
 : mReference(Internal::TypeRegistry::Get())
 {
   Internal::TypeRegistry* impl = Internal::TypeRegistry::Get();
 
-  mName = impl->Register(name, baseType, f, false);
+  mName = impl->Register(std::move(name), baseType, f, false);
 }
 
-const std::string TypeRegistration::RegisteredName() const
+const std::string& TypeRegistration::RegisteredName() const
 {
   return mName;
 }
 
-SignalConnectorType::SignalConnectorType(TypeRegistration& typeRegistration, const std::string& name, TypeInfo::SignalConnectorFunction func)
+SignalConnectorType::SignalConnectorType(TypeRegistration& typeRegistration, std::string name, TypeInfo::SignalConnectorFunction func)
 {
-  Internal::TypeRegistry::Get()->RegisterSignal(typeRegistration, name, func);
+  Internal::TypeRegistry::Get()->RegisterSignal(typeRegistration, std::move(name), func);
 }
 
-TypeAction::TypeAction(TypeRegistration& registered, const std::string& name, TypeInfo::ActionFunction f)
+TypeAction::TypeAction(TypeRegistration& registered, std::string name, TypeInfo::ActionFunction f)
 {
-  Internal::TypeRegistry::Get()->RegisterAction(registered, name, f);
+  Internal::TypeRegistry::Get()->RegisterAction(registered, std::move(name), f);
 }
 
-PropertyRegistration::PropertyRegistration(TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type, TypeInfo::SetPropertyFunction setFunc, TypeInfo::GetPropertyFunction getFunc)
+PropertyRegistration::PropertyRegistration(TypeRegistration& registered, std::string name, Property::Index index, Property::Type type, TypeInfo::SetPropertyFunction setFunc, TypeInfo::GetPropertyFunction getFunc)
 {
   DALI_ASSERT_ALWAYS((index >= PROPERTY_REGISTRATION_START_INDEX) && (index <= PROPERTY_REGISTRATION_MAX_INDEX));
 
-  Internal::TypeRegistry::Get()->RegisterProperty(registered, name, index, type, setFunc, getFunc);
+  Internal::TypeRegistry::Get()->RegisterProperty(registered, std::move(name), index, type, setFunc, getFunc);
 }
 
-AnimatablePropertyRegistration::AnimatablePropertyRegistration(TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type)
+AnimatablePropertyRegistration::AnimatablePropertyRegistration(TypeRegistration& registered, std::string name, Property::Index index, Property::Type type)
 {
   DALI_ASSERT_ALWAYS((index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX) && (index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX));
 
-  Internal::TypeRegistry::Get()->RegisterAnimatableProperty(registered, name, index, type);
+  Internal::TypeRegistry::Get()->RegisterAnimatableProperty(registered, std::move(name), index, type);
 }
 
-AnimatablePropertyRegistration::AnimatablePropertyRegistration(TypeRegistration& registered, const std::string& name, Property::Index index, const Property::Value& value)
+AnimatablePropertyRegistration::AnimatablePropertyRegistration(TypeRegistration& registered, std::string name, Property::Index index, const Property::Value& value)
 {
   DALI_ASSERT_ALWAYS((index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX) && (index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX));
 
-  Internal::TypeRegistry::Get()->RegisterAnimatableProperty(registered, name, index, value);
+  Internal::TypeRegistry::Get()->RegisterAnimatableProperty(registered, std::move(name), index, value);
 }
 
-AnimatablePropertyComponentRegistration::AnimatablePropertyComponentRegistration(TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex)
+AnimatablePropertyComponentRegistration::AnimatablePropertyComponentRegistration(TypeRegistration& registered, std::string name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex)
 {
   DALI_ASSERT_ALWAYS((index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX) && (index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX));
 
-  Internal::TypeRegistry::Get()->RegisterAnimatablePropertyComponent(registered, name, index, baseIndex, componentIndex);
+  Internal::TypeRegistry::Get()->RegisterAnimatablePropertyComponent(registered, std::move(name), index, baseIndex, componentIndex);
 }
 
-ChildPropertyRegistration::ChildPropertyRegistration(TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type)
+ChildPropertyRegistration::ChildPropertyRegistration(TypeRegistration& registered, std::string name, Property::Index index, Property::Type type)
 {
   DALI_ASSERT_ALWAYS((index >= CHILD_PROPERTY_REGISTRATION_START_INDEX) && (index <= CHILD_PROPERTY_REGISTRATION_MAX_INDEX));
 
-  Internal::TypeRegistry::Get()->RegisterChildProperty(registered, name, index, type);
+  Internal::TypeRegistry::Get()->RegisterChildProperty(registered, std::move(name), index, type);
 }
 
-ChildPropertyRegistration::ChildPropertyRegistration(const std::string& registered, const std::string& name, Property::Index index, Property::Type type)
+ChildPropertyRegistration::ChildPropertyRegistration(std::string registered, std::string name, Property::Index index, Property::Type type)
 {
   DALI_ASSERT_ALWAYS((index >= CHILD_PROPERTY_REGISTRATION_START_INDEX) && (index <= CHILD_PROPERTY_REGISTRATION_MAX_INDEX));
 
-  Internal::TypeRegistry::Get()->RegisterChildProperty(registered, name, index, type);
+  Internal::TypeRegistry::Get()->RegisterChildProperty(std::move(registered), std::move(name), index, type);
 }
 
 } // namespace Dali
index 5e3ceda..e692423 100644 (file)
@@ -247,7 +247,7 @@ public:
    * @param[in] baseType the base type info of registerType
    * @param[in] f registerType instance creation function
    */
-  TypeRegistration(const std::string& name, const std::type_info& baseType, TypeInfo::CreateFunction f);
+  TypeRegistration(std::string name, const std::type_info& baseType, TypeInfo::CreateFunction f);
 
   /**
    * @brief The name the type is registered under (derived from type_info).
@@ -255,7 +255,7 @@ public:
    * @SINCE_1_0.0
    * @return The registered name or empty if unregistered
    */
-  const std::string RegisteredName() const;
+  const std::string& RegisteredName() const;
 
 private:
   TypeRegistry mReference; ///< Reference to the type registry
@@ -277,7 +277,7 @@ public:
    * @param[in] name The signal name
    * @param[in] func The signal connector function
    */
-  SignalConnectorType(TypeRegistration& typeRegistration, const std::string& name, TypeInfo::SignalConnectorFunction func);
+  SignalConnectorType(TypeRegistration& typeRegistration, std::string name, TypeInfo::SignalConnectorFunction func);
 };
 
 /**
@@ -295,7 +295,7 @@ public:
    * @param[in] name The action name
    * @param[in] f The action function
    */
-  TypeAction(TypeRegistration& registered, const std::string& name, TypeInfo::ActionFunction f);
+  TypeAction(TypeRegistration& registered, std::string name, TypeInfo::ActionFunction f);
 };
 
 /**
@@ -332,7 +332,7 @@ public:
    *
    */
   PropertyRegistration(TypeRegistration&             registered,
-                       const std::string&            name,
+                       std::string                   name,
                        Property::Index               index,
                        Property::Type                type,
                        TypeInfo::SetPropertyFunction setFunc,
@@ -360,7 +360,7 @@ public:
    * @param[in] type The property value type
    * @pre "registered" must be registered with the TypeRegistry.
    */
-  AnimatablePropertyRegistration(TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type);
+  AnimatablePropertyRegistration(TypeRegistration& registered, std::string name, Property::Index index, Property::Type type);
 
   /**
    * @brief This constructor registers the animatable property with the registered default value.
@@ -376,7 +376,7 @@ public:
    * @param[in] value The property default value
    * @pre "registered" must be registered with the TypeRegistry.
    */
-  AnimatablePropertyRegistration(TypeRegistration& registered, const std::string& name, Property::Index index, const Property::Value& value);
+  AnimatablePropertyRegistration(TypeRegistration& registered, std::string name, Property::Index index, const Property::Value& value);
 };
 
 /**
@@ -403,7 +403,7 @@ public:
    * @param[in] componentIndex The index of the component (e.g. 0 for the x component of a Vector2 property and 1 for the y component of a Vector2 property)
    * @pre "registered" must be registered with the TypeRegistry.
    */
-  AnimatablePropertyComponentRegistration(TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex);
+  AnimatablePropertyComponentRegistration(TypeRegistration& registered, std::string name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex);
 };
 
 /**
@@ -424,7 +424,7 @@ public:
    * @param[in] type The property value type
    * @pre "registered" must be registered with the TypeRegistry.
    */
-  ChildPropertyRegistration(TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type);
+  ChildPropertyRegistration(TypeRegistration& registered, std::string name, Property::Index index, Property::Type type);
 
   /**
    * @brief This constructor registers an event-thread only child property (i.e. a property
@@ -437,7 +437,7 @@ public:
    * @param[in] type The property value type
    * @pre "registered" must be registered with the TypeRegistry.
    */
-  ChildPropertyRegistration(const std::string& registered, const std::string& name, Property::Index index, Property::Type type);
+  ChildPropertyRegistration(std::string registered, std::string name, Property::Index index, Property::Type type);
 };
 
 /**