Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

X3DComponentCreator.h

Go to the documentation of this file.
00001 
00002 
00003 
00005 
00006 
00011 
00016 
00021 //                            X3DComponentCreator.h                           //
00023 
00024 #ifndef X3DCOMPONENTCREATOR_H
00025 #define X3DCOMPONENTCREATOR_H
00026 
00027 #include "X3DComponent.h"
00028 #include "CreationFunction.h"
00029 
00030 namespace X3DTK {
00031 
00033 
00034 class X3DComponentCreator : public X3DComponent
00035 {
00036 public:
00038   X3DComponentCreator();
00040   virtual ~X3DComponentCreator() = 0;
00041   
00043   CreationFunction *getCreationFunctionOf(const SFString &name) const;
00045   inline CreationDict getCreationDict() const {return creationDict_;};
00046   
00048   bool contains(const SFString &name) const;
00049   
00050 protected:  
00052   template<class T> void defineNewCreationFunction(const SFString &name, X3D::SFNode (T::*ptrF)() const)
00053   {
00054     CreationFunction *CF = new CreationFunction(reinterpret_cast<ptrToCreationFunction>(ptrF), this);
00055     creationDict_.insert(std::pair<SFString, CreationFunction *>(name, CF));
00056   };
00057   
00058 //private:
00059   CreationDict creationDict_;
00060 };
00061 
00062 }
00063 
00064 #endif

Generated on Wed Sep 10 11:25:15 2003 for X3DToolKit by doxygen1.3