7#ifndef MYGUI_FACTORY_MANAGER_H_
8#define MYGUI_FACTORY_MANAGER_H_
37 bool isFactoryExist(std::string_view _category, std::string_view _type);
40 template<
typename Type>
47 template<
typename Type>
54 template<
typename Type>
61 IObject* createObject(std::string_view _category, std::string_view _type);
63 template<
typename Type>
73 void destroyObject(
IObject* _object);
76 using MapFactoryItem = std::map<std::string, Delegate, std::less<>>;
77 using MapRegisterFactoryItem = std::map<std::string, MapFactoryItem, std::less<>>;
78 MapRegisterFactoryItem mRegisterFactoryItems;
80 bool mIsInitialise{
false};
#define MYGUI_SINGLETON_DECLARATION(ClassName)
delegates::Delegate< IObject *& > Delegate
void registerFactory(std::string_view _category, std::string_view _type, Delegate::IDelegate *_delegate)
void registerFactory(std::string_view _category, std::string_view _type)
bool isFactoryExist(std::string_view _category, std::string_view _type)
void unregisterFactory(std::string_view _category, std::string_view _type)
void unregisterFactory(std::string_view _category)
Type * createObject(std::string_view _category)
void registerFactory(std::string_view _category)
FactoryManager(const FactoryManager &)=delete
IObject * createObject(std::string_view _category, std::string_view _type)
static Delegate::IDelegate * getFactory()
Type * castType(bool _throw=true)
DelegateFunction< Args... > IDelegate