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/face/ethernet-channel.hpp b/daemon/face/ethernet-channel.hpp
index 36d32be..7e7fa87 100644
--- a/daemon/face/ethernet-channel.hpp
+++ b/daemon/face/ethernet-channel.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,
@@ -29,6 +29,7 @@
#include "channel.hpp"
#include "ethernet-protocol.hpp"
#include "pcap-helper.hpp"
+
#include <ndn-cxx/net/network-interface.hpp>
namespace nfd {
@@ -37,7 +38,7 @@
/**
* \brief Class implementing Ethernet-based channel to create faces
*/
-class EthernetChannel : public Channel
+class EthernetChannel final : public Channel
{
public:
/**
@@ -63,13 +64,13 @@
time::nanoseconds idleTimeout);
bool
- isListening() const override
+ isListening() const final
{
return m_isListening;
}
size_t
- size() const override
+ size() const final
{
return m_channelFaces.size();
}
diff --git a/daemon/face/ethernet-factory.hpp b/daemon/face/ethernet-factory.hpp
index 9b25b3c..578a901 100644
--- a/daemon/face/ethernet-factory.hpp
+++ b/daemon/face/ethernet-factory.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,
@@ -34,7 +34,7 @@
/** \brief Protocol factory for Ethernet
*/
-class EthernetFactory : public ProtocolFactory
+class EthernetFactory final : public ProtocolFactory
{
public:
static const std::string&
@@ -77,15 +77,15 @@
*/
void
doProcessConfig(OptionalConfigSection configSection,
- FaceSystem::ConfigContext& context) override;
+ FaceSystem::ConfigContext& context) final;
void
doCreateFace(const CreateFaceRequest& req,
const FaceCreatedCallback& onCreated,
- const FaceCreationFailedCallback& onFailure) override;
+ const FaceCreationFailedCallback& onFailure) final;
std::vector<shared_ptr<const Channel>>
- doGetChannels() const override;
+ doGetChannels() const final;
/** \brief Create EthernetChannel on \p netif if requested by \p m_unicastConfig.
* \return new or existing channel, or nullptr if no channel should be created
diff --git a/daemon/face/tcp-channel.hpp b/daemon/face/tcp-channel.hpp
index cb41b2c..788fdc1 100644
--- a/daemon/face/tcp-channel.hpp
+++ b/daemon/face/tcp-channel.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 @@
* connections (TcpChannel::listen needs to be called for that
* to work) or explicitly after using TcpChannel::connect method.
*/
-class TcpChannel : public Channel
+class TcpChannel final : public Channel
{
public:
/**
@@ -59,13 +59,13 @@
DetermineFaceScopeFromAddress determineFaceScope);
bool
- isListening() const override
+ isListening() const final
{
return m_acceptor.is_open();
}
size_t
- size() const override
+ size() const final
{
return m_channelFaces.size();
}
diff --git a/daemon/face/tcp-factory.hpp b/daemon/face/tcp-factory.hpp
index 519d2dc..212acbb 100644
--- a/daemon/face/tcp-factory.hpp
+++ b/daemon/face/tcp-factory.hpp
@@ -34,7 +34,7 @@
/** \brief Protocol factory for TCP over IPv4 and IPv6
*/
-class TcpFactory : public ProtocolFactory
+class TcpFactory final : public ProtocolFactory
{
public:
static const std::string&
@@ -61,15 +61,15 @@
*/
void
doProcessConfig(OptionalConfigSection configSection,
- FaceSystem::ConfigContext& context) override;
+ FaceSystem::ConfigContext& context) final;
void
doCreateFace(const CreateFaceRequest& req,
const FaceCreatedCallback& onCreated,
- const FaceCreationFailedCallback& onFailure) override;
+ const FaceCreationFailedCallback& onFailure) final;
std::vector<shared_ptr<const Channel>>
- doGetChannels() const override;
+ doGetChannels() const final;
ndn::nfd::FaceScope
determineFaceScopeFromAddresses(const boost::asio::ip::address& local,
diff --git a/daemon/face/udp-channel.hpp b/daemon/face/udp-channel.hpp
index c3f696d..25e735a 100644
--- a/daemon/face/udp-channel.hpp
+++ b/daemon/face/udp-channel.hpp
@@ -37,7 +37,7 @@
/**
* \brief Class implementing UDP-based channel to create faces
*/
-class UdpChannel : public Channel
+class UdpChannel final : public Channel
{
public:
/**
@@ -53,13 +53,13 @@
size_t defaultMtu);
bool
- isListening() const override
+ isListening() const final
{
return m_socket.is_open();
}
size_t
- size() const override
+ size() const final
{
return m_channelFaces.size();
}
diff --git a/daemon/face/udp-factory.hpp b/daemon/face/udp-factory.hpp
index a0f5b6d..28dbfaa 100644
--- a/daemon/face/udp-factory.hpp
+++ b/daemon/face/udp-factory.hpp
@@ -34,7 +34,7 @@
/** \brief Protocol factory for UDP over IPv4 and IPv6
*/
-class UdpFactory : public ProtocolFactory
+class UdpFactory final : public ProtocolFactory
{
public:
class Error : public ProtocolFactory::Error
@@ -100,15 +100,15 @@
*/
void
doProcessConfig(OptionalConfigSection configSection,
- FaceSystem::ConfigContext& context) override;
+ FaceSystem::ConfigContext& context) final;
void
doCreateFace(const CreateFaceRequest& req,
const FaceCreatedCallback& onCreated,
- const FaceCreationFailedCallback& onFailure) override;
+ const FaceCreationFailedCallback& onFailure) final;
std::vector<shared_ptr<const Channel>>
- doGetChannels() const override;
+ doGetChannels() const final;
/** \brief Create UDP multicast faces on \p netif if needed by \p m_mcastConfig
* \return list of faces (just created or already existing) on \p netif
diff --git a/daemon/face/unix-stream-channel.hpp b/daemon/face/unix-stream-channel.hpp
index 6a49667..1faffa8 100644
--- a/daemon/face/unix-stream-channel.hpp
+++ b/daemon/face/unix-stream-channel.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,
@@ -42,7 +42,7 @@
* Channel can create faces as a response to incoming IPC connections
* (UnixStreamChannel::listen needs to be called for that to work).
*/
-class UnixStreamChannel : public Channel
+class UnixStreamChannel final : public Channel
{
public:
/**
@@ -66,16 +66,16 @@
*/
UnixStreamChannel(const unix_stream::Endpoint& endpoint, bool wantCongestionMarking);
- ~UnixStreamChannel() override;
+ ~UnixStreamChannel() final;
bool
- isListening() const override
+ isListening() const final
{
return m_acceptor.is_open();
}
size_t
- size() const override
+ size() const final
{
return m_size;
}
diff --git a/daemon/face/unix-stream-factory.hpp b/daemon/face/unix-stream-factory.hpp
index 8e4bee5..45be220 100644
--- a/daemon/face/unix-stream-factory.hpp
+++ b/daemon/face/unix-stream-factory.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,
@@ -34,7 +34,7 @@
/** \brief Protocol factory for stream-oriented Unix sockets
*/
-class UnixStreamFactory : public ProtocolFactory
+class UnixStreamFactory final : public ProtocolFactory
{
public:
static const std::string&
@@ -60,10 +60,10 @@
*/
void
doProcessConfig(OptionalConfigSection configSection,
- FaceSystem::ConfigContext& context) override;
+ FaceSystem::ConfigContext& context) final;
std::vector<shared_ptr<const Channel>>
- doGetChannels() const override;
+ doGetChannels() const final;
private:
bool m_wantCongestionMarking = false;
diff --git a/daemon/face/websocket-channel.hpp b/daemon/face/websocket-channel.hpp
index 1409289..1729841 100644
--- a/daemon/face/websocket-channel.hpp
+++ b/daemon/face/websocket-channel.hpp
@@ -40,7 +40,7 @@
/**
* \brief Class implementing WebSocket-based channel to create faces
*/
-class WebSocketChannel : public Channel
+class WebSocketChannel final : public Channel
{
public:
/**
@@ -54,13 +54,13 @@
WebSocketChannel(const websocket::Endpoint& localEndpoint);
bool
- isListening() const override
+ isListening() const final
{
return m_server.is_listening();
}
size_t
- size() const override
+ size() const final
{
return m_channelFaces.size();
}
diff --git a/daemon/face/websocket-factory.hpp b/daemon/face/websocket-factory.hpp
index a4b6a46..721a1eb 100644
--- a/daemon/face/websocket-factory.hpp
+++ b/daemon/face/websocket-factory.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,
@@ -34,7 +34,7 @@
/** \brief Protocol factory for WebSocket
*/
-class WebSocketFactory : public ProtocolFactory
+class WebSocketFactory final : public ProtocolFactory
{
public:
static const std::string&
@@ -62,10 +62,10 @@
*/
void
doProcessConfig(OptionalConfigSection configSection,
- FaceSystem::ConfigContext& context) override;
+ FaceSystem::ConfigContext& context) final;
std::vector<shared_ptr<const Channel>>
- doGetChannels() const override;
+ doGetChannels() const final;
private:
std::map<websocket::Endpoint, shared_ptr<WebSocketChannel>> m_channels;