00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef VAUCANSON_AUTOMATA_IMPLEMENTATION_LISTG_ITERATOR_HXX
00018 # define VAUCANSON_AUTOMATA_IMPLEMENTATION_LISTG_ITERATOR_HXX
00019 
00020 # include <vaucanson/automata/implementation/listg/iterator.hh>
00021 
00022 namespace vcsn
00023 {
00024   namespace listg
00025   {
00026 
00027     
00028 # define LISTG_ITERATOR_TPARAM template <typename Graph, typename Direction>
00029 # define LISTG_ITERATOR DeltaConstIterator<Graph, Direction>
00030 
00031     LISTG_ITERATOR_TPARAM
00032     LISTG_ITERATOR::DeltaConstIterator(const graph_type& g, typename graph_type::hstate_t s)
00033       : graph_(g), s_(s)
00034     {
00035       initialize(direction());
00036     }
00037 
00038     LISTG_ITERATOR_TPARAM
00039     LISTG_ITERATOR::~DeltaConstIterator()
00040     { }
00041 
00042     LISTG_ITERATOR_TPARAM
00043     void
00044     LISTG_ITERATOR::next()
00045     {
00046       ++i_;
00047     }
00048 
00049     LISTG_ITERATOR_TPARAM
00050     bool
00051     LISTG_ITERATOR::done() const
00052     {
00053       return i_ == end_;
00054     }
00055 
00056     LISTG_ITERATOR_TPARAM
00057     void
00058     LISTG_ITERATOR::initialize(const backward_iterator&)
00059     {
00060       i_ = graph_.states_[s_].input_edges.begin();
00061       end_ = graph_.states_[s_].input_edges.end();
00062     }
00063 
00064     LISTG_ITERATOR_TPARAM
00065     void
00066     LISTG_ITERATOR::initialize(const forward_iterator&)
00067     {
00068       i_ = graph_.states_[s_].output_edges.begin();
00069       end_ = graph_.states_[s_].output_edges.end();
00070     }
00071 
00072     LISTG_ITERATOR_TPARAM
00073     typename LISTG_ITERATOR::graph_type::htransition_t
00074     LISTG_ITERATOR::operator*() const
00075     {
00076       return *i_;
00077     }
00078 
00079 # undef LISTG_ITERATOR_TPARAM
00080 # undef LISTG_ITERATOR
00081 
00082   } 
00083 
00084 } 
00085 
00086 
00087 #endif // ! VAUCANSON_AUTOMATA_IMPLEMENTATION_LISTG_ITERATOR_HXX