00001 #pragma once 00002 #ifndef FACTORY_H 00003 #define FACTORY_H 00004 00005 #include "Types.h" 00006 00007 namespace RenderTools { 00008 typedef PropertyPtr ( * FactoryFunc )( const XMLNodePtr & ); 00009 00010 class Factory { 00011 public: 00012 static PropertyPtr create( const XMLNodePtr & xml ); 00013 static void registerClass( const string className, FactoryFunc func ); 00014 static bool isRegisteredClass( const string className ); 00015 private: 00016 static map< string, FactoryFunc > s_classes; 00017 }; 00018 }; // namespace 00019 00020 #endif