rdelta_transition_iterator.hh 2.36 KB
Newer Older
Florent D'Halluin's avatar
Florent D'Halluin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// rdelta_transition_iterator.hh: this file is part of the Vaucanson project.
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2009 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
//
#ifndef VCSN_AUTOMATA_IMPLEMENTATION_ITERATORS_RDELTA_TRANSITION_ITERATOR_HH
# define VCSN_AUTOMATA_IMPLEMENTATION_ITERATORS_RDELTA_TRANSITION_ITERATOR_HH

#  include <vaucanson/automata/implementation/iterators/transition_iterator_base.hh>

namespace vcsn
{

  template <typename T>
  struct RDeltaTransitionIterator;

  /**
   * Iterator traits.
   */
  template <typename T>
  struct iterator_traits_<RDeltaTransitionIterator<T> >
  {
    typedef T graph_t;
    typedef typename graph_t::htransition_t value_type;
  };

  /**
   * Class for iterators on the successors of a given state.
   */
  template <typename T>
  struct RDeltaTransitionIterator
    : TransitionIteratorBase<RDeltaTransitionIterator<T> >
  {

    /// Self type definition.
    typedef RDeltaTransitionIterator<T> self_t;

    typedef typename TransitionIteratorBase<self_t>::graph_t graph_t;

    // Typedefs
    typedef typename graph_t::htransition_t htransition_t;
    typedef typename graph_t::hstate_t hstate_t;
    typedef typename graph_t::label_t label_t;
    typedef typename graph_t::semiring_elt_value_t semiring_elt_value_t;

57
    RDeltaTransitionIterator(const graph_t& graph,
Florent D'Halluin's avatar
Florent D'Halluin committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
			     hstate_t state);
    ~RDeltaTransitionIterator();

    void op_next();
    bool op_done() const;
    htransition_t op_operator_star() const;

    hstate_t op_src() const;
    hstate_t op_dst() const;
    semiring_elt_value_t op_weight() const;
    label_t op_label() const;

  private:

    hstate_t state_;
    typename graph_t::rdelta_iterator i_;
  };

} // ! vcsn

# if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
#  include <vaucanson/automata/implementation/iterators/rdelta_transition_iterator.hxx>
# endif

Florent D'Halluin's avatar
Florent D'Halluin committed
82
#endif // ! VCSN_AUTOMATA_IMPLEMENTATION_ITERATORS_RDELTA_TRANSITION_ITERATOR_HH