-#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.
/**
* @brief Virtual Destructor.
*/
- virtual ~PropertyMetadata()
- {
- }
+ virtual ~PropertyMetadata() = default;
/**
* @brief Returns whether the property is animatable (i.e. if its a scene graph property).
*/
bool IsAnimatable( void ) const
{
- return NULL != mSceneGraphProperty;
+ return nullptr != mSceneGraphProperty;
}
/**
* @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 )
{
/**
* @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;
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
};
/**
* @brief Destructor.
*/
- virtual ~AnimatablePropertyMetadata()
- {
- }
+ ~AnimatablePropertyMetadata() override = default;
private:
*
* @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 )
{
*
* @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 )
{
/**
* @brief Destructor.
*/
- virtual ~CustomPropertyMetadata()
- {
- }
+ ~CustomPropertyMetadata() override = default;
private:
} // namespace Dali
-#endif // __DALI_INTERNAL_PROPERTY_METADATA_H__
+#endif // DALI_INTERNAL_PROPERTY_METADATA_H