ltl: get rid of ltl::ref_formula
Instead, manage all reference counting from ltl::formula. It ridance of virtual calls to clone() and destroy() easily compensate the extra test in destroy() to not delete constant nodes. * src/ltlast/refformula.cc, src/ltlast/refformula.hh: Delete. * src/ltlast/Makefile.am, wrap/python/spot.i: Adjust. * src/ltlast/atomic_prop.cc, src/ltlast/atomic_prop.hh, src/ltlast/binop.cc, src/ltlast/binop.hh, src/ltlast/bunop.cc, src/ltlast/bunop.hh, src/ltlast/formula.cc, src/ltlast/formula.hh, src/ltlast/multop.cc, src/ltlast/multop.hh, src/ltlast/unop.cc, src/ltlast/unop.hh: Ajust the reference counting code.
This commit is contained in:
parent
d79da2e941
commit
8d947a8782
16 changed files with 70 additions and 210 deletions
|
|
@ -35,38 +35,6 @@ namespace spot
|
|||
{
|
||||
size_t formula::max_serial = 0;
|
||||
|
||||
const formula*
|
||||
formula::clone() const
|
||||
{
|
||||
this->ref_();
|
||||
return this;
|
||||
}
|
||||
|
||||
formula::~formula()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
formula::destroy() const
|
||||
{
|
||||
if (this->unref_())
|
||||
delete this;
|
||||
}
|
||||
|
||||
void
|
||||
formula::ref_() const
|
||||
{
|
||||
// Not reference counted by default.
|
||||
}
|
||||
|
||||
bool
|
||||
formula::unref_() const
|
||||
{
|
||||
// Not reference counted by default.
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#define printprops \
|
||||
proprint(is_boolean, "B", "Boolean formula"); \
|
||||
proprint(is_sugar_free_boolean, "&", "without Boolean sugar"); \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue