* We want to discourage the use of property strings (minimize string comparisons),
* particularly for the default properties.
*/
-const std::string DEFAULT_PROPERTY_NAMES[] =
+const char* DEFAULT_PROPERTY_NAMES[] =
{
"weight"
};
return mTag;
}
-bool ActiveConstraintBase::IsSceneObjectRemovable() const
-{
- return true; // The constraint removed when target SceneGraph::PropertyOwner is destroyed
-}
-
unsigned int ActiveConstraintBase::GetDefaultPropertyCount() const
{
return DEFAULT_PROPERTY_COUNT;
}
}
-const std::string& ActiveConstraintBase::GetDefaultPropertyName( Property::Index index ) const
+const char* ActiveConstraintBase::GetDefaultPropertyName( Property::Index index ) const
{
if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
{
}
else
{
- // index out of range..return empty string
- static const std::string INVALID_PROPERTY_NAME;
- return INVALID_PROPERTY_NAME;
+ return NULL;
}
}
Property::Index index = Property::INVALID_INDEX;
// Only one name to compare with...
- if ( name == DEFAULT_PROPERTY_NAMES[0] )
+ if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_NAMES[0] ) ) // dont want to convert rhs to string
{
index = 0;
}
void ActiveConstraintBase::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
{
- switch ( index )
+ if( Dali::ActiveConstraint::WEIGHT == index )
{
- case Dali::ActiveConstraint::WEIGHT:
- {
- SetWeight( propertyValue.Get<float>() );
- break;
- }
-
- default:
- {
- DALI_ASSERT_ALWAYS( false && "ActiveConstraint property out of bounds" ); // should not come here
- break;
- }
+ SetWeight( propertyValue.Get<float>() );
}
}
-void ActiveConstraintBase::SetCustomProperty( Property::Index index, const CustomProperty& entry, const Property::Value& value )
-{
- DALI_ASSERT_ALWAYS( false && "ActiveConstraintBase does not have custom properties"); // should not come here
-}
-
Property::Value ActiveConstraintBase::GetDefaultProperty( Property::Index index ) const
{
Property::Value value;
- switch ( index )
+ if( Dali::ActiveConstraint::WEIGHT == index )
{
- case Dali::ActiveConstraint::WEIGHT:
- {
- value = GetCurrentWeight();
- break;
- }
-
- default:
- {
- DALI_ASSERT_ALWAYS( false && "ActiveConstraint property out of bounds" ); // should not come here
- break;
- }
+ value = GetCurrentWeight();
}
return value;
}
-void ActiveConstraintBase::InstallSceneObjectProperty( SceneGraph::PropertyBase& newProperty, const std::string& name, unsigned int index )
-{
- DALI_ASSERT_ALWAYS( false && "ActiveConstraintBase does not have custom properties" ); // should not come here
-}
-
const SceneGraph::PropertyOwner* ActiveConstraintBase::GetSceneObject() const
{
return mSceneGraphConstraint;