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/forwarder.cpp b/daemon/fw/forwarder.cpp
index 508a890..328ff31 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -29,6 +29,7 @@
#include "best-route-strategy2.hpp"
#include "strategy.hpp"
#include "core/logger.hpp"
+#include "daemon/global.hpp"
#include "table/cleanup.hpp"
#include <ndn-cxx/lp/tags.hpp>
@@ -44,7 +45,7 @@
}
Forwarder::Forwarder()
- : m_unsolicitedDataPolicy(new fw::DefaultUnsolicitedDataPolicy())
+ : m_unsolicitedDataPolicy(make_unique<fw::DefaultUnsolicitedDataPolicy>())
, m_fib(m_nameTree)
, m_pit(m_nameTree)
, m_measurements(m_nameTree)
@@ -241,7 +242,7 @@
<< (pitEntry->isSatisfied ? " satisfied" : " unsatisfied"));
// Dead Nonce List insert if necessary
- this->insertDeadNonceList(*pitEntry, 0);
+ this->insertDeadNonceList(*pitEntry, nullptr);
// Increment satisfied/unsatisfied Interests counter
if (pitEntry->isSatisfied) {
@@ -252,7 +253,7 @@
}
// PIT delete
- scheduler::cancel(pitEntry->expiryTimer);
+ pitEntry->expiryTimer.cancel();
m_pit.erase(pitEntry.get());
}
@@ -507,9 +508,8 @@
BOOST_ASSERT(pitEntry);
BOOST_ASSERT(duration >= 0_ms);
- scheduler::cancel(pitEntry->expiryTimer);
-
- pitEntry->expiryTimer = scheduler::schedule(duration, [=] { onInterestFinalize(pitEntry); });
+ pitEntry->expiryTimer.cancel();
+ pitEntry->expiryTimer = getScheduler().schedule(duration, [=] { onInterestFinalize(pitEntry); });
}
void