00001 #ifndef X3DTK_RECORDER_H 00002 #define X3DTK_RECORDER_H 00003 00004 #include "BaseRecorder.h" 00005 #include "EnterFunction.h" 00006 #include "WalkOnFunction.h" 00007 #include "LeaveFunction.h" 00008 #include "CreationFunction.h" 00009 #include "NodeFactory.h" 00010 #include "SFSceneGraph.h" 00011 #include "X3DAttributeRecorder.h" 00012 #include "X3DNodeCloner.h" 00013 #include "X3DSFNodeRecorder.h" 00014 #include "X3DMFNodeRecorder.h" 00015 00016 #include <utility> 00017 00018 namespace X3DTK { 00019 00020 class X3DAbstractNode; 00021 00022 struct StringType 00023 { 00024 SFString type; 00025 SFString component; 00026 SFString sceneGraph; 00027 SFString encodedName; 00028 }; 00029 00030 struct TypeName 00031 { 00032 SFString name; 00033 SFString component; 00034 SFString sceneGraph; 00035 X3DNodeCloner *cloner; 00036 }; 00037 00049 template<class T, class V = nil> 00050 class Recorder : public BaseRecorder 00051 { 00052 public: 00054 static std::pair<StringType, EnterFunction *> getEnterFunction(void (*ptrF)(T *)); 00056 static std::pair<StringType, WalkOnFunction *> getWalkOnFunction(bool (*ptrF)(T *, SFNode)); 00058 static std::pair<StringType, LeaveFunction *> getLeaveFunction(void (*ptrF)(T *)); 00060 static std::pair<StringType, CreationFunction *> getCreationFunction(); 00062 static TypeName getTypeName(const SFString &name, const SFString &component = SFString(""), const SFString &sceneGraph = SFString("")); 00064 static AttributeRecorder<T, V> getAttribute(const SFString &name, V T:: *member, const V &init); 00066 static SFNodeRecorder<T, V> getSFNode(const SFString &name, V *T:: *node); 00068 static MFNodeRecorder<T, V> getMFNode(const SFString &name, MFNode T:: *nodes); 00069 }; 00070 00071 } 00072 00073 #include "Recorder.inl" 00074 00075 #endif