00001 00002 // Creator.h // 00004 00005 #ifndef CREATOR_H 00006 #define CREATOR_H 00007 00008 #include "CreationFunction.h" 00009 #include "X3DActor.h" 00010 00011 namespace X3DTK { 00012 namespace X3D { 00013 00014 class X3DComponentCreator; 00015 00017 00018 class Creator : public X3DActor 00019 { 00020 public: 00022 Creator(); 00024 virtual ~Creator(); 00025 00027 void setComponentCreator(X3DComponentCreator *component); 00029 X3D::SFNode createFromName(const SFString &name) const; 00031 void reset(); 00032 00034 SFString getComponentNameOf(const SFString &name) const; 00035 00036 friend Creator *joinCreator(Creator *N0, Creator *N1); 00037 00038 private: 00040 virtual void addType(const Type *type); 00042 CreationFunction *getCreationFunctionOf(const SFString &name) const; 00043 00044 //Dictionary of all the creation functions used. 00045 CreationDict creationDict_; 00046 std::list<X3DComponentCreator *> componentList_; 00047 }; 00048 00049 } 00050 } 00051 00052 #endif