X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fcommon%2Ftype-registry-impl.h;h=8437ba07762c3bd96c925f72eb3798df4739f7ea;hb=33a8477946185463936981476e9772d40c37fd72;hp=23daf87a8ce632df9e4a7ee7b926e6da8aaaf9f9;hpb=f15d1ed84355ced4b6c5115b8aebb68d897cd374;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/common/type-registry-impl.h b/dali/internal/event/common/type-registry-impl.h index 23daf87..8437ba0 100644 --- a/dali/internal/event/common/type-registry-impl.h +++ b/dali/internal/event/common/type-registry-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_TYPE_REGISTRY_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -20,18 +20,17 @@ // INTERNAL INCLUDES #include -#include -#include -#include +#include #include #include +#include +#include +#include namespace Dali { - namespace Internal { - class PropertyDetails; /* @@ -40,24 +39,23 @@ class PropertyDetails; class TypeRegistry : public Dali::BaseObject { public: - // using intrusive pointer instead of handles internally as they are considerably cheaper using TypeInfoPointer = IntrusivePtr; /** * Get the TypeRegistry */ - static TypeRegistry *Get(); + static TypeRegistry* Get(); /** * @copydoc Dali::TypeRegistry::GetTypeInfo */ - TypeInfoPointer GetTypeInfo( const std::string &uniqueTypeName ); + TypeInfoPointer GetTypeInfo(const std::string& uniqueTypeName); /** * @copydoc Dali::TypeRegistry::GetTypeInfo */ - TypeInfoPointer GetTypeInfo( const std::type_info& registerType ); + TypeInfoPointer GetTypeInfo(const std::type_info& registerType); /** * @copydoc Dali::TypeRegistry::GetTypeNameCount @@ -78,8 +76,7 @@ public: * @param [in] callCreateOnInit If true call createInstance on DALi initialisation * @return the name of the registered type. */ - std::string Register( const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo, - Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit ); + std::string Register(const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo, Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit); /** * Register a type @@ -92,9 +89,7 @@ public: * @param [in] defaultPropertyCount count of default properties * @return the name of the registered type. */ - std::string Register( const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo, - Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit, - const Dali::PropertyDetails* defaultProperties, Property::Index defaultPropertyCount ); + std::string Register(const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo, Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit, const Dali::PropertyDetails* defaultProperties, Property::Index defaultPropertyCount); /** * Register a type @@ -210,19 +205,19 @@ public: * @copydoc Dali::Internal::TypeInfo::DoActionTo * Walks all base types until it finds a doer. */ - bool DoActionTo( BaseObject * const object, const std::string &actionName, const Property::Map& properties); + bool DoActionTo(BaseObject* const object, const std::string& actionName, const Property::Map& properties); /** * @copydoc Dali::BaseHandle::ConnectSignal() */ - bool ConnectSignal( BaseObject* object, ConnectionTrackerInterface* connectionTracker, const std::string& signalName, FunctorDelegate* functor ); + bool ConnectSignal(BaseObject* object, ConnectionTrackerInterface* connectionTracker, const std::string& signalName, FunctorDelegate* functor); /** * Return the type info for a given BaseObject pointer * @param [in] pBaseObject Pointer to a BaseObject * @return TypeInfo for the BaseObject. */ - TypeInfoPointer GetTypeInfo(const Dali::BaseObject * const pBaseObject); + TypeInfoPointer GetTypeInfo(const Dali::BaseObject* const pBaseObject); /** * Calls any type creation functions that have been flagged as initialization functions @@ -230,21 +225,20 @@ public: void CallInitFunctions(void) const; public: - /* * Return the name derived from type_info used to register the type * @param [in] registerType Type info for the type to be registered * @return registered name */ - static std::string RegistrationName( const std::type_info& registerType ); + static std::string RegistrationName(const std::type_info& registerType); private: /* * Mapping from type name to TypeInfo */ - std::vector< TypeInfoPointer > mRegistryLut; + Dali::Internal::IndexedConstStringMap mRegistryLut; - std::vector< Dali::TypeInfo::CreateFunction > mInitFunctions; + std::vector mInitFunctions; private: TypeRegistry(); @@ -253,15 +247,14 @@ private: /** * @brief Undefined Copy Constructor */ - TypeRegistry(TypeRegistry &); + TypeRegistry(TypeRegistry&); /** * @brief Undefined Assignment Operator */ - TypeRegistry& operator=(const TypeRegistry &); + TypeRegistry& operator=(const TypeRegistry&); }; - } // namespace Internal // Helpers for public-api forwarding methods