2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 #include <dali/public-api/object/type-registry.h>
23 #include <dali/internal/event/common/type-registry-impl.h>
28 TypeRegistry::TypeRegistry()
32 TypeRegistry::~TypeRegistry()
36 TypeRegistry TypeRegistry::Get()
38 return TypeRegistry(Internal::TypeRegistry::Get());
41 Dali::TypeInfo TypeRegistry::GetTypeInfo( const std::string &uniqueTypeName )
43 return GetImplementation(*this).GetTypeInfo( uniqueTypeName );
46 Dali::TypeInfo TypeRegistry::GetTypeInfo( const std::type_info& registerType )
48 return GetImplementation(*this).GetTypeInfo( registerType );
51 TypeRegistry::NameContainer TypeRegistry::GetTypeNames() const
53 return GetImplementation(*this).GetTypeNames();
56 TypeRegistry::TypeRegistry(Internal::TypeRegistry* internal)
57 : BaseHandle(internal)
61 TypeRegistration::TypeRegistration( const std::type_info& registerType, const std::type_info& baseType,
62 TypeInfo::CreateFunction f )
63 : mReference(Internal::TypeRegistry::Get())
65 Internal::TypeRegistry *impl = Internal::TypeRegistry::Get();
67 if( impl->Register( registerType, baseType, f, false ) )
69 mName = impl->RegistrationName( registerType );
73 TypeRegistration::TypeRegistration( const std::type_info& registerType, const std::type_info& baseType,
74 TypeInfo::CreateFunction f, bool callCreateOnInit )
75 : mReference(Internal::TypeRegistry::Get())
77 Internal::TypeRegistry *impl = Internal::TypeRegistry::Get();
79 if( impl->Register( registerType, baseType, f, callCreateOnInit ) )
81 mName = impl->RegistrationName( registerType );
85 TypeRegistration::TypeRegistration( const std::string& name, const std::type_info& baseType,
86 TypeInfo::CreateFunction f )
87 : mReference(Internal::TypeRegistry::Get())
89 Internal::TypeRegistry *impl = Internal::TypeRegistry::Get();
91 if( impl->Register( name, baseType, f, false ) )
98 const std::string TypeRegistration::RegisteredName() const
103 SignalConnectorType::SignalConnectorType( TypeRegistration& typeRegistration, const std::string& name, TypeInfo::SignalConnectorFunctionV2 func )
105 Internal::TypeRegistry::Get()->RegisterSignal( typeRegistration, name, func );
108 TypeAction::TypeAction( TypeRegistration ®istered, const std::string &name, TypeInfo::ActionFunction f)
110 Internal::TypeRegistry::Get()->RegisterAction( registered, name, f );