7#ifndef MYGUI_FACTORY_MANAGER_H_
8#define MYGUI_FACTORY_MANAGER_H_
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;
#define MYGUI_SINGLETON_DECLARATION(ClassName)
void registerFactory(const std::string &_category)
delegates::CDelegate1< IObject *& > Delegate
void registerFactory(const std::string &_category, const std::string &_type)
Type * createObject(const std::string &_category)
void unregisterFactory(const std::string &_category)
Type * castType(bool _throw=true)