table: allow strategy versioning
refs #1893
Change-Id: I44eb8dd319d737d786b6ce6f753ae2f9076cf9c1
diff --git a/daemon/fw/best-route-strategy2.cpp b/daemon/fw/best-route-strategy2.cpp
index 58300fe..323bb3d 100644
--- a/daemon/fw/best-route-strategy2.cpp
+++ b/daemon/fw/best-route-strategy2.cpp
@@ -31,8 +31,7 @@
NFD_LOG_INIT("BestRouteStrategy2");
-/// \todo set to ndn:/localhost/nfd/strategy/best-route/%FD%02 after #1893 completion
-const Name BestRouteStrategy2::STRATEGY_NAME("ndn:/localhost/nfd/strategy/best-route");
+const Name BestRouteStrategy2::STRATEGY_NAME("ndn:/localhost/nfd/strategy/best-route/%FD%02");
/// \todo don't use fixed interval; make it adaptive or use exponential back-off #1913
const time::milliseconds BestRouteStrategy2::MIN_RETRANSMISSION_INTERVAL(100);
diff --git a/daemon/fw/broadcast-strategy.cpp b/daemon/fw/broadcast-strategy.cpp
index c619e04..48ab17b 100644
--- a/daemon/fw/broadcast-strategy.cpp
+++ b/daemon/fw/broadcast-strategy.cpp
@@ -1,11 +1,12 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
+ * Copyright (c) 2014, Regents of the University of California,
+ * Arizona Board of Regents,
+ * Colorado State University,
+ * University Pierre & Marie Curie, Sorbonne University,
+ * Washington University in St. Louis,
+ * Beijing Institute of Technology,
+ * The University of Memphis
*
* This file is part of NFD (Named Data Networking Forwarding Daemon).
* See AUTHORS.md for complete list of NFD authors and contributors.
@@ -20,14 +21,14 @@
*
* You should have received a copy of the GNU General Public License along with
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#include "broadcast-strategy.hpp"
namespace nfd {
namespace fw {
-const Name BroadcastStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/broadcast");
+const Name BroadcastStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/broadcast/%FD%01");
BroadcastStrategy::BroadcastStrategy(Forwarder& forwarder, const Name& name)
: Strategy(forwarder, name)
diff --git a/daemon/fw/client-control-strategy.cpp b/daemon/fw/client-control-strategy.cpp
index f8d83a8..d3700e3 100644
--- a/daemon/fw/client-control-strategy.cpp
+++ b/daemon/fw/client-control-strategy.cpp
@@ -1,11 +1,12 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
+ * Copyright (c) 2014, Regents of the University of California,
+ * Arizona Board of Regents,
+ * Colorado State University,
+ * University Pierre & Marie Curie, Sorbonne University,
+ * Washington University in St. Louis,
+ * Beijing Institute of Technology,
+ * The University of Memphis
*
* This file is part of NFD (Named Data Networking Forwarding Daemon).
* See AUTHORS.md for complete list of NFD authors and contributors.
@@ -20,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#include "client-control-strategy.hpp"
#include "core/logger.hpp"
@@ -30,7 +31,8 @@
NFD_LOG_INIT("ClientControlStrategy");
-const Name ClientControlStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/client-control");
+const Name
+ClientControlStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/client-control/%FD%01");
ClientControlStrategy::ClientControlStrategy(Forwarder& forwarder, const Name& name)
: BestRouteStrategy(forwarder, name)
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index 925a3cf..bb93bd5 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -30,7 +30,7 @@
namespace nfd {
namespace fw {
-const Name NccStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/ncc");
+const Name NccStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/ncc/%FD%01");
NccStrategy::NccStrategy(Forwarder& forwarder, const Name& name)
: Strategy(forwarder, name)
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index f910383..e1ff23c 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -37,6 +37,13 @@
class Strategy : public enable_shared_from_this<Strategy>, noncopyable
{
public:
+ /** \brief construct a strategy instance
+ * \param forwarder a reference to the Forwarder, used to enable actions and accessors.
+ * Strategy subclasses should pass this reference,
+ * and should not keep a reference themselves.
+ * \param name the strategy Name.
+ * It's recommended to include a version number as the last component.
+ */
Strategy(Forwarder& forwarder, const Name& name);
virtual