Commit 738fd94d authored by Florent D'Halluin's avatar Florent D'Halluin
Browse files

Small fixes in IteratorBase and DeltaTransitionIterator.

* include/vaucanson/automata/implementation/iterators/transition_iterator_base.hxx:
Fix constness in next().
* include/vaucanson/automata/implementation/iterators/delta_transition_iterator.hh,
* include/vaucanson/automata/implementation/iterators/delta_transition_iterator.hxx:
Add typedef to simplify type names.
Add default return value in op_weight().
parent b14c66ad
2009-09-16 d-halluin <d-halluin@lrde.epita.fr>
Small fixes in IteratorBase and DeltaTransitionIterator.
* include/vaucanson/automata/implementation/iterators/transition_iterator_base.hxx:
Fix constness in next().
* include/vaucanson/automata/implementation/iterators/delta_transition_iterator.hh,
* include/vaucanson/automata/implementation/iterators/delta_transition_iterator.hxx:
Add typedef to simplify type names.
Add default return value in op_weight().
2009-09-16 d-halluin <d-halluin@lrde.epita.fr>
 
Fix TransitionIteratorBase and DeltaTransitionIterator.
......
......@@ -49,22 +49,28 @@ namespace vcsn
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;
DeltaTransitionIterator(graph_t graph,
typename graph_t::hstate_t state);
~DeltaTransitionIterator();
void op_next();
bool op_done();
typename graph_t::htransition_t op_operator_star() const;
bool op_done() const;
htransition_t op_operator_star() const;
typename graph_t::hstate_t op_src() const;
typename graph_t::hstate_t op_dst() const;
typename graph_t::semiring_elt_value_t op_weight() const;
typename graph_t::label_t op_label() const;
hstate_t op_src() const;
hstate_t op_dst() const;
semiring_elt_value_t op_weight() const;
label_t op_label() const;
private:
typename graph_t::hstate_t state_;
hstate_t state_;
typename graph_t::delta_iterator i_;
};
......
......@@ -25,7 +25,7 @@ namespace vcsn
template <typename T>
DeltaTransitionIterator<T>::DeltaTransitionIterator
(graph_t graph,
typename graph_t::hstate_t state)
hstate_t state)
: TransitionIteratorBase<self_t>(graph),
state_(state),
i_(graph, state)
......@@ -37,7 +37,7 @@ namespace vcsn
{}
template <typename T>
typename DeltaTransitionIterator<T>::graph_t::hstate_t
typename DeltaTransitionIterator<T>::hstate_t
DeltaTransitionIterator<T>::op_src() const
{
// this-> seems to be necessary here.
......@@ -45,21 +45,22 @@ namespace vcsn
}
template <typename T>
typename DeltaTransitionIterator<T>::graph_t::hstate_t
typename DeltaTransitionIterator<T>::hstate_t
DeltaTransitionIterator<T>::op_dst() const
{
return this->graph_.dst_of(*i_);
}
template <typename T>
typename DeltaTransitionIterator<T>::graph_t::semiring_elt_value_t
typename DeltaTransitionIterator<T>::semiring_elt_value_t
DeltaTransitionIterator<T>::op_weight() const
{
// FIXME: Extract weight from graph::label_t.
return semiring_elt_value_t();
}
template <typename T>
typename DeltaTransitionIterator<T>::graph_t::label_t
typename DeltaTransitionIterator<T>::label_t
DeltaTransitionIterator<T>::op_label() const
{
// Note: Should not include the weight.
......@@ -75,13 +76,13 @@ namespace vcsn
template <typename T>
bool
DeltaTransitionIterator<T>::op_done()
DeltaTransitionIterator<T>::op_done() const
{
return i_.done();
}
template <typename T>
typename DeltaTransitionIterator<T>::graph_t::htransition_t
typename DeltaTransitionIterator<T>::htransition_t
DeltaTransitionIterator<T>::op_operator_star() const
{
return *i_;
......
......@@ -35,7 +35,7 @@ namespace vcsn
void
IteratorBase<S>::next()
{
return static_cast<const S*>(this)->op_next();
return static_cast<S*>(this)->op_next();
}
template <typename S>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment