use more override and final keywords

This patch is mostly focused on tagging most virtual methods that
override as such.  I found a few methods that where not meant to be
virtual this way, and tagged a few classes "final" along the way.

* bin/common_output.cc, spot/kripke/fairkripke.hh,
spot/kripke/kripke.hh, spot/kripke/kripkegraph.hh,
spot/ltsmin/ltsmin.cc, spot/misc/formater.hh, spot/priv/bddalloc.hh,
spot/ta/ta.hh, spot/ta/taexplicit.hh, spot/ta/taproduct.hh,
spot/ta/tgta.hh, spot/ta/tgtaexplicit.cc, spot/ta/tgtaexplicit.hh,
spot/ta/tgtaproduct.hh, spot/taalgos/emptinessta.hh, spot/tl/declenv.hh,
spot/tl/defaultenv.hh, spot/tl/randomltl.hh, spot/tl/relabel.cc,
spot/twa/bdddict.cc, spot/twa/taatgba.hh, spot/twa/twagraph.hh,
spot/twa/twaproduct.hh, spot/twaalgos/gtec/ce.cc,
spot/twaalgos/gtec/ce.hh, spot/twaalgos/gtec/gtec.hh,
spot/twaalgos/gv04.cc, spot/twaalgos/ltl2taa.cc, spot/twaalgos/magic.cc,
spot/twaalgos/minimize.cc, spot/twaalgos/ndfs_result.hxx,
spot/twaalgos/reachiter.hh, spot/twaalgos/se05.cc,
spot/twaalgos/stutter.cc, spot/twaalgos/tau03.cc: Add more override and
final keywords.
This commit is contained in:
Alexandre Duret-Lutz 2016-02-15 22:43:23 +01:00
parent 1ae0600cae
commit 5d272fd256
35 changed files with 249 additions and 291 deletions

View file

@ -201,20 +201,10 @@ namespace spot
~ta_succ_iterator()
{
}
virtual bool first() = 0;
virtual bool next() = 0;
virtual bool done() const = 0;
virtual const state* dst() const = 0;
/// \brief Get the changeset on the transition leading to current successor.
///
/// This is a boolean function of atomic propositions.
virtual bdd cond() const = 0;
acc_cond::mark_t acc() const = 0;
};
#ifndef SWIG

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire de
// Recherche et Développement de l'Epita (LRDE).
// Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 Laboratoire
// de Recherche et Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -64,38 +64,35 @@ namespace spot
// ta interface
virtual
~ta_explicit();
virtual const_states_set_t
get_initial_states_set() const;
virtual const_states_set_t get_initial_states_set() const override;
virtual ta_succ_iterator* succ_iter(const spot::state* s) const override;
virtual ta_succ_iterator*
succ_iter(const spot::state* s) const;
succ_iter(const spot::state* s, bdd condition) const override;
virtual ta_succ_iterator*
succ_iter(const spot::state* s, bdd condition) const;
virtual bdd_dict_ptr
get_dict() const;
bdd_dict_ptr get_dict() const;
virtual std::string
format_state(const spot::state* s) const;
format_state(const spot::state* s) const override;
virtual bool
is_accepting_state(const spot::state* s) const;
is_accepting_state(const spot::state* s) const override;
virtual bool
is_livelock_accepting_state(const spot::state* s) const;
is_livelock_accepting_state(const spot::state* s) const override;
virtual bool
is_initial_state(const spot::state* s) const;
is_initial_state(const spot::state* s) const override;
virtual bdd
get_state_condition(const spot::state* s) const;
get_state_condition(const spot::state* s) const override;
virtual void
free_state(const spot::state* s) const;
free_state(const spot::state* s) const override;
spot::state*
get_artificial_initial_state() const
virtual spot::state*
get_artificial_initial_state() const override
{
return (spot::state*) artificial_initial_state_;
}
@ -107,7 +104,7 @@ namespace spot
}
virtual void
void
delete_stuttering_and_hole_successors(const spot::state* s);
ta::states_set_t
@ -129,7 +126,7 @@ namespace spot
/// states used by spot::ta_explicit.
/// \ingroup ta_representation
class SPOT_API state_ta_explicit : public spot::state
class SPOT_API state_ta_explicit final: public spot::state
{
#ifndef SWIG
public:
@ -156,15 +153,11 @@ namespace spot
{
}
virtual int
compare(const spot::state* other) const;
virtual size_t
hash() const;
virtual state_ta_explicit*
clone() const;
virtual int compare(const spot::state* other) const override;
virtual size_t hash() const override;
virtual state_ta_explicit* clone() const override;
virtual void
destroy() const
virtual void destroy() const override
{
}
@ -227,21 +220,21 @@ namespace spot
};
/// Successor iterators used by spot::ta_explicit.
class SPOT_API ta_explicit_succ_iterator : public ta_succ_iterator
class SPOT_API ta_explicit_succ_iterator final: public ta_succ_iterator
{
public:
ta_explicit_succ_iterator(const state_ta_explicit* s);
ta_explicit_succ_iterator(const state_ta_explicit* s, bdd condition);
virtual bool first();
virtual bool next();
virtual bool done() const;
virtual bool first() override;
virtual bool next() override;
virtual bool done() const override;
virtual const state* dst() const;
virtual bdd cond() const;
virtual const state* dst() const override;
virtual bdd cond() const override;
virtual acc_cond::mark_t acc() const;
virtual acc_cond::mark_t acc() const override;
private:
state_ta_explicit::transitions* transitions_;

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2011, 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2011, 2012, 2013, 2014, 2016 Laboratoire de Recherche
// et Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -60,11 +60,11 @@ namespace spot
}
virtual int
compare(const state* other) const;
compare(const state* other) const override;
virtual size_t
hash() const;
hash() const override;
virtual state_ta_product*
clone() const;
clone() const override;
private:
const state* ta_state_; ///< State from the ta automaton.
@ -82,22 +82,17 @@ namespace spot
~ta_succ_iterator_product();
// iteration
bool first();
bool next();
bool done() const;
virtual bool first() override;
virtual bool next() override;
virtual bool done() const override;
// inspection
state_ta_product*
dst() const;
bdd
cond() const;
acc_cond::mark_t
acc() const;
virtual state_ta_product* dst() const override;
virtual bdd cond() const override;
virtual acc_cond::mark_t acc() const override;
/// \brief Return true if the changeset of the current transition is empty
bool
is_stuttering_transition() const;
bool is_stuttering_transition() const;
protected:
//@{
@ -129,7 +124,7 @@ namespace spot
/// \ingroup ta_emptiness_check
/// \brief A lazy product between a Testing automaton and a Kripke structure.
/// (States are computed on the fly.)
class SPOT_API ta_product: public ta
class SPOT_API ta_product final: public ta
{
public:
/// \brief Constructor.
@ -142,39 +137,39 @@ namespace spot
~ta_product();
virtual ta::const_states_set_t
get_initial_states_set() const;
get_initial_states_set() const override;
virtual ta_succ_iterator_product*
succ_iter(const spot::state* s) const;
succ_iter(const spot::state* s) const override;
virtual ta_succ_iterator_product*
succ_iter(const spot::state* s, bdd changeset) const;
succ_iter(const spot::state* s, bdd changeset) const override;
virtual bdd_dict_ptr
bdd_dict_ptr
get_dict() const;
virtual std::string
format_state(const spot::state* s) const;
format_state(const spot::state* s) const override;
virtual bool
is_accepting_state(const spot::state* s) const;
is_accepting_state(const spot::state* s) const override;
virtual bool
is_livelock_accepting_state(const spot::state* s) const;
is_livelock_accepting_state(const spot::state* s) const override;
virtual bool
is_initial_state(const spot::state* s) const;
is_initial_state(const spot::state* s) const override;
/// \brief Return true if the state \a s has no succeseurs
/// in the TA automaton (the TA component of the product automaton)
virtual bool
bool
is_hole_state_in_ta_component(const spot::state* s) const;
virtual bdd
get_state_condition(const spot::state* s) const;
get_state_condition(const spot::state* s) const override;
virtual void
free_state(const spot::state* s) const;
free_state(const spot::state* s) const override;
const const_ta_ptr&
get_ta() const

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire de
// Recherche et Développement de l'Epita (LRDE).
// Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 Laboratoire
// de Recherche et Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -79,7 +79,7 @@ namespace spot
/// longer needed.
///
virtual twa_succ_iterator*
succ_iter_by_changeset(const spot::state* s, bdd change_set) const =0;
succ_iter_by_changeset(const spot::state* s, bdd change_set) const = 0;
};
typedef std::shared_ptr<tgta> tgta_ptr;

View file

@ -44,12 +44,6 @@ namespace spot
return ta_->succ_iter(state);
}
bdd_dict_ptr
tgta_explicit::get_dict() const
{
return ta_->get_dict();
}
std::string
tgta_explicit::format_state(const spot::state* s) const
{

View file

@ -34,7 +34,7 @@ namespace spot
/// Explicit representation of a spot::tgta.
/// \ingroup ta_representation
class SPOT_API tgta_explicit : public tgta
class SPOT_API tgta_explicit final : public tgta
{
public:
tgta_explicit(const const_twa_ptr& tgba,
@ -42,21 +42,18 @@ namespace spot
state_ta_explicit* artificial_initial_state);
// tgba interface
virtual spot::state* get_init_state() const;
virtual spot::state* get_init_state() const override;
virtual twa_succ_iterator*
succ_iter(const spot::state* local_state) const;
virtual bdd_dict_ptr
get_dict() const;
succ_iter(const spot::state* local_state) const override;
const_ta_explicit_ptr get_ta() const { return ta_; }
ta_explicit_ptr get_ta() { return ta_; }
virtual std::string format_state(const spot::state* s) const;
virtual std::string format_state(const spot::state* s) const override;
virtual twa_succ_iterator*
succ_iter_by_changeset(const spot::state* s, bdd change_set) const;
succ_iter_by_changeset(const spot::state* s, bdd change_set) const override;
protected:
ta_explicit_ptr ta_;
};

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2011, 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2011, 2012, 2013, 2014, 2016 Laboratoire de Recherche
// et Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -35,10 +35,10 @@ namespace spot
tgta_product(const const_kripke_ptr& left,
const const_tgta_ptr& right);
virtual const state* get_init_state() const;
virtual const state* get_init_state() const override;
virtual twa_succ_iterator*
succ_iter(const state* local_state) const;
succ_iter(const state* local_state) const override;
};
inline twa_ptr product(const const_kripke_ptr& left,
@ -48,7 +48,7 @@ namespace spot
}
/// \brief Iterate over the successors of a product computed on the fly.
class SPOT_API tgta_succ_iterator_product : public twa_succ_iterator
class SPOT_API tgta_succ_iterator_product final : public twa_succ_iterator
{
public:
tgta_succ_iterator_product(const state_product* s,