tgba_succ_iterator: have first() and next() return a bool

The returned Boolean indicates whether there is a successor or not.
This way

|  for (i->first(); !i->done(); i->next())
|    {
|       ...
|    }

can be replaced by

| if (i->first()) do
|   {
|      ...
|   }
| while (i->next());

avoiding all the virtual calls to done().

* iface/dve2/dve2.cc, src/kripke/kripkeexplicit.cc,
src/kripke/kripkeexplicit.hh, src/ta/ta.hh, src/ta/taexplicit.cc,
src/ta/taexplicit.hh, src/ta/taproduct.cc, src/ta/taproduct.hh,
src/ta/tgtaproduct.cc, src/ta/tgtaproduct.hh, src/tgba/succiter.hh,
src/tgba/succiterconcrete.cc, src/tgba/succiterconcrete.hh,
src/tgba/taatgba.cc, src/tgba/taatgba.hh, src/tgba/tgba.hh,
src/tgba/tgbaexplicit.hh, src/tgba/tgbakvcomplement.cc,
src/tgba/tgbamask.cc, src/tgba/tgbaproduct.cc,
src/tgba/tgbasafracomplement.cc, src/tgba/tgbasgba.cc,
src/tgba/tgbatba.cc, src/tgba/tgbaunion.cc, src/tgba/tgbaunion.hh,
src/tgba/wdbacomp.cc: Implement and adjust to this new interface.
This commit is contained in:
Alexandre Duret-Lutz 2014-01-26 22:57:14 +01:00
parent 06c69f88ff
commit 1a5c0cb1f3
26 changed files with 256 additions and 206 deletions

View file

@ -272,15 +272,17 @@ namespace spot
}
virtual
void first()
bool first()
{
it_ = cc_->transitions.begin();
return it_ != cc_->transitions.end();
}
virtual
void next()
bool next()
{
++it_;
return it_ != cc_->transitions.end();
}
virtual