00001 #ifndef MMANN_AGENERICTREE_H 00002 #define MMANN_AGENERICTREE_H 00003 00011 00012 #include "CompareAlgorithms.h" 00013 00015 enum DeleteTreeDataEnum {NO_DELETE_TREE_ITEM, DELETE_TREE_ITEM, DELETE_TREE_ITEM_ARRAY}; 00016 00018 template <class Data, class ConfigData> 00019 class AGenericTree 00020 { 00021 public: 00022 00024 virtual ~AGenericTree(); 00025 00031 virtual Data* Search(Data* NodeData, bool* NodeInserted) = 0; 00032 00037 virtual Data* Find(Data* NodeData) = 0; 00038 00041 virtual void DeleteTree() {} 00042 00043 protected: 00045 AGenericTree(ACompareNodesAlgorithm<Data, ConfigData>* CompareNodes, DeleteTreeDataEnum DeleteTreeData = NO_DELETE_TREE_ITEM, 00046 ConfigData* pConfigData = NULL); 00047 00049 ACompareNodesAlgorithm<Data, ConfigData>* m_CompareNodes; 00050 00052 ConfigData* m_ConfigData; 00053 00055 DeleteTreeDataEnum m_DeleteTreeData; 00056 }; 00057 00058 template <class Data, class ConfigData> 00059 AGenericTree<Data, ConfigData>::AGenericTree(ACompareNodesAlgorithm<Data, ConfigData>* CompareNodes, 00060 DeleteTreeDataEnum DeleteTreeData, ConfigData* pConfigData) 00061 { 00062 m_CompareNodes = CompareNodes; 00063 m_ConfigData = pConfigData; 00064 m_DeleteTreeData = DeleteTreeData; 00065 } 00066 00067 00068 template <class Data, class ConfigData> 00069 AGenericTree<Data, ConfigData>::~AGenericTree() 00070 { 00071 } 00072 00073 00074 #endif