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/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index a6c1e99..5063200 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -25,6 +25,7 @@
#include "ncc-strategy.hpp"
#include "algorithm.hpp"
+#include "daemon/global.hpp"
#include <ndn-cxx/util/random.hpp>
@@ -90,8 +91,7 @@
deferRange = time::microseconds((deferFirst.count() + 1) / 2);
--nUpstreams;
this->sendInterest(pitEntry, FaceEndpoint(*bestFace, 0), interest);
- pitEntryInfo->bestFaceTimeout = scheduler::schedule(
- meInfo.prediction,
+ pitEntryInfo->bestFaceTimeout = getScheduler().schedule(meInfo.prediction,
bind(&NccStrategy::timeoutOnBestFace, this, weak_ptr<pit::Entry>(pitEntry)));
}
else {
@@ -128,7 +128,7 @@
// this maxInterval would be used to determine when the next doPropagate would happen.
pitEntryInfo->maxInterval = deferFirst;
}
- pitEntryInfo->propagateTimer = scheduler::schedule(deferFirst,
+ pitEntryInfo->propagateTimer = getScheduler().schedule(deferFirst,
bind(&NccStrategy::doPropagate, this, ingress.face.getId(), weak_ptr<pit::Entry>(pitEntry)));
}
@@ -178,7 +178,7 @@
if (isForwarded) {
std::uniform_int_distribution<time::nanoseconds::rep> dist(0, pitEntryInfo->maxInterval.count() - 1);
time::nanoseconds deferNext(dist(ndn::random::getRandomNumberEngine()));
- pitEntryInfo->propagateTimer = scheduler::schedule(deferNext,
+ pitEntryInfo->propagateTimer = getScheduler().schedule(deferNext,
bind(&NccStrategy::doPropagate, this, inFaceId, weak_ptr<pit::Entry>(pitEntry)));
}
}
@@ -233,14 +233,14 @@
PitEntryInfo* pitEntryInfo = pitEntry->getStrategyInfo<PitEntryInfo>();
if (pitEntryInfo != nullptr) {
- scheduler::cancel(pitEntryInfo->propagateTimer);
+ pitEntryInfo->propagateTimer.cancel();
// Verify that the best face satisfied the interest before canceling the timeout call
MeasurementsEntryInfo& meInfo = this->getMeasurementsEntryInfo(pitEntry);
shared_ptr<Face> bestFace = meInfo.getBestFace();
if (bestFace.get() == &ingress.face)
- scheduler::cancel(pitEntryInfo->bestFaceTimeout);
+ pitEntryInfo->bestFaceTimeout.cancel();
}
}
@@ -337,8 +337,8 @@
NccStrategy::PitEntryInfo::~PitEntryInfo()
{
- scheduler::cancel(this->bestFaceTimeout);
- scheduler::cancel(this->propagateTimer);
+ bestFaceTimeout.cancel();
+ propagateTimer.cancel();
}
} // namespace fw