all: Fixing compatibility with NFD 0.5 and ndn-cxx 0.5
Change-Id: I3d23acf29f4858049d1040a3e421e1c7151b3aba
diff --git a/helper/ndn-global-routing-helper.cpp b/helper/ndn-global-routing-helper.cpp
index aca25d5..6d13d6b 100644
--- a/helper/ndn-global-routing-helper.cpp
+++ b/helper/ndn-global-routing-helper.cpp
@@ -81,7 +81,7 @@
node->AggregateObject(gr);
for (auto& face : ndn->getForwarder()->getFaceTable()) {
- auto linkService = dynamic_cast<NetDeviceLinkService*>(face->getLinkService());
+ auto linkService = dynamic_cast<NetDeviceLinkService*>(face.getLinkService());
if (linkService == nullptr) {
NS_LOG_DEBUG("Skipping non-netdevice face");
continue;
@@ -116,7 +116,7 @@
}
otherGr = otherNode->GetObject<GlobalRouter>();
NS_ASSERT(otherGr != 0);
- gr->AddIncidency(face, otherGr);
+ gr->AddIncidency(face.shared_from_this(), otherGr);
}
}
else {
@@ -126,7 +126,7 @@
}
grChannel = ch->GetObject<GlobalRouter>();
- gr->AddIncidency(face, grChannel);
+ gr->AddIncidency(face.shared_from_this(), grChannel);
}
}
}
@@ -316,16 +316,16 @@
// remember interface statuses
std::list<nfd::FaceId> faceIds;
std::unordered_map<nfd::FaceId, uint16_t> originalMetrics;
- for (auto& i : l3->getForwarder()->getFaceTable()) {
- shared_ptr<Face> nfdFace = std::dynamic_pointer_cast<Face>(i);
- faceIds.push_back(nfdFace->getId());
- originalMetrics[nfdFace->getId()] = nfdFace->getMetric();
- nfdFace->setMetric(std::numeric_limits<uint16_t>::max() - 1);
+ for (auto& nfdFace : l3->getForwarder()->getFaceTable()) {
+ faceIds.push_back(nfdFace.getId());
+ originalMetrics[nfdFace.getId()] = nfdFace.getMetric();
+ nfdFace.setMetric(std::numeric_limits<uint16_t>::max() - 1);
// value std::numeric_limits<uint16_t>::max () MUST NOT be used (reserved)
}
for (auto& faceId : faceIds) {
- shared_ptr<Face> face = l3->getForwarder()->getFaceTable().get(faceId);
+ auto* face = l3->getForwarder()->getFaceTable().get(faceId);
+ NS_ASSERT(face != nullptr);
auto linkService = dynamic_cast<NetDeviceLinkService*>(face->getLinkService());
if (linkService == nullptr) {
NS_LOG_DEBUG("Skipping non-netdevice face");
diff --git a/helper/ndn-link-control-helper.cpp b/helper/ndn-link-control-helper.cpp
index 70a3171..26a2a2c 100644
--- a/helper/ndn-link-control-helper.cpp
+++ b/helper/ndn-link-control-helper.cpp
@@ -57,7 +57,7 @@
// iterate over all faces to find the right one
for (const auto& face : ndn1->getForwarder()->getFaceTable()) {
- auto linkService = dynamic_cast<NetDeviceLinkService*>(face->getLinkService());
+ auto linkService = dynamic_cast<NetDeviceLinkService*>(face.getLinkService());
if (linkService == nullptr)
continue;
diff --git a/helper/ndn-strategy-choice-helper.hpp b/helper/ndn-strategy-choice-helper.hpp
index aea07f3..302682a 100644
--- a/helper/ndn-strategy-choice-helper.hpp
+++ b/helper/ndn-strategy-choice-helper.hpp
@@ -120,7 +120,7 @@
nfd::StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
if (!strategyChoice.hasStrategy(Strategy::STRATEGY_NAME)) {
- strategyChoice.install(make_shared<Strategy>(ref(forwarder)));
+ strategyChoice.install(make_unique<Strategy>(ref(forwarder)));
}
Install(node, namePrefix, Strategy::STRATEGY_NAME);