twa: rename twa::succ_iterable into internal::twa_succ_iterable
* spot/twa/twa.hh: Here. * NEWS: Mention the change.
This commit is contained in:
parent
7534f62dba
commit
71e2490643
2 changed files with 54 additions and 43 deletions
4
NEWS
4
NEWS
|
|
@ -143,6 +143,10 @@ New in spot 2.0.3a (not yet released)
|
||||||
- {s[*0..j]}[]->b = {s[*1..j]}[]->b
|
- {s[*0..j]}[]->b = {s[*1..j]}[]->b
|
||||||
- {s[*0..j]}<>->b = {s[*1..j]}<>->b
|
- {s[*0..j]}<>->b = {s[*1..j]}<>->b
|
||||||
|
|
||||||
|
* spot::twa::succ_iterable renamed to
|
||||||
|
spot::internal::twa_succ_iterable to make it clear this is not for
|
||||||
|
public consumption.
|
||||||
|
|
||||||
Python:
|
Python:
|
||||||
|
|
||||||
* The __format__() method for formula supports the same
|
* The __format__() method for formula supports the same
|
||||||
|
|
|
||||||
|
|
@ -515,6 +515,43 @@ namespace spot
|
||||||
it_ = nullptr;
|
it_ = nullptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef SWIG
|
||||||
|
/// \brief Helper class to iterate over the successor of a state
|
||||||
|
/// using the on-the-fly interface
|
||||||
|
///
|
||||||
|
/// This one emulates an STL-like container with begin()/end()
|
||||||
|
/// methods so that it can be iterated using a ranged-for.
|
||||||
|
class twa_succ_iterable
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
const twa* aut_;
|
||||||
|
twa_succ_iterator* it_;
|
||||||
|
public:
|
||||||
|
twa_succ_iterable(const twa* aut, twa_succ_iterator* it)
|
||||||
|
: aut_(aut), it_(it)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
twa_succ_iterable(twa_succ_iterable&& other)
|
||||||
|
: aut_(other.aut_), it_(other.it_)
|
||||||
|
{
|
||||||
|
other.it_ = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
~twa_succ_iterable(); // Defined in this file after twa
|
||||||
|
|
||||||
|
internal::succ_iterator begin()
|
||||||
|
{
|
||||||
|
return it_->first() ? it_ : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal::succ_iterator end()
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif // SWIG
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \defgroup twa TωA (Transition-based ω-Automata)
|
/// \defgroup twa TωA (Transition-based ω-Automata)
|
||||||
|
|
@ -591,47 +628,6 @@ namespace spot
|
||||||
bdd_dict_ptr dict_;
|
bdd_dict_ptr dict_;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#ifndef SWIG
|
|
||||||
/// \brief Helper class to iterate over the successor of a state
|
|
||||||
/// using the on-the-fly interface
|
|
||||||
///
|
|
||||||
/// This one emulates an STL-like container with begin()/end()
|
|
||||||
/// methods so that it can be iterated using a ranged-for.
|
|
||||||
class succ_iterable
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
const twa* aut_;
|
|
||||||
twa_succ_iterator* it_;
|
|
||||||
public:
|
|
||||||
succ_iterable(const twa* aut, twa_succ_iterator* it)
|
|
||||||
: aut_(aut), it_(it)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
succ_iterable(succ_iterable&& other)
|
|
||||||
: aut_(other.aut_), it_(other.it_)
|
|
||||||
{
|
|
||||||
other.it_ = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
~succ_iterable()
|
|
||||||
{
|
|
||||||
if (it_)
|
|
||||||
aut_->release_iter(it_);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal::succ_iterator begin()
|
|
||||||
{
|
|
||||||
return it_->first() ? it_ : nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal::succ_iterator end()
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
virtual ~twa();
|
virtual ~twa();
|
||||||
|
|
||||||
/// \brief Get the initial state of the automaton.
|
/// \brief Get the initial state of the automaton.
|
||||||
|
|
@ -675,7 +671,7 @@ namespace spot
|
||||||
/// while (i->next());
|
/// while (i->next());
|
||||||
/// aut->release_iter(i);
|
/// aut->release_iter(i);
|
||||||
/// \endcode
|
/// \endcode
|
||||||
succ_iterable
|
internal::twa_succ_iterable
|
||||||
succ(const state* s) const
|
succ(const state* s) const
|
||||||
{
|
{
|
||||||
return {this, succ_iter(s)};
|
return {this, succ_iter(s)};
|
||||||
|
|
@ -1401,6 +1397,17 @@ namespace spot
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef SWIG
|
||||||
|
namespace internal
|
||||||
|
{
|
||||||
|
inline twa_succ_iterable::~twa_succ_iterable()
|
||||||
|
{
|
||||||
|
if (it_)
|
||||||
|
aut_->release_iter(it_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // SWIG
|
||||||
|
|
||||||
/// \addtogroup twa_representation TωA representations
|
/// \addtogroup twa_representation TωA representations
|
||||||
/// \ingroup twa
|
/// \ingroup twa
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue