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

@ -54,8 +54,8 @@ namespace spot
fair_kripke_succ_iterator(const bdd& cond, acc_cond::mark_t acc_cond);
virtual ~fair_kripke_succ_iterator();
virtual bdd cond() const;
virtual acc_cond::mark_t acc() const;
virtual bdd cond() const override;
virtual acc_cond::mark_t acc() const override;
protected:
bdd cond_;
acc_cond::mark_t acc_cond_;

View file

@ -59,8 +59,8 @@ namespace spot
virtual ~kripke_succ_iterator();
virtual bdd cond() const;
virtual acc_cond::mark_t acc() const;
virtual bdd cond() const override;
virtual acc_cond::mark_t acc() const override;
protected:
bdd cond_;
};

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2011, 2012, 2013, 2014, 2015 Laboratoire de Recherche
// et Développement de l'Epita (LRDE)
// Copyright (C) 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.
//
@ -39,7 +39,7 @@ namespace spot
{
}
virtual int compare(const spot::state* other) const
virtual int compare(const spot::state* other) const override
{
auto o = down_cast<const kripke_graph_state*>(other);
assert(o);
@ -52,19 +52,19 @@ namespace spot
return 0;
}
virtual size_t hash() const
virtual size_t hash() const override
{
return
reinterpret_cast<const char*>(this) - static_cast<const char*>(nullptr);
}
virtual kripke_graph_state*
clone() const
clone() const override
{
return const_cast<kripke_graph_state*>(this);
}
virtual void destroy() const
virtual void destroy() const override
{
}
@ -104,30 +104,30 @@ namespace spot
{
}
virtual void recycle(const typename Graph::state_storage_t* s)
void recycle(const typename Graph::state_storage_t* s)
{
cond_ = s->cond();
t_ = s->succ;
}
virtual bool first()
virtual bool first() override
{
p_ = t_;
return p_;
}
virtual bool next()
virtual bool next() override
{
p_ = g_->edge_storage(p_).next_succ;
return p_;
}
virtual bool done() const
virtual bool done() const override
{
return !p_;
}
virtual kripke_graph_state* dst() const
virtual kripke_graph_state* dst() const override
{
assert(!done());
return const_cast<kripke_graph_state*>
@ -138,7 +138,7 @@ namespace spot
/// \class kripke_graph
/// \brief Kripke Structure.
class SPOT_API kripke_graph : public kripke
class SPOT_API kripke_graph final : public kripke
{
public:
typedef digraph<kripke_graph_state, void> graph_t;
@ -180,7 +180,7 @@ namespace spot
return init_number_;
}
virtual const kripke_graph_state* get_init_state() const
virtual const kripke_graph_state* get_init_state() const override
{
if (num_states() == 0)
const_cast<graph_t&>(g_).new_state();
@ -190,7 +190,7 @@ namespace spot
/// \brief Allow to get an iterator on the state we passed in
/// parameter.
virtual kripke_graph_succ_iterator<graph_t>*
succ_iter(const spot::state* st) const
succ_iter(const spot::state* st) const override
{
auto s = down_cast<const typename graph_t::state_storage_t*>(st);
assert(s);
@ -235,13 +235,13 @@ namespace spot
return ss.str();
}
virtual std::string format_state(const state* st) const
virtual std::string format_state(const state* st) const override
{
return format_state(state_number(st));
}
/// \brief Get the condition on the state
virtual bdd state_condition(const state* s) const
virtual bdd state_condition(const state* s) const override
{
return down_cast<const kripke_graph_state*>(s)->cond();
}