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" );
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);
+ }
}
}
}
}
-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 )
}
}
-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;
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(std::move(name), std::move(propertyValue), accessMode);
// Resolve index for the child property
Object* parent = GetParentObject();
const TypeInfo* parentTypeInfo( parent->GetTypeInfo() );
if( parentTypeInfo )
{
- Property::Index childPropertyIndex = parentTypeInfo->GetChildPropertyIndex( name );
+ Property::Index childPropertyIndex = parentTypeInfo->GetChildPropertyIndex( customProperty->name );
if( childPropertyIndex != Property::INVALID_INDEX )
{
customProperty->childPropertyIndex = childPropertyIndex;
}
}
-void Object::AddUniformMapping( Property::Index propertyIndex, const std::string& uniformName ) const
+void Object::AddUniformMapping(Property::Index propertyIndex, std::string uniformName) const
{
// Get the address of the property if it's a scene property
const PropertyInputImpl* propertyPtr = GetSceneObjectInputProperty( propertyIndex );
{
const SceneGraph::PropertyOwner& sceneObject = GetSceneObject();
- OwnerPointer< SceneGraph::UniformPropertyMapping > map = new SceneGraph::UniformPropertyMapping( uniformName, propertyPtr );
+ OwnerPointer<SceneGraph::UniformPropertyMapping> map =
+ new SceneGraph::UniformPropertyMapping(std::move(uniformName), propertyPtr);
// Message takes ownership of Uniform map (and will delete it after copy)
AddUniformMapMessage( const_cast<EventThreadServices&>(GetEventThreadServices()), sceneObject, map );
}
return nullptr;
}
-Property::Index Object::RegisterSceneGraphProperty( const std::string& name, Property::Index key, Property::Index index, const Property::Value& propertyValue ) const
+Property::Index Object::RegisterSceneGraphProperty( std::string name, Property::Index key, Property::Index index, Property::Value propertyValue ) const
{
// Create a new property
Dali::Internal::OwnerPointer<PropertyBase> newProperty;
{
DALI_ASSERT_ALWAYS( index <= PROPERTY_CUSTOM_MAX_INDEX && "Too many custom properties have been registered" );
- mCustomProperties.PushBack( new CustomPropertyMetadata( name, key, propertyValue, property ) );
+ mCustomProperties.PushBack( new CustomPropertyMetadata( std::move(name), key, std::move(propertyValue), property ) );
}
else
{
- mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, propertyValue, property ) );
+ mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, std::move(propertyValue), property ) );
}
// queue a message to add the property