face: override Transport::beforeChangePersistency in all subclasses
This commit also adds the final specifier to some Transport
subclasses in order to improve code generation.
Change-Id: If2979fa1614476a98019ba79cee3961663fc447b
Refs: #3318
diff --git a/daemon/face/unicast-udp-transport.hpp b/daemon/face/unicast-udp-transport.hpp
index 0a9beed..0c7c277 100644
--- a/daemon/face/unicast-udp-transport.hpp
+++ b/daemon/face/unicast-udp-transport.hpp
@@ -35,20 +35,23 @@
/**
* \brief A Transport that communicates on a unicast UDP socket
*/
-class UnicastUdpTransport : public DatagramTransport<boost::asio::ip::udp, Unicast>
+class UnicastUdpTransport DECL_FINAL : public DatagramTransport<boost::asio::ip::udp, Unicast>
{
public:
UnicastUdpTransport(protocol::socket&& socket,
ndn::nfd::FacePersistency persistency,
- const time::seconds& idleTimeout);
+ time::nanoseconds idleTimeout);
+
+protected:
+ virtual void
+ beforeChangePersistency(ndn::nfd::FacePersistency newPersistency) DECL_FINAL;
private:
void
- closeIfIdle();
+ scheduleClosureWhenIdle();
private:
- const time::seconds m_idleTimeout;
- time::steady_clock::TimePoint m_lastIdleCheck;
+ const time::nanoseconds m_idleTimeout;
scheduler::ScopedEventId m_closeIfIdleEvent;
};