daemon: mark some classes and methods 'final'
As suggested by gcc's -Wsuggest-final-types and -Wsuggest-final-methods
Change-Id: I1622857ee53581efd0c6ce3fe93199c72202d817
diff --git a/daemon/table/cs-policy-lru.hpp b/daemon/table/cs-policy-lru.hpp
index 017de7e..5d61e47 100644
--- a/daemon/table/cs-policy-lru.hpp
+++ b/daemon/table/cs-policy-lru.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -46,7 +46,7 @@
/** \brief Least-Recently-Used (LRU) replacement policy
*/
-class LruPolicy : public Policy
+class LruPolicy final : public Policy
{
public:
LruPolicy();
@@ -56,19 +56,19 @@
private:
void
- doAfterInsert(EntryRef i) override;
+ doAfterInsert(EntryRef i) final;
void
- doAfterRefresh(EntryRef i) override;
+ doAfterRefresh(EntryRef i) final;
void
- doBeforeErase(EntryRef i) override;
+ doBeforeErase(EntryRef i) final;
void
- doBeforeUse(EntryRef i) override;
+ doBeforeUse(EntryRef i) final;
void
- evictEntries() override;
+ evictEntries() final;
private:
/** \brief moves an entry to the end of queue
diff --git a/daemon/table/cs-policy-priority-fifo.hpp b/daemon/table/cs-policy-priority-fifo.hpp
index 9671408..757b0c5 100644
--- a/daemon/table/cs-policy-priority-fifo.hpp
+++ b/daemon/table/cs-policy-priority-fifo.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -62,31 +62,31 @@
* Eviction procedure exhausts the first queue before moving onto the next queue,
* in the order of unsolicited, stale, and fresh queue.
*/
-class PriorityFifoPolicy : public Policy
+class PriorityFifoPolicy final : public Policy
{
public:
PriorityFifoPolicy();
- ~PriorityFifoPolicy() override;
+ ~PriorityFifoPolicy() final;
public:
static const std::string POLICY_NAME;
private:
void
- doAfterInsert(EntryRef i) override;
+ doAfterInsert(EntryRef i) final;
void
- doAfterRefresh(EntryRef i) override;
+ doAfterRefresh(EntryRef i) final;
void
- doBeforeErase(EntryRef i) override;
+ doBeforeErase(EntryRef i) final;
void
- doBeforeUse(EntryRef i) override;
+ doBeforeUse(EntryRef i) final;
void
- evictEntries() override;
+ evictEntries() final;
private:
/** \brief evicts one entry
diff --git a/daemon/table/name-tree-iterator.hpp b/daemon/table/name-tree-iterator.hpp
index 973c961..d99e5f9 100644
--- a/daemon/table/name-tree-iterator.hpp
+++ b/daemon/table/name-tree-iterator.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -158,13 +158,13 @@
/** \brief full enumeration implementation
*/
-class FullEnumerationImpl : public EnumerationImpl
+class FullEnumerationImpl final : public EnumerationImpl
{
public:
FullEnumerationImpl(const NameTree& nt, const EntrySelector& pred);
void
- advance(Iterator& i) override;
+ advance(Iterator& i) final;
private:
EntrySelector m_pred;
@@ -175,13 +175,13 @@
* Iterator::m_ref should be initialized to subtree root.
* Iterator::m_state LSB indicates whether to visit children of m_entry.
*/
-class PartialEnumerationImpl : public EnumerationImpl
+class PartialEnumerationImpl final : public EnumerationImpl
{
public:
PartialEnumerationImpl(const NameTree& nt, const EntrySubTreeSelector& pred);
void
- advance(Iterator& i) override;
+ advance(Iterator& i) final;
private:
EntrySubTreeSelector m_pred;
@@ -191,14 +191,14 @@
*
* Iterator::m_ref should be initialized to longest prefix matched entry.
*/
-class PrefixMatchImpl : public EnumerationImpl
+class PrefixMatchImpl final : public EnumerationImpl
{
public:
PrefixMatchImpl(const NameTree& nt, const EntrySelector& pred);
private:
void
- advance(Iterator& i) override;
+ advance(Iterator& i) final;
private:
EntrySelector m_pred;