00001 #ifndef X3DTK_X3DCOMPONENTCREATOR_H 00002 #define X3DTK_X3DCOMPONENTCREATOR_H 00003 00004 #include "X3DComponent.h" 00005 #include "X3D_CreationFunction.h" 00006 00007 namespace X3DTK { 00008 namespace X3D { 00009 00016 class X3DComponentCreator : public X3DComponent 00017 { 00018 public: 00020 X3DComponentCreator(); 00022 virtual ~X3DComponentCreator() = 0; 00023 00025 CreationFunction *getCreationFunctionOf(const SFString &name) const; 00027 inline CreationDict getCreationDict() const {return _creationDict;}; 00028 00030 bool contains(const SFString &name) const; 00031 00032 protected: 00034 template<class T> 00035 inline void defineNode(); 00036 00037 private: 00038 template<class T> 00039 inline SFNode create() const; 00040 00042 template<class T, class C> 00043 void defineCreationFunction(SFNode (C::*ptrF)() const); 00044 00045 CreationDict _creationDict; 00046 }; 00047 00048 } 00049 } 00050 00051 #include "X3D_X3DComponentCreator.inl" 00052 00053 #endif