+Property::Index TypeInfo::GetBasePropertyIndex( Property::Index index ) const
+{
+ Property::Index basePropertyIndex = Property::INVALID_INDEX;
+
+ RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
+ PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
+
+ if ( iter != mRegisteredProperties.end() )
+ {
+ basePropertyIndex = iter->second.basePropertyIndex;
+ }
+ else
+ {
+ Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
+ if ( base )
+ {
+ basePropertyIndex = GetImplementation(base).GetBasePropertyIndex( index );
+ }
+ }
+
+ return basePropertyIndex;
+}
+
+int TypeInfo::GetComponentIndex( Property::Index index ) const
+{
+ int componentIndex = Property::INVALID_COMPONENT_INDEX;
+
+ RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
+ PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
+
+ if ( iter != mRegisteredProperties.end() )
+ {
+ componentIndex = iter->second.componentIndex;
+ }
+ else
+ {
+ Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
+ if ( base )
+ {
+ componentIndex = GetImplementation(base).GetComponentIndex( index );
+ }
+ }
+
+ return componentIndex;
+}
+
+Property::Index TypeInfo::GetChildPropertyIndex( const std::string& name ) const
+{
+ Property::Index index = Property::INVALID_INDEX;
+
+ // Slow but should not be done that often
+ RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredChildProperties.begin(), mRegisteredChildProperties.end(),
+ PropertyNameFinder< RegisteredPropertyPair >( name ) );
+
+ if ( iter != mRegisteredChildProperties.end() )
+ {
+ index = iter->first;
+ }
+ else
+ {
+ Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
+ if ( base )
+ {
+ index = GetImplementation(base).GetChildPropertyIndex( name );
+ }
+ }
+
+ return index;
+}
+
+const std::string& TypeInfo::GetChildPropertyName( Property::Index index ) const
+{
+ RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredChildProperties.begin(), mRegisteredChildProperties.end(),
+ PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
+
+ if ( iter != mRegisteredChildProperties.end() )
+ {
+ return iter->second.name;
+ }
+
+ Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
+ if ( base )
+ {
+ return GetImplementation(base).GetChildPropertyName( index );
+ }
+
+ DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as Object
+}
+
+Property::Type TypeInfo::GetChildPropertyType( Property::Index index ) const
+{
+ Property::Type type( Property::NONE );
+
+ RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredChildProperties.begin(), mRegisteredChildProperties.end(),
+ PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
+
+ if ( iter != mRegisteredChildProperties.end() )
+ {
+ type = iter->second.type;
+ }
+ else
+ {
+ Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
+ if ( base )
+ {
+ type = GetImplementation(base).GetChildPropertyType( index );
+ }
+ else
+ {
+ DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as Object
+ }
+ }
+
+ return type;
+}
+