7 #ifndef MYGUI_FACTORY_MANAGER_H_
8 #define MYGUI_FACTORY_MANAGER_H_
27 typedef delegates::CDelegate1<IObject*&>
Delegate;
29 void registerFactory(
const std::string& _category,
const std::string& _type, Delegate::IDelegate* _delegate);
31 void unregisterFactory(
const std::string& _category,
const std::string& _type);
33 void unregisterFactory(
const std::string& _category);
36 bool isFactoryExist(
const std::string& _category,
const std::string& _type);
39 template<
typename Type>
46 template<
typename Type>
53 template<
typename Type>
56 unregisterFactory(_category, Type::getClassTypeName());
60 IObject* createObject(
const std::string& _category,
const std::string& _type);
62 template<
typename Type>
65 IObject* item = createObject(_category, Type::getClassTypeName());
72 void destroyObject(
IObject* _object);
75 typedef std::map<std::string, Delegate> MapFactoryItem;
76 typedef std::map<std::string, MapFactoryItem> MapRegisterFactoryItem;
77 MapRegisterFactoryItem mRegisterFactoryItems;
84 #endif // MYGUI_FACTORY_MANAGER_H_