00001 00002 00003 00005 00006 00011 00016 00021 // CreationFunction.h // 00023 00024 #ifndef CREATIONFUNCTION_H 00025 #define CREATIONFUNCTION_H 00026 00027 #include "X3DFunction.h" 00028 #include "X3DTypes.h" 00029 00030 namespace X3DTK { 00031 00033 00034 class CreationFunction : public X3DFunction 00035 { 00036 public: 00038 CreationFunction(const ptrToCreationFunction f, const X3DComponentCreator *component); 00040 ~CreationFunction(); 00041 00043 inline X3D::SFNode create() const {return (component_->*ptr2function_)();}; 00044 00045 inline const X3DComponentCreator *getComponent() const {return component_;}; 00046 00047 private: 00049 const ptrToCreationFunction ptr2function_; 00050 const X3DComponentCreator *component_; 00051 }; 00052 00053 } 00054 00055 #endif