fw: rename BestRouteStrategy2 class to BestRouteStrategy
Also rename ad-hoc-forwarding.t.cpp to strategy-ad-hoc-face.t.cpp
and broadcast-medium.t.cpp to strategy-broadcast-medium.t.cpp,
for consistency with the other strategy-*.t.cpp test suites.
Change-Id: Ia8f5257260563732d74c7d58e35481b73a231f06
diff --git a/daemon/fw/best-route-strategy2.cpp b/daemon/fw/best-route-strategy.cpp
similarity index 81%
rename from daemon/fw/best-route-strategy2.cpp
rename to daemon/fw/best-route-strategy.cpp
index 7a560d8..11ae600 100644
--- a/daemon/fw/best-route-strategy2.cpp
+++ b/daemon/fw/best-route-strategy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -23,20 +23,20 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "best-route-strategy2.hpp"
+#include "best-route-strategy.hpp"
#include "algorithm.hpp"
#include "common/logger.hpp"
namespace nfd {
namespace fw {
-NFD_LOG_INIT(BestRouteStrategy2);
-NFD_REGISTER_STRATEGY(BestRouteStrategy2);
+NFD_LOG_INIT(BestRouteStrategy);
+NFD_REGISTER_STRATEGY(BestRouteStrategy);
-const time::milliseconds BestRouteStrategy2::RETX_SUPPRESSION_INITIAL(10);
-const time::milliseconds BestRouteStrategy2::RETX_SUPPRESSION_MAX(250);
+const time::milliseconds BestRouteStrategy::RETX_SUPPRESSION_INITIAL(10);
+const time::milliseconds BestRouteStrategy::RETX_SUPPRESSION_MAX(250);
-BestRouteStrategy2::BestRouteStrategy2(Forwarder& forwarder, const Name& name)
+BestRouteStrategy::BestRouteStrategy(Forwarder& forwarder, const Name& name)
: Strategy(forwarder)
, ProcessNackTraits(this)
, m_retxSuppression(RETX_SUPPRESSION_INITIAL,
@@ -45,25 +45,25 @@
{
ParsedInstanceName parsed = parseInstanceName(name);
if (!parsed.parameters.empty()) {
- NDN_THROW(std::invalid_argument("BestRouteStrategy2 does not accept parameters"));
+ NDN_THROW(std::invalid_argument("BestRouteStrategy does not accept parameters"));
}
if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
NDN_THROW(std::invalid_argument(
- "BestRouteStrategy2 does not support version " + to_string(*parsed.version)));
+ "BestRouteStrategy does not support version " + to_string(*parsed.version)));
}
this->setInstanceName(makeInstanceName(name, getStrategyName()));
}
const Name&
-BestRouteStrategy2::getStrategyName()
+BestRouteStrategy::getStrategyName()
{
static Name strategyName("/localhost/nfd/strategy/best-route/%FD%05");
return strategyName;
}
void
-BestRouteStrategy2::afterReceiveInterest(const FaceEndpoint& ingress, const Interest& interest,
- const shared_ptr<pit::Entry>& pitEntry)
+BestRouteStrategy::afterReceiveInterest(const FaceEndpoint& ingress, const Interest& interest,
+ const shared_ptr<pit::Entry>& pitEntry)
{
RetxSuppressionResult suppression = m_retxSuppression.decidePerPitEntry(*pitEntry);
if (suppression == RetxSuppressionResult::SUPPRESS) {
@@ -124,8 +124,8 @@
}
void
-BestRouteStrategy2::afterReceiveNack(const FaceEndpoint& ingress, const lp::Nack& nack,
- const shared_ptr<pit::Entry>& pitEntry)
+BestRouteStrategy::afterReceiveNack(const FaceEndpoint& ingress, const lp::Nack& nack,
+ const shared_ptr<pit::Entry>& pitEntry)
{
this->processNack(ingress.face, nack, pitEntry);
}
diff --git a/daemon/fw/best-route-strategy2.hpp b/daemon/fw/best-route-strategy.hpp
similarity index 88%
rename from daemon/fw/best-route-strategy2.hpp
rename to daemon/fw/best-route-strategy.hpp
index 438ecd8..636abd2 100644
--- a/daemon/fw/best-route-strategy2.hpp
+++ b/daemon/fw/best-route-strategy.hpp
@@ -23,8 +23,8 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_DAEMON_FW_BEST_ROUTE_STRATEGY2_HPP
-#define NFD_DAEMON_FW_BEST_ROUTE_STRATEGY2_HPP
+#ifndef NFD_DAEMON_FW_BEST_ROUTE_STRATEGY_HPP
+#define NFD_DAEMON_FW_BEST_ROUTE_STRATEGY_HPP
#include "strategy.hpp"
#include "process-nack-traits.hpp"
@@ -50,12 +50,12 @@
* This strategy returns Nack to all downstreams if all upstreams have returned Nacks.
* The reason of the sent Nack equals the least severe reason among received Nacks.
*/
-class BestRouteStrategy2 : public Strategy
- , public ProcessNackTraits<BestRouteStrategy2>
+class BestRouteStrategy : public Strategy
+ , public ProcessNackTraits<BestRouteStrategy>
{
public:
explicit
- BestRouteStrategy2(Forwarder& forwarder, const Name& name = getStrategyName());
+ BestRouteStrategy(Forwarder& forwarder, const Name& name = getStrategyName());
static const Name&
getStrategyName();
@@ -73,10 +73,10 @@
static const time::milliseconds RETX_SUPPRESSION_MAX;
RetxSuppressionExponential m_retxSuppression;
- friend ProcessNackTraits<BestRouteStrategy2>;
+ friend ProcessNackTraits<BestRouteStrategy>;
};
} // namespace fw
} // namespace nfd
-#endif // NFD_DAEMON_FW_BEST_ROUTE_STRATEGY2_HPP
+#endif // NFD_DAEMON_FW_BEST_ROUTE_STRATEGY_HPP
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 387ac0d..1938c94 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -26,7 +26,7 @@
#include "forwarder.hpp"
#include "algorithm.hpp"
-#include "best-route-strategy2.hpp"
+#include "best-route-strategy.hpp"
#include "scope-prefix.hpp"
#include "strategy.hpp"
#include "common/global.hpp"
@@ -43,7 +43,7 @@
static Name
getDefaultStrategyName()
{
- return fw::BestRouteStrategy2::getStrategyName();
+ return fw::BestRouteStrategy::getStrategyName();
}
Forwarder::Forwarder(FaceTable& faceTable)