Further reduce the use of std::bind()
And also avoid deprecated ndn-cxx type aliases
Change-Id: I87e903b9671a3cf1c1b9ab30d4594d595c3c6da9
diff --git a/core/common.hpp b/core/common.hpp
index 0e47227..38cf178 100644
--- a/core/common.hpp
+++ b/core/common.hpp
@@ -112,7 +112,7 @@
namespace lp = ndn::lp;
namespace name = ndn::name;
namespace scheduler = ndn::scheduler;
-namespace signal = ndn::util::signal;
+namespace signal = ndn::signal;
namespace time = ndn::time;
using namespace ndn::time_literals;
diff --git a/daemon/fw/unsolicited-data-policy.cpp b/daemon/fw/unsolicited-data-policy.cpp
index 8ad0f66..c1a7358 100644
--- a/daemon/fw/unsolicited-data-policy.cpp
+++ b/daemon/fw/unsolicited-data-policy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -66,7 +66,6 @@
return policyNames;
}
-const std::string DropAllUnsolicitedDataPolicy::POLICY_NAME("drop-all");
NFD_REGISTER_UNSOLICITED_DATA_POLICY(DropAllUnsolicitedDataPolicy);
UnsolicitedDataDecision
@@ -75,7 +74,6 @@
return UnsolicitedDataDecision::DROP;
}
-const std::string AdmitLocalUnsolicitedDataPolicy::POLICY_NAME("admit-local");
NFD_REGISTER_UNSOLICITED_DATA_POLICY(AdmitLocalUnsolicitedDataPolicy);
UnsolicitedDataDecision
@@ -87,7 +85,6 @@
return UnsolicitedDataDecision::DROP;
}
-const std::string AdmitNetworkUnsolicitedDataPolicy::POLICY_NAME("admit-network");
NFD_REGISTER_UNSOLICITED_DATA_POLICY(AdmitNetworkUnsolicitedDataPolicy);
UnsolicitedDataDecision
@@ -99,7 +96,6 @@
return UnsolicitedDataDecision::DROP;
}
-const std::string AdmitAllUnsolicitedDataPolicy::POLICY_NAME("admit-all");
NFD_REGISTER_UNSOLICITED_DATA_POLICY(AdmitAllUnsolicitedDataPolicy);
UnsolicitedDataDecision
diff --git a/daemon/fw/unsolicited-data-policy.hpp b/daemon/fw/unsolicited-data-policy.hpp
index d49d40a..ec9984b 100644
--- a/daemon/fw/unsolicited-data-policy.hpp
+++ b/daemon/fw/unsolicited-data-policy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -60,10 +60,10 @@
public: // registry
template<typename P>
static void
- registerPolicy(const std::string& policyName = P::POLICY_NAME)
+ registerPolicy(std::string_view policyName = P::POLICY_NAME)
{
BOOST_ASSERT(!policyName.empty());
- auto r = getRegistry().insert_or_assign(policyName, [] { return make_unique<P>(); });
+ auto r = getRegistry().insert_or_assign(std::string(policyName), [] { return make_unique<P>(); });
BOOST_VERIFY(r.second);
}
@@ -96,7 +96,7 @@
decide(const Face& inFace, const Data& data) const final;
public:
- static const std::string POLICY_NAME;
+ static constexpr std::string_view POLICY_NAME{"drop-all"};
};
/**
@@ -109,7 +109,7 @@
decide(const Face& inFace, const Data& data) const final;
public:
- static const std::string POLICY_NAME;
+ static constexpr std::string_view POLICY_NAME{"admit-local"};
};
/**
@@ -122,7 +122,7 @@
decide(const Face& inFace, const Data& data) const final;
public:
- static const std::string POLICY_NAME;
+ static constexpr std::string_view POLICY_NAME{"admit-network"};
};
/**
@@ -135,7 +135,7 @@
decide(const Face& inFace, const Data& data) const final;
public:
- static const std::string POLICY_NAME;
+ static constexpr std::string_view POLICY_NAME{"admit-all"};
};
/**
@@ -146,9 +146,9 @@
} // namespace nfd::fw
/**
- * \brief Registers an unsolicited data policy
- * \param P A subclass of nfd::fw::UnsolicitedDataPolicy. \p P must have a static data
- * member `POLICY_NAME` convertible to std::string that contains the policy name.
+ * \brief Registers an unsolicited data policy.
+ * \param P A subclass of nfd::fw::UnsolicitedDataPolicy. \p P must have a static const data
+ * member `POLICY_NAME` convertible to std::string_view that contains the policy name.
*/
#define NFD_REGISTER_UNSOLICITED_DATA_POLICY(P) \
static class NfdAuto ## P ## UnsolicitedDataPolicyRegistrationClass \
diff --git a/daemon/mgmt/cs-manager.cpp b/daemon/mgmt/cs-manager.cpp
index 36d7014..a88b40c 100644
--- a/daemon/mgmt/cs-manager.cpp
+++ b/daemon/mgmt/cs-manager.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -38,11 +38,11 @@
, m_fwCounters(fwCounters)
{
registerCommandHandler<ndn::nfd::CsConfigCommand>("config",
- std::bind(&CsManager::changeConfig, this, _4, _5));
+ [this] (auto&&, auto&&, auto&&, auto&&... args) { changeConfig(std::forward<decltype(args)>(args)...); });
registerCommandHandler<ndn::nfd::CsEraseCommand>("erase",
- std::bind(&CsManager::erase, this, _4, _5));
-
- registerStatusDatasetHandler("info", std::bind(&CsManager::serveInfo, this, _1, _2, _3));
+ [this] (auto&&, auto&&, auto&&, auto&&... args) { erase(std::forward<decltype(args)>(args)...); });
+ registerStatusDatasetHandler("info",
+ [this] (auto&&, auto&&, auto&&... args) { serveInfo(std::forward<decltype(args)>(args)...); });
}
void
@@ -99,7 +99,7 @@
}
void
-CsManager::serveInfo(const Name&, const Interest&, ndn::mgmt::StatusDatasetContext& context) const
+CsManager::serveInfo(ndn::mgmt::StatusDatasetContext& context) const
{
ndn::nfd::CsInfo info;
info.setCapacity(m_cs.getLimit());
diff --git a/daemon/mgmt/cs-manager.hpp b/daemon/mgmt/cs-manager.hpp
index 95fbffc..58fe362 100644
--- a/daemon/mgmt/cs-manager.hpp
+++ b/daemon/mgmt/cs-manager.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -62,8 +62,7 @@
/** \brief Serve CS information dataset.
*/
void
- serveInfo(const Name& topPrefix, const Interest& interest,
- ndn::mgmt::StatusDatasetContext& context) const;
+ serveInfo(ndn::mgmt::StatusDatasetContext& context) const;
public:
static constexpr size_t ERASE_LIMIT = 256;
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index cc89061..b7109fa 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -48,16 +48,19 @@
{
// register handlers for ControlCommand
registerCommandHandler<ndn::nfd::FaceCreateCommand>("create",
- std::bind(&FaceManager::createFace, this, _4, _5));
+ [this] (auto&&, auto&&, auto&&, auto&&... args) { createFace(std::forward<decltype(args)>(args)...); });
registerCommandHandler<ndn::nfd::FaceUpdateCommand>("update",
- std::bind(&FaceManager::updateFace, this, _3, _4, _5));
+ [this] (auto&&, auto&&, auto&&... args) { updateFace(std::forward<decltype(args)>(args)...); });
registerCommandHandler<ndn::nfd::FaceDestroyCommand>("destroy",
- std::bind(&FaceManager::destroyFace, this, _4, _5));
+ [this] (auto&&, auto&&, auto&&, auto&&... args) { destroyFace(std::forward<decltype(args)>(args)...); });
// register handlers for StatusDataset
- registerStatusDatasetHandler("list", std::bind(&FaceManager::listFaces, this, _3));
- registerStatusDatasetHandler("channels", std::bind(&FaceManager::listChannels, this, _3));
- registerStatusDatasetHandler("query", std::bind(&FaceManager::queryFaces, this, _2, _3));
+ registerStatusDatasetHandler("list",
+ [this] (auto&&, auto&&, auto&&... args) { listFaces(std::forward<decltype(args)>(args)...); });
+ registerStatusDatasetHandler("channels",
+ [this] (auto&&, auto&&, auto&&... args) { listChannels(std::forward<decltype(args)>(args)...); });
+ registerStatusDatasetHandler("query",
+ [this] (auto&&, auto&&... args) { queryFaces(std::forward<decltype(args)>(args)...); });
// register notification stream
m_postNotification = registerNotificationStream("events");
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
index 474d616..24b044b 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -45,16 +45,15 @@
, m_faceTable(faceTable)
{
registerCommandHandler<ndn::nfd::FibAddNextHopCommand>("add-nexthop",
- std::bind(&FibManager::addNextHop, this, _2, _3, _4, _5));
+ [this] (auto&&, auto&&, auto&&... args) { addNextHop(std::forward<decltype(args)>(args)...); });
registerCommandHandler<ndn::nfd::FibRemoveNextHopCommand>("remove-nexthop",
- std::bind(&FibManager::removeNextHop, this, _2, _3, _4, _5));
-
- registerStatusDatasetHandler("list", std::bind(&FibManager::listEntries, this, _1, _2, _3));
+ [this] (auto&&, auto&&, auto&&... args) { removeNextHop(std::forward<decltype(args)>(args)...); });
+ registerStatusDatasetHandler("list",
+ [this] (auto&&, auto&&, auto&&... args) { listEntries(std::forward<decltype(args)>(args)...); });
}
void
-FibManager::addNextHop(const Name&, const Interest& interest,
- ControlParameters parameters,
+FibManager::addNextHop(const Interest& interest, ControlParameters parameters,
const ndn::mgmt::CommandContinuation& done)
{
setFaceForSelfRegistration(interest, parameters);
@@ -84,8 +83,7 @@
}
void
-FibManager::removeNextHop(const Name&, const Interest& interest,
- ControlParameters parameters,
+FibManager::removeNextHop(const Interest& interest, ControlParameters parameters,
const ndn::mgmt::CommandContinuation& done)
{
setFaceForSelfRegistration(interest, parameters);
@@ -121,8 +119,7 @@
}
void
-FibManager::listEntries(const Name&, const Interest&,
- ndn::mgmt::StatusDatasetContext& context)
+FibManager::listEntries(ndn::mgmt::StatusDatasetContext& context)
{
for (const auto& entry : m_fib) {
const auto& nexthops = entry.getNextHops() |
diff --git a/daemon/mgmt/fib-manager.hpp b/daemon/mgmt/fib-manager.hpp
index ca04391..ba490bf 100644
--- a/daemon/mgmt/fib-manager.hpp
+++ b/daemon/mgmt/fib-manager.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -48,18 +48,15 @@
private:
void
- addNextHop(const Name& topPrefix, const Interest& interest,
- ControlParameters parameters,
+ addNextHop(const Interest& interest, ControlParameters parameters,
const ndn::mgmt::CommandContinuation& done);
void
- removeNextHop(const Name& topPrefix, const Interest& interest,
- ControlParameters parameters,
+ removeNextHop(const Interest& interest, ControlParameters parameters,
const ndn::mgmt::CommandContinuation& done);
void
- listEntries(const Name& topPrefix, const Interest& interest,
- ndn::mgmt::StatusDatasetContext& context);
+ listEntries(ndn::mgmt::StatusDatasetContext& context);
private:
void
diff --git a/daemon/mgmt/forwarder-status-manager.cpp b/daemon/mgmt/forwarder-status-manager.cpp
index 818d054..d8ed725 100644
--- a/daemon/mgmt/forwarder-status-manager.cpp
+++ b/daemon/mgmt/forwarder-status-manager.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -35,7 +35,7 @@
, m_startTimestamp(time::system_clock::now())
{
m_dispatcher.addStatusDataset("status/general", ndn::mgmt::makeAcceptAllAuthorization(),
- std::bind(&ForwarderStatusManager::listGeneralStatus, this, _1, _2, _3));
+ [this] (auto&&, auto&&, auto&& ctx) { listGeneralStatus(std::forward<decltype(ctx)>(ctx)); });
}
ndn::nfd::ForwarderStatus
@@ -67,8 +67,7 @@
}
void
-ForwarderStatusManager::listGeneralStatus(const Name&, const Interest&,
- ndn::mgmt::StatusDatasetContext& context)
+ForwarderStatusManager::listGeneralStatus(ndn::mgmt::StatusDatasetContext& context)
{
auto status = this->collectGeneralStatus();
const auto& wire = status.wireEncode();
diff --git a/daemon/mgmt/forwarder-status-manager.hpp b/daemon/mgmt/forwarder-status-manager.hpp
index f93650c..4208fe5 100644
--- a/daemon/mgmt/forwarder-status-manager.hpp
+++ b/daemon/mgmt/forwarder-status-manager.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -51,8 +51,7 @@
* \brief Provides the general status dataset.
*/
void
- listGeneralStatus(const Name& topPrefix, const Interest& interest,
- ndn::mgmt::StatusDatasetContext& context);
+ listGeneralStatus(ndn::mgmt::StatusDatasetContext& context);
private:
Forwarder& m_forwarder;
diff --git a/daemon/mgmt/manager-base.cpp b/daemon/mgmt/manager-base.cpp
index ee5f782..979fc16 100644
--- a/daemon/mgmt/manager-base.cpp
+++ b/daemon/mgmt/manager-base.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,13 +27,13 @@
namespace nfd {
-ManagerBase::ManagerBase(const std::string& module, Dispatcher& dispatcher)
+ManagerBase::ManagerBase(std::string_view module, Dispatcher& dispatcher)
: m_module(module)
, m_dispatcher(dispatcher)
{
}
-ManagerBase::ManagerBase(const std::string& module, Dispatcher& dispatcher,
+ManagerBase::ManagerBase(std::string_view module, Dispatcher& dispatcher,
CommandAuthenticator& authenticator)
: m_module(module)
, m_dispatcher(dispatcher)
diff --git a/daemon/mgmt/manager-base.hpp b/daemon/mgmt/manager-base.hpp
index 7702271..08aca11 100644
--- a/daemon/mgmt/manager-base.hpp
+++ b/daemon/mgmt/manager-base.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -64,11 +64,11 @@
protected:
/**
- * @warning if you use this constructor, you MUST override makeAuthorization()
+ * @warning If you use this constructor, you MUST override makeAuthorization().
*/
- ManagerBase(const std::string& module, Dispatcher& dispatcher);
+ ManagerBase(std::string_view module, Dispatcher& dispatcher);
- ManagerBase(const std::string& module, Dispatcher& dispatcher,
+ ManagerBase(std::string_view module, Dispatcher& dispatcher,
CommandAuthenticator& authenticator);
NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED: // registrations to the dispatcher
diff --git a/daemon/mgmt/rib-manager.cpp b/daemon/mgmt/rib-manager.cpp
index 9b5f043..4943672 100644
--- a/daemon/mgmt/rib-manager.cpp
+++ b/daemon/mgmt/rib-manager.cpp
@@ -60,11 +60,11 @@
, m_isLocalhopEnabled(false)
{
registerCommandHandler<ndn::nfd::RibRegisterCommand>("register",
- std::bind(&RibManager::registerEntry, this, _2, _3, _4, _5));
+ [this] (auto&&, auto&&, auto&&... args) { registerEntry(std::forward<decltype(args)>(args)...); });
registerCommandHandler<ndn::nfd::RibUnregisterCommand>("unregister",
- std::bind(&RibManager::unregisterEntry, this, _2, _3, _4, _5));
-
- registerStatusDatasetHandler("list", std::bind(&RibManager::listEntries, this, _1, _2, _3));
+ [this] (auto&&, auto&&, auto&&... args) { unregisterEntry(std::forward<decltype(args)>(args)...); });
+ registerStatusDatasetHandler("list",
+ [this] (auto&&, auto&&, auto&&... args) { listEntries(std::forward<decltype(args)>(args)...); });
}
void
@@ -215,8 +215,7 @@
}
void
-RibManager::registerEntry(const Name& topPrefix, const Interest& interest,
- ControlParameters parameters,
+RibManager::registerEntry(const Interest& interest, ControlParameters parameters,
const ndn::mgmt::CommandContinuation& done)
{
if (parameters.getName().size() > Fib::getMaxDepth()) {
@@ -246,8 +245,7 @@
}
void
-RibManager::unregisterEntry(const Name&, const Interest& interest,
- ControlParameters parameters,
+RibManager::unregisterEntry(const Interest& interest, ControlParameters parameters,
const ndn::mgmt::CommandContinuation& done)
{
setFaceForSelfRegistration(interest, parameters);
@@ -263,7 +261,7 @@
}
void
-RibManager::listEntries(const Name&, const Interest&, ndn::mgmt::StatusDatasetContext& context)
+RibManager::listEntries(ndn::mgmt::StatusDatasetContext& context)
{
auto now = time::steady_clock::now();
for (const auto& kv : m_rib) {
@@ -426,9 +424,8 @@
NFD_LOG_DEBUG("Fetching active faces");
m_nfdController.fetch<ndn::nfd::FaceDataset>(
- std::bind(&RibManager::removeInvalidFaces, this, _1),
- std::bind(&RibManager::onFetchActiveFacesFailure, this, _1, _2),
- ndn::nfd::CommandOptions());
+ [this] (auto&&... args) { removeInvalidFaces(std::forward<decltype(args)>(args)...); },
+ [this] (auto&&... args) { onFetchActiveFacesFailure(std::forward<decltype(args)>(args)...); });
}
void
diff --git a/daemon/mgmt/rib-manager.hpp b/daemon/mgmt/rib-manager.hpp
index 206ecc0..8589b0b 100644
--- a/daemon/mgmt/rib-manager.hpp
+++ b/daemon/mgmt/rib-manager.hpp
@@ -200,22 +200,19 @@
/** \brief Serve rib/register command.
*/
void
- registerEntry(const Name& topPrefix, const Interest& interest,
- ControlParameters parameters,
+ registerEntry(const Interest& interest, ControlParameters parameters,
const ndn::mgmt::CommandContinuation& done);
/** \brief Serve rib/unregister command.
*/
void
- unregisterEntry(const Name& topPrefix, const Interest& interest,
- ControlParameters parameters,
+ unregisterEntry(const Interest& interest, ControlParameters parameters,
const ndn::mgmt::CommandContinuation& done);
/** \brief Serve rib/list dataset.
*/
void
- listEntries(const Name& topPrefix, const Interest& interest,
- ndn::mgmt::StatusDatasetContext& context);
+ listEntries(ndn::mgmt::StatusDatasetContext& context);
void
setFaceForSelfRegistration(const Interest& request, ControlParameters& parameters);
diff --git a/daemon/mgmt/strategy-choice-manager.cpp b/daemon/mgmt/strategy-choice-manager.cpp
index fa18856..af74ee1 100644
--- a/daemon/mgmt/strategy-choice-manager.cpp
+++ b/daemon/mgmt/strategy-choice-manager.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -43,12 +43,11 @@
, m_table(strategyChoice)
{
registerCommandHandler<ndn::nfd::StrategyChoiceSetCommand>("set",
- std::bind(&StrategyChoiceManager::setStrategy, this, _4, _5));
+ [this] (auto&&, auto&&, auto&&, auto&&... args) { setStrategy(std::forward<decltype(args)>(args)...); });
registerCommandHandler<ndn::nfd::StrategyChoiceUnsetCommand>("unset",
- std::bind(&StrategyChoiceManager::unsetStrategy, this, _4, _5));
-
+ [this] (auto&&, auto&&, auto&&, auto&&... args) { unsetStrategy(std::forward<decltype(args)>(args)...); });
registerStatusDatasetHandler("list",
- std::bind(&StrategyChoiceManager::listChoices, this, _3));
+ [this] (auto&&, auto&&, auto&&... args) { listChoices(std::forward<decltype(args)>(args)...); });
}
void
diff --git a/daemon/rib/rib.cpp b/daemon/rib/rib.cpp
index 1d002a1..952cc9a 100644
--- a/daemon/rib/rib.cpp
+++ b/daemon/rib/rib.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -410,14 +410,16 @@
UpdateQueueItem item = std::move(m_updateBatches.front());
m_updateBatches.pop_front();
- RibUpdateBatch& batch = item.batch;
-
// Until task #1698, each RibUpdateBatch contains exactly one RIB update
- BOOST_ASSERT(batch.size() == 1);
+ BOOST_ASSERT(item.batch.size() == 1);
- auto fibSuccessCb = std::bind(&Rib::onFibUpdateSuccess, this, batch, _1, item.managerSuccessCallback);
- auto fibFailureCb = std::bind(&Rib::onFibUpdateFailure, this, item.managerFailureCallback, _1, _2);
- m_fibUpdater->computeAndSendFibUpdates(batch, fibSuccessCb, fibFailureCb);
+ m_fibUpdater->computeAndSendFibUpdates(item.batch,
+ [this, batch = item.batch, successCb = item.managerSuccessCallback] (const auto& routes) {
+ onFibUpdateSuccess(batch, routes, successCb);
+ },
+ [this, failureCb = item.managerFailureCallback] (const auto& code, const auto& error) {
+ onFibUpdateFailure(failureCb, code, error);
+ });
}
void
diff --git a/daemon/table/cs-policy-lru.cpp b/daemon/table/cs-policy-lru.cpp
index 80b5994..4ddecc2 100644
--- a/daemon/table/cs-policy-lru.cpp
+++ b/daemon/table/cs-policy-lru.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,7 +28,6 @@
namespace nfd::cs::lru {
-const std::string LruPolicy::POLICY_NAME = "lru";
NFD_REGISTER_CS_POLICY(LruPolicy);
LruPolicy::LruPolicy()
diff --git a/daemon/table/cs-policy-lru.hpp b/daemon/table/cs-policy-lru.hpp
index 9a62c6c..014a65f 100644
--- a/daemon/table/cs-policy-lru.hpp
+++ b/daemon/table/cs-policy-lru.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -43,16 +43,14 @@
>
>;
-/** \brief Least-Recently-Used (LRU) replacement policy.
+/**
+ * \brief Least-Recently-Used (LRU) replacement policy.
*/
class LruPolicy final : public Policy
{
public:
LruPolicy();
-public:
- static const std::string POLICY_NAME;
-
private:
void
doAfterInsert(EntryRef i) final;
@@ -69,12 +67,15 @@
void
evictEntries() final;
-private:
- /** \brief Moves an entry to the end of queue.
+ /**
+ * \brief Moves an entry to the end of queue.
*/
void
insertToQueue(EntryRef i, bool isNewEntry);
+public:
+ static constexpr std::string_view POLICY_NAME{"lru"};
+
private:
Queue m_queue;
};
diff --git a/daemon/table/cs-policy-priority-fifo.cpp b/daemon/table/cs-policy-priority-fifo.cpp
index 4405e66..ed0da6e 100644
--- a/daemon/table/cs-policy-priority-fifo.cpp
+++ b/daemon/table/cs-policy-priority-fifo.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,7 +29,6 @@
namespace nfd::cs::priority_fifo {
-const std::string PriorityFifoPolicy::POLICY_NAME = "priority_fifo";
NFD_REGISTER_CS_POLICY(PriorityFifoPolicy);
PriorityFifoPolicy::PriorityFifoPolicy()
diff --git a/daemon/table/cs-policy-priority-fifo.hpp b/daemon/table/cs-policy-priority-fifo.hpp
index eaa4c81..44ebe9e 100644
--- a/daemon/table/cs-policy-priority-fifo.hpp
+++ b/daemon/table/cs-policy-priority-fifo.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -68,9 +68,6 @@
~PriorityFifoPolicy() final;
-public:
- static const std::string POLICY_NAME;
-
private:
void
doAfterInsert(EntryRef i) final;
@@ -111,6 +108,9 @@
void
moveToStaleQueue(EntryRef i);
+public:
+ static constexpr std::string_view POLICY_NAME{"priority_fifo"};
+
private:
Queue m_queues[QUEUE_MAX];
std::map<EntryRef, EntryInfo*> m_entryInfoMap;
diff --git a/daemon/table/cs-policy.hpp b/daemon/table/cs-policy.hpp
index 748a45b..3291bda 100644
--- a/daemon/table/cs-policy.hpp
+++ b/daemon/table/cs-policy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -40,10 +40,10 @@
public: // registry
template<typename P>
static void
- registerPolicy(const std::string& policyName = P::POLICY_NAME)
+ registerPolicy(std::string_view policyName = P::POLICY_NAME)
{
BOOST_ASSERT(!policyName.empty());
- auto r = getRegistry().insert_or_assign(policyName, [] { return make_unique<P>(); });
+ auto r = getRegistry().insert_or_assign(std::string(policyName), [] { return make_unique<P>(); });
BOOST_VERIFY(r.second);
}
diff --git a/tests/daemon/face/generic-link-service.t.cpp b/tests/daemon/face/generic-link-service.t.cpp
index 06d9417..8346a31 100644
--- a/tests/daemon/face/generic-link-service.t.cpp
+++ b/tests/daemon/face/generic-link-service.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -580,7 +580,7 @@
options.allowCongestionMarking = true;
options.baseCongestionMarkingInterval = 100_ms;
initialize(options, MTU_UNLIMITED, 65536);
- BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
@@ -594,7 +594,7 @@
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
lp::Packet pkt1(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt1.count<lp::CongestionMarkField>(), 0);
- BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
@@ -604,7 +604,7 @@
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 2);
lp::Packet pkt2(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt2.count<lp::CongestionMarkField>(), 0);
- BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
}
@@ -615,7 +615,7 @@
options.allowCongestionMarking = true;
options.baseCongestionMarkingInterval = 100_ms;
initialize(options, MTU_UNLIMITED, 65536);
- BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
@@ -627,7 +627,7 @@
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
lp::Packet pkt0(transport->sentPackets.back());
BOOST_REQUIRE_EQUAL(pkt0.count<lp::CongestionMarkField>(), 0);
- time::steady_clock::TimePoint nextMarkTime = time::steady_clock::now() + 100_ms;
+ auto nextMarkTime = time::steady_clock::now() + 100_ms;
BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
time::nanoseconds markingInterval(
@@ -747,7 +747,7 @@
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 9);
lp::Packet pkt8(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt8.count<lp::CongestionMarkField>(), 0);
- BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 4);
@@ -823,7 +823,7 @@
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 14);
lp::Packet pkt13(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt13.count<lp::CongestionMarkField>(), 0);
- BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 6);
@@ -847,7 +847,7 @@
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 16);
lp::Packet pkt15(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt15.count<lp::CongestionMarkField>(), 0);
- BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 6);
}
@@ -858,7 +858,7 @@
options.allowCongestionMarking = true;
options.baseCongestionMarkingInterval = 100_ms;
initialize(options, MTU_UNLIMITED, QUEUE_UNSUPPORTED);
- BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
@@ -873,7 +873,7 @@
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
lp::Packet pkt1(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt1.count<lp::CongestionMarkField>(), 0);
- BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
@@ -883,7 +883,7 @@
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 2);
lp::Packet pkt2(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt2.count<lp::CongestionMarkField>(), 0);
- BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
@@ -893,7 +893,7 @@
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 3);
lp::Packet pkt3(transport->sentPackets.back());
BOOST_REQUIRE_EQUAL(pkt3.count<lp::CongestionMarkField>(), 0);
- time::steady_clock::TimePoint nextMarkTime = time::steady_clock::now() + 100_ms;
+ auto nextMarkTime = time::steady_clock::now() + 100_ms;
BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
diff --git a/tests/daemon/face/null-face.t.cpp b/tests/daemon/face/null-face.t.cpp
index 451f21c..e2a48b5 100644
--- a/tests/daemon/face/null-face.t.cpp
+++ b/tests/daemon/face/null-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -56,7 +56,7 @@
{
auto transport = make_unique<NullTransport>();
- BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::time_point::max());
}
BOOST_AUTO_TEST_CASE(SendQueue)
diff --git a/tests/daemon/face/unicast-ethernet-transport.t.cpp b/tests/daemon/face/unicast-ethernet-transport.t.cpp
index 6e4dd6b..373bcc3 100644
--- a/tests/daemon/face/unicast-ethernet-transport.t.cpp
+++ b/tests/daemon/face/unicast-ethernet-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -111,13 +111,13 @@
{
SKIP_IF_ETHERNET_NETIF_COUNT_LT(1);
initializeUnicast(nullptr, ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
- BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
+ BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::time_point::max());
transport->setPersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
- BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::time_point::max());
transport->setPersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
- BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
+ BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::time_point::max());
}
BOOST_AUTO_TEST_CASE(Close)
diff --git a/tests/daemon/face/unicast-udp-transport.t.cpp b/tests/daemon/face/unicast-udp-transport.t.cpp
index e69904a..b85747d 100644
--- a/tests/daemon/face/unicast-udp-transport.t.cpp
+++ b/tests/daemon/face/unicast-udp-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -67,13 +67,13 @@
BOOST_AUTO_TEST_CASE(ExpirationTime)
{
TRANSPORT_TEST_INIT(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
- BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
+ BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::time_point::max());
transport->setPersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
- BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
+ BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::time_point::max());
transport->setPersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
- BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
+ BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::time_point::max());
}
BOOST_AUTO_TEST_CASE(IdleClose)
diff --git a/tests/daemon/mgmt/face-manager-command-fixture.hpp b/tests/daemon/mgmt/face-manager-command-fixture.hpp
index ad354f3..1b7d0e9 100644
--- a/tests/daemon/mgmt/face-manager-command-fixture.hpp
+++ b/tests/daemon/mgmt/face-manager-command-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -48,7 +48,7 @@
findFaceIdByUri(const std::string& uri) const;
public:
- ndn::util::DummyClientFace face;
+ ndn::DummyClientFace face;
Dispatcher dispatcher;
shared_ptr<CommandAuthenticator> authenticator;
diff --git a/tests/daemon/mgmt/forwarder-status-manager.t.cpp b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
index e40a0ce..56db14a 100644
--- a/tests/daemon/mgmt/forwarder-status-manager.t.cpp
+++ b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -45,7 +45,7 @@
FaceTable m_faceTable;
Forwarder m_forwarder;
ForwarderStatusManager m_manager;
- time::system_clock::TimePoint m_startTime;
+ time::system_clock::time_point m_startTime;
};
BOOST_AUTO_TEST_SUITE(Mgmt)
diff --git a/tests/daemon/mgmt/manager-common-fixture.hpp b/tests/daemon/mgmt/manager-common-fixture.hpp
index b0ddf08..954cef2 100644
--- a/tests/daemon/mgmt/manager-common-fixture.hpp
+++ b/tests/daemon/mgmt/manager-common-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -146,7 +146,7 @@
concatenateResponses(size_t startIndex = 0, size_t nResponses = 0);
protected:
- ndn::util::DummyClientFace m_face{g_io, m_keyChain, {true, true}};
+ ndn::DummyClientFace m_face{g_io, m_keyChain, {true, true}};
Dispatcher m_dispatcher{m_face, m_keyChain};
std::vector<Data>& m_responses{m_face.sentData};
};
diff --git a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
index 1108a06..6c82d4a 100644
--- a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
+++ b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
@@ -178,7 +178,7 @@
unique_ptr<RibManager> manager;
private:
- ndn::util::DummyClientFace m_face;
+ ndn::DummyClientFace m_face;
ndn::nfd::Controller m_nfdController;
Dispatcher m_dispatcher;
MockFibUpdater m_fibUpdater;
diff --git a/tests/daemon/rib/fib-updates-common.hpp b/tests/daemon/rib/fib-updates-common.hpp
index 9ceaeab..33b549d 100644
--- a/tests/daemon/rib/fib-updates-common.hpp
+++ b/tests/daemon/rib/fib-updates-common.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -165,7 +165,7 @@
}
public:
- ndn::util::DummyClientFace face;
+ ndn::DummyClientFace face;
ndn::nfd::Controller controller;
rib::Rib rib;
diff --git a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
index 36ca585..85624c2 100644
--- a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
+++ b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -55,7 +55,7 @@
uint32_t nFailureCallbacks;
protected:
- ndn::util::DummyClientFace face;
+ ndn::DummyClientFace face;
ndn::nfd::Controller controller;
Rib rib;
NfdRibReadvertiseDestination dest;
diff --git a/tests/daemon/rib/readvertise/readvertise.t.cpp b/tests/daemon/rib/readvertise/readvertise.t.cpp
index 6242dfc..06f905f 100644
--- a/tests/daemon/rib/readvertise/readvertise.t.cpp
+++ b/tests/daemon/rib/readvertise/readvertise.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -157,7 +157,7 @@
unique_ptr<Readvertise> readvertise;
private:
- ndn::util::DummyClientFace m_face;
+ ndn::DummyClientFace m_face;
Rib m_rib;
};
diff --git a/tests/tools/mock-nfd-mgmt-fixture.hpp b/tests/tools/mock-nfd-mgmt-fixture.hpp
index 8f052eb..ede5568 100644
--- a/tests/tools/mock-nfd-mgmt-fixture.hpp
+++ b/tests/tools/mock-nfd-mgmt-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -204,7 +204,7 @@
}
protected:
- ndn::util::DummyClientFace face;
+ ndn::DummyClientFace face;
std::function<void(const Interest&)> processInterest;
};
diff --git a/tests/tools/ndn-autoconfig-server/program.t.cpp b/tests/tools/ndn-autoconfig-server/program.t.cpp
index c70cedd..ee99740 100644
--- a/tests/tools/ndn-autoconfig-server/program.t.cpp
+++ b/tests/tools/ndn-autoconfig-server/program.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -46,7 +46,7 @@
}
protected:
- util::DummyClientFace face{{true, true}};
+ DummyClientFace face{{true, true}};
unique_ptr<Program> program;
};
@@ -88,12 +88,11 @@
}
this->initialize(options);
- util::DummyClientFace clientFace(face.getIoService());
+ DummyClientFace clientFace(face.getIoService());
clientFace.linkTo(face);
Name baseName("/localhop/nfd/rib/routable-prefixes");
- auto fetcher = util::SegmentFetcher::start(clientFace, Interest(baseName),
- security::getAcceptAllValidator());
+ auto fetcher = SegmentFetcher::start(clientFace, Interest(baseName), security::getAcceptAllValidator());
fetcher->afterSegmentReceived.connect([baseName] (const Data& data) {
const Name& dataName = data.getName();
BOOST_CHECK_EQUAL(dataName.size(), baseName.size() + 2);
diff --git a/tests/tools/nfdc/status-report.t.cpp b/tests/tools/nfdc/status-report.t.cpp
index 04b9b86..dcf797c 100644
--- a/tests/tools/nfdc/status-report.t.cpp
+++ b/tests/tools/nfdc/status-report.t.cpp
@@ -149,7 +149,7 @@
}
protected:
- ndn::util::DummyClientFace face;
+ ndn::DummyClientFace face;
ValidatorNull validator;
ndn::nfd::Controller controller;
StatusReportTester report;
diff --git a/tools/ndn-autoconfig/procedure.hpp b/tools/ndn-autoconfig/procedure.hpp
index 0af3980..3f1f630 100644
--- a/tools/ndn-autoconfig/procedure.hpp
+++ b/tools/ndn-autoconfig/procedure.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -74,11 +74,12 @@
registerPrefixes(uint64_t hubFaceId, size_t index = 0);
public:
- /** \brief Signal when procedure completes.
+ /**
+ * \brief Signal emitted when the procedure completes.
*
- * Argument indicates whether the procedure succeeds (true) or fails (false).
+ * Argument indicates whether the procedure succeeds (true) or fails (false).
*/
- util::Signal<Procedure, bool> onComplete;
+ signal::Signal<Procedure, bool> onComplete;
NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE:
std::vector<unique_ptr<Stage>> m_stages;
diff --git a/tools/ndn-autoconfig/stage.hpp b/tools/ndn-autoconfig/stage.hpp
index 7c1247c..04d584d 100644
--- a/tools/ndn-autoconfig/stage.hpp
+++ b/tools/ndn-autoconfig/stage.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,7 +33,8 @@
namespace ndn::autoconfig {
-/** \brief A discovery stage.
+/**
+ * \brief A discovery stage.
*/
class Stage : boost::noncopyable
{
@@ -76,17 +77,19 @@
doStart() = 0;
public:
- /** \brief Signal when a HUB FaceUri is found.
+ /**
+ * \brief Signal emitted when a HUB FaceUri is found.
*
- * Argument is HUB FaceUri, may not be canonical.
+ * Argument is HUB FaceUri, may not be canonical.
*/
- util::Signal<Stage, FaceUri> onSuccess;
+ signal::Signal<Stage, FaceUri> onSuccess;
- /** \brief Signal when discovery fails.
+ /**
+ * \brief Signal emitted when discovery fails.
*
- * Argument is error message.
+ * Argument is error message.
*/
- util::Signal<Stage, std::string> onFailure;
+ signal::Signal<Stage, std::string> onFailure;
private:
bool m_isInProgress = false;