00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_ALGORITHMS_DFS_HH
00018 # define VCSN_ALGORITHMS_DFS_HH
00019
00020 # include <map>
00021
00038 namespace vcsn
00039 {
00040
00041 template <typename S, typename T>
00042 class DepthFirstSearchBase
00043 {
00044 public:
00045 typedef Element<S, T> auto_t;
00046 AUTOMATON_TYPES(auto_t);
00047 typedef enum { WHITE, GRAY, BLACK } color_t;
00048 typedef std::map<hstate_t, color_t> visited_t;
00049 typedef std::vector<hstate_t> delta_ret_t;
00050
00051 void operator() (const auto_t& aut);
00052
00053 protected:
00054
00055 void do_dfs(SELECTOR(AutomataBase<S>, const auto_t& aut));
00056
00057 void do_dfs(const hstate_t& s);
00058
00059 private:
00060 visited_t visited_;
00061
00062 };
00063 }
00066 # ifndef VCSN_USE_INTERFACE_ONLY
00067 # include "dfs.hxx"
00068 # endif // VCSN_USE_INTERFACE_ONLY
00069
00070 #endif // ! VCSN_ALGORITHMS_DFS_HH