core+daemon: eliminate scheduler::{schedule,cancel} wrappers
Also move core/global-io.hpp to daemon/global.hpp
Refs: #4528, #4883
Change-Id: I0b99029f1a19d7451aab57099cd3303b7eb42ff3
diff --git a/daemon/fw/asf-measurements.cpp b/daemon/fw/asf-measurements.cpp
index 17771e0..dde6866 100644
--- a/daemon/fw/asf-measurements.cpp
+++ b/daemon/fw/asf-measurements.cpp
@@ -24,6 +24,7 @@
*/
#include "asf-measurements.hpp"
+#include "daemon/global.hpp"
namespace nfd {
namespace fw {
@@ -73,7 +74,7 @@
FaceInfo::~FaceInfo()
{
cancelTimeoutEvent();
- scheduler::cancel(m_measurementExpirationId);
+ m_measurementExpirationId.cancel();
}
void
@@ -92,7 +93,7 @@
void
FaceInfo::cancelTimeoutEvent()
{
- scheduler::cancel(m_timeoutEventId);
+ m_timeoutEventId.cancel();
m_isTimeoutScheduled = false;
}
@@ -114,7 +115,7 @@
FaceInfo::recordRtt(const shared_ptr<pit::Entry>& pitEntry, const Face& inFace)
{
// Calculate RTT
- pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(inFace, 0);
+ auto outRecord = pitEntry->getOutRecord(inFace, 0);
if (outRecord == pitEntry->out_end()) { // no out-record
NFD_LOG_TRACE(pitEntry->getInterest() << " dataFrom inFace=" << inFace.getId() << " no-out-record");
@@ -122,7 +123,7 @@
}
time::steady_clock::Duration steadyRtt = time::steady_clock::now() - outRecord->getLastRenewed();
- RttEstimator::Duration durationRtt = time::duration_cast<RttEstimator::Duration>(steadyRtt);
+ auto durationRtt = time::duration_cast<RttEstimator::Duration>(steadyRtt);
m_rttStats.addRttMeasurement(durationRtt);
@@ -148,10 +149,9 @@
}
FaceInfo*
-NamespaceInfo::getFaceInfo(const fib::Entry& fibEntry, FaceId faceId)
+NamespaceInfo::getFaceInfo(const fib::Entry&, FaceId faceId)
{
- FaceInfoTable::iterator it = m_fit.find(faceId);
-
+ auto it = m_fit.find(faceId);
if (it != m_fit.end()) {
return &it->second;
}
@@ -161,10 +161,9 @@
}
FaceInfo&
-NamespaceInfo::getOrCreateFaceInfo(const fib::Entry& fibEntry, FaceId faceId)
+NamespaceInfo::getOrCreateFaceInfo(const fib::Entry&, FaceId faceId)
{
- FaceInfoTable::iterator it = m_fit.find(faceId);
-
+ auto it = m_fit.find(faceId);
FaceInfo* info = nullptr;
if (it == m_fit.end()) {
@@ -190,10 +189,11 @@
NamespaceInfo::extendFaceInfoLifetime(FaceInfo& info, FaceId faceId)
{
// Cancel previous expiration
- scheduler::cancel(info.getMeasurementExpirationEventId());
+ info.getMeasurementExpirationEventId().cancel();
// Refresh measurement
- auto id = scheduler::schedule(AsfMeasurements::MEASUREMENTS_LIFETIME, [=] { expireFaceInfo(faceId); });
+ auto id = getScheduler().schedule(AsfMeasurements::MEASUREMENTS_LIFETIME,
+ [=] { expireFaceInfo(faceId); });
info.setMeasurementExpirationEventId(id);
}