Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Trie.hpp

Go to the documentation of this file.
00001 #ifndef Trie_HPP
00002 #define Trie_HPP
00003 
00004 enum MatchFind
00005 {
00007    MERGE,
00009    LOOKUP,
00011    HYBRID
00012 };
00013 
00014 
00015 #include "common.hpp"
00016 #include "common/Edge.hpp"
00017 #include "apriori/bodon/InnerNodeSpecific.hpp"
00018 #include <vector>
00019 //#include <iterator>   //for test
00020 
00021 
00022 namespace Bodon
00023 {
00029    template <class LEAF, class EDGELIST>
00030    class Trie : public LEAF, public InnerNodeSpecific<EDGELIST>
00031    {
00032       public:
00033          static std::vector<item_t> neelist;
00034          Trie(){}
00035          Trie(const counter_t counter) : LEAF(counter), 
00036                                          InnerNodeSpecific<EDGELIST>() {}
00037 
00038 
00039          bool neeFind(item_t item) const{return true;} //this should never be called
00040 
00041          void neePushBackSorted(const std::vector<item_t>& new_neelist){} //this should never be called
00042          void neeAddSorted(const std::vector<item_t>& new_neelist){} //this should never be called
00043          void neeInsertItem(const item_t new_item){} //this should never be called
00045          template <class CONTAINER> const Trie* isIncluded( 
00046             const CONTAINER& an_itemset, typename CONTAINER::const_iterator item_it ) const;
00047    };
00048    template <class LEAF, class EDGELIST> std::vector<item_t> Trie<LEAF, EDGELIST>::neelist;
00049    
00058    template <class LEAF, class EDGELIST> template <class CONTAINER> const 
00059    Trie<LEAF, EDGELIST>* Trie<LEAF, EDGELIST>::
00060    isIncluded( const CONTAINER& an_itemset, 
00061       typename CONTAINER::const_iterator item_it ) const
00062    {
00063       if( item_it == an_itemset.end() ) 
00064          return this;
00065       else
00066       {
00067          Trie<LEAF, EDGELIST>* subtrie = static_cast<Trie<LEAF, EDGELIST>*>(
00068             InnerNodeSpecific<EDGELIST>::edgelist.find(*item_it));
00069          if(subtrie)
00070             return subtrie->isIncluded( an_itemset, ++item_it );
00071          else 
00072             return NULL;
00073       }
00074    }
00075 }
00076 
00077 #endif

Generated on Sun Sep 17 17:50:40 2006 for FIM environment by  doxygen 1.4.4