table: rename StrategyInfoHost::getOrCreateStrategyInfo to insertStrategyInfo
refs #3205
Change-Id: Icd3ab9e4fdb5a2ffc39a8d0e0c713e22f13fe28c
diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index 9d4df0c..a7eed83 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -136,7 +136,7 @@
this->sendInterest(pitEntry, *face);
// schedule RTO timeout
- shared_ptr<PitInfo> pi = pitEntry->getOrCreateStrategyInfo<PitInfo>();
+ shared_ptr<PitInfo> pi = pitEntry->insertStrategyInfo<PitInfo>();
pi->rtoTimer = scheduler::schedule(rto,
bind(&AccessStrategy::afterRtoTimeout, this, weak_ptr<pit::Entry>(pitEntry),
inFace.getId(), mi.lastNexthop));
@@ -229,14 +229,14 @@
{
measurements::Entry* me = this->getMeasurements().findLongestPrefixMatch(pitEntry);
if (me == nullptr) {
- return std::forward_as_tuple(Name(), nullptr);
+ return std::make_tuple(Name(), nullptr);
}
shared_ptr<MtInfo> mi = me->getStrategyInfo<MtInfo>();
BOOST_ASSERT(mi != nullptr);
// XXX after runtime strategy change, it's possible that me exists but mi doesn't exist;
// this case needs another longest prefix match until mi is found
- return std::forward_as_tuple(me->getName(), mi);
+ return std::make_tuple(me->getName(), mi);
}
shared_ptr<AccessStrategy::MtInfo>
@@ -255,7 +255,7 @@
static const time::nanoseconds ME_LIFETIME = time::seconds(8);
this->getMeasurements().extendLifetime(*me, ME_LIFETIME);
- return me->getOrCreateStrategyInfo<MtInfo>();
+ return me->insertStrategyInfo<MtInfo>();
}
AccessStrategy::FaceInfo::FaceInfo()
diff --git a/daemon/fw/asf-measurements.cpp b/daemon/fw/asf-measurements.cpp
index c15aca0..c7f68c9 100644
--- a/daemon/fw/asf-measurements.cpp
+++ b/daemon/fw/asf-measurements.cpp
@@ -228,7 +228,7 @@
// Set or update entry lifetime
extendLifetime(*me);
- shared_ptr<NamespaceInfo> info = me->getOrCreateStrategyInfo<NamespaceInfo>();
+ shared_ptr<NamespaceInfo> info = me->insertStrategyInfo<NamespaceInfo>();
BOOST_ASSERT(info != nullptr);
return info;
@@ -252,7 +252,7 @@
// Set or update entry lifetime
extendLifetime(*me);
- shared_ptr<NamespaceInfo> info = me->getOrCreateStrategyInfo<NamespaceInfo>();
+ shared_ptr<NamespaceInfo> info = me->insertStrategyInfo<NamespaceInfo>();
BOOST_ASSERT(info != nullptr);
return *info;
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index b127fea..c56eef4 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -54,7 +54,7 @@
return;
}
- shared_ptr<PitEntryInfo> pitEntryInfo = pitEntry->getOrCreateStrategyInfo<PitEntryInfo>();
+ shared_ptr<PitEntryInfo> pitEntryInfo = pitEntry->insertStrategyInfo<PitEntryInfo>();
bool isNewPitEntry = !hasPendingOutRecords(*pitEntry);
if (!isNewPitEntry) {
return;
diff --git a/daemon/fw/retx-suppression-exponential.cpp b/daemon/fw/retx-suppression-exponential.cpp
index 3cca0ab..5edff29 100644
--- a/daemon/fw/retx-suppression-exponential.cpp
+++ b/daemon/fw/retx-suppression-exponential.cpp
@@ -82,7 +82,7 @@
time::steady_clock::TimePoint now = time::steady_clock::now();
time::steady_clock::Duration sinceLastOutgoing = now - lastOutgoing;
- shared_ptr<PitInfo> pi = pitEntry.getOrCreateStrategyInfo<PitInfo>(m_initialInterval);
+ shared_ptr<PitInfo> pi = pitEntry.insertStrategyInfo<PitInfo>(m_initialInterval);
bool shouldSuppress = sinceLastOutgoing < pi->suppressionInterval;
if (shouldSuppress) {
diff --git a/daemon/fw/strategy-info.hpp b/daemon/fw/strategy-info.hpp
index 133d53c..aae3862 100644
--- a/daemon/fw/strategy-info.hpp
+++ b/daemon/fw/strategy-info.hpp
@@ -38,7 +38,7 @@
public:
#ifdef DOXYGEN
/** \return an integer that uniquely identifies this StrategyInfo type
- * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyInfoType
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/StrategyInfoType
*/
static constexpr int
getTypeId()
@@ -48,15 +48,12 @@
#endif
virtual
- ~StrategyInfo();
+ ~StrategyInfo() = default;
+
+protected:
+ StrategyInfo() = default;
};
-
-inline
-StrategyInfo::~StrategyInfo()
-{
-}
-
} // namespace fw
} // namespace nfd