• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

MyGUI_GenericFactory.h

Go to the documentation of this file.
00001 
00007 #ifndef __MYGUI_GENERIC_FACTORY_H__
00008 #define __MYGUI_GENERIC_FACTORY_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_Types.h"
00012 
00013 namespace MyGUI
00014 {
00015 
00016     template <typename Type>
00017     class GenericFactory
00018     {   
00019     public:
00020         typedef delegates::CDelegate1<IObject*&> Delegate;
00021         static typename Delegate::IDelegate* getFactory()
00022         {
00023             return newDelegate(createFromFactory);
00024         }
00025 
00026     private:
00027         static void createFromFactory(IObject*& _instance)
00028         {
00029             _instance = new Type();
00030         }
00031     };
00032 
00033 }
00034 
00035 #endif // __MYGUI_GENERIC_FACTORY_H__

Generated on Sun Jan 30 2011 for MyGUI by  doxygen 1.7.1