Introduct a down_cast macro.
* src/misc/casts.hh: New file. * src/misc/Makefile.am: Add it. * iface/dve2/dve2.cc, iface/gspn/gspn.cc, iface/gspn/ssp.cc, src/evtgba/explicit.cc, src/evtgba/product.cc, src/misc/casts.hh, src/tgba/state.hh, src/tgba/statebdd.cc, src/tgba/taatgba.cc, src/tgba/taatgba.hh, src/tgba/tgbabddconcrete.cc, src/tgba/tgbaexplicit.cc, src/tgba/tgbaexplicit.hh, src/tgba/tgbakvcomplement.cc, src/tgba/tgbaproduct.cc, src/tgba/tgbasafracomplement.cc, src/tgba/tgbasgba.cc, src/tgba/tgbatba.cc, src/tgba/tgbaunion.cc, src/tgba/wdbacomp.cc, src/tgbaalgos/ndfs_result.hxx, src/tgbaalgos/reductgba_sim.cc, src/tgbaalgos/reductgba_sim_del.cc: Use down_cast when appropriate.
This commit is contained in:
parent
12783ff784
commit
9f63bb6637
25 changed files with 193 additions and 124 deletions
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (C) 2011 Laboratoire de Recherche et Développement de
|
||||
// l'Epita (LRDE)
|
||||
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
// et Marie Curie.
|
||||
|
|
@ -35,7 +37,7 @@ namespace spot
|
|||
state_evtgba_explicit::compare(const spot::state* other) const
|
||||
{
|
||||
const state_evtgba_explicit* o =
|
||||
dynamic_cast<const state_evtgba_explicit*>(other);
|
||||
down_cast<const state_evtgba_explicit*>(other);
|
||||
assert(o);
|
||||
return o->get_state() - get_state();
|
||||
}
|
||||
|
|
@ -179,7 +181,7 @@ namespace spot
|
|||
evtgba_explicit::succ_iter(const spot::state* s) const
|
||||
{
|
||||
const state_evtgba_explicit* u =
|
||||
dynamic_cast<const state_evtgba_explicit*>(s);
|
||||
down_cast<const state_evtgba_explicit*>(s);
|
||||
assert(u);
|
||||
return new evtgba_explicit_iterator_fw(&u->get_state()->out);
|
||||
}
|
||||
|
|
@ -188,7 +190,7 @@ namespace spot
|
|||
evtgba_explicit::pred_iter(const spot::state* s) const
|
||||
{
|
||||
const state_evtgba_explicit* u =
|
||||
dynamic_cast<const state_evtgba_explicit*>(s);
|
||||
down_cast<const state_evtgba_explicit*>(s);
|
||||
assert(u);
|
||||
return new evtgba_explicit_iterator_fw(&u->get_state()->in);
|
||||
}
|
||||
|
|
@ -197,7 +199,7 @@ namespace spot
|
|||
evtgba_explicit::format_state(const spot::state* s) const
|
||||
{
|
||||
const state_evtgba_explicit* u =
|
||||
dynamic_cast<const state_evtgba_explicit*>(s);
|
||||
down_cast<const state_evtgba_explicit*>(s);
|
||||
assert(u);
|
||||
sn_map::const_iterator i = state_name_map_.find(u->get_state());
|
||||
assert(i != state_name_map_.end());
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (C) 2011 Laboratoire de Recherche et Développement de
|
||||
// l'Epita (LRDE)
|
||||
// Copyright (C) 2008, 2011 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
|
|
@ -64,7 +66,7 @@ namespace spot
|
|||
compare(const state* other) const
|
||||
{
|
||||
const evtgba_product_state* s =
|
||||
dynamic_cast<const evtgba_product_state*>(other);
|
||||
down_cast<const evtgba_product_state*>(other);
|
||||
assert(s);
|
||||
assert(s->n_ == n_);
|
||||
for (int i = 0; i < n_; ++i)
|
||||
|
|
@ -404,7 +406,7 @@ namespace spot
|
|||
evtgba_product::succ_iter(const state* st) const
|
||||
{
|
||||
const evtgba_product_state* s =
|
||||
dynamic_cast<const evtgba_product_state*>(st);
|
||||
down_cast<const evtgba_product_state*>(st);
|
||||
assert(s);
|
||||
|
||||
int n = op_.size();
|
||||
|
|
@ -420,7 +422,7 @@ namespace spot
|
|||
evtgba_product::pred_iter(const state* st) const
|
||||
{
|
||||
const evtgba_product_state* s =
|
||||
dynamic_cast<const evtgba_product_state*>(st);
|
||||
down_cast<const evtgba_product_state*>(st);
|
||||
assert(s);
|
||||
|
||||
int n = op_.size();
|
||||
|
|
@ -436,7 +438,7 @@ namespace spot
|
|||
evtgba_product::format_state(const state* st) const
|
||||
{
|
||||
const evtgba_product_state* s =
|
||||
dynamic_cast<const evtgba_product_state*>(st);
|
||||
down_cast<const evtgba_product_state*>(st);
|
||||
int n = op_.size();
|
||||
std::string res = "<" + op_[0]->format_state(s->nth(0));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue