docs: fix capitalization in doxygen comments
Change-Id: Ibf5ee5119d12d60d382b0acef8dfd08277c18fcb
diff --git a/daemon/fw/access-strategy.hpp b/daemon/fw/access-strategy.hpp
index c33ad5c..194c9ca 100644
--- a/daemon/fw/access-strategy.hpp
+++ b/daemon/fw/access-strategy.hpp
@@ -35,16 +35,17 @@
namespace nfd::fw {
-/** \brief Access Router strategy
+/**
+ * \brief A forwarding strategy for "access" routers.
*
- * This strategy is designed for the last hop on the NDN testbed,
- * where each nexthop connects to a laptop, links are lossy, and FIB is mostly correct.
+ * This strategy is designed for the last hop on the NDN testbed,
+ * where each nexthop connects to a laptop, links are lossy, and FIB is mostly correct.
*
- * 1. Multicast the first Interest to all nexthops.
- * 2. When Data comes back, remember last working nexthop of the prefix;
- * the granularity of this knowledge is the parent of Data Name.
- * 3. Forward subsequent Interests to the last working nexthop.
- * If it doesn't respond, multicast again.
+ * 1. Multicast the first Interest to all nexthops.
+ * 2. When Data comes back, remember the last working nexthop of the prefix;
+ * the granularity of this knowledge is the parent of Data Name.
+ * 3. Forward subsequent Interests to the last working nexthop.
+ * If there is no reply, multicast again (step 1).
*/
class AccessStrategy : public Strategy
{
@@ -67,7 +68,7 @@
private: // StrategyInfo
using RttEstimator = ndn::util::RttEstimator;
- /** \brief StrategyInfo on PIT entry
+ /** \brief StrategyInfo on PIT entry.
*/
class PitInfo final : public StrategyInfo
{
@@ -82,7 +83,7 @@
scheduler::ScopedEventId rtoTimer;
};
- /** \brief StrategyInfo in measurements table
+ /** \brief StrategyInfo in measurements table.
*/
class MtInfo final : public StrategyInfo
{
@@ -104,18 +105,18 @@
RttEstimator rtt;
};
- /** \brief find per-prefix measurements for Interest
+ /** \brief Find per-prefix measurements for Interest.
*/
std::tuple<Name, MtInfo*>
findPrefixMeasurements(const pit::Entry& pitEntry);
- /** \brief get or create pre-prefix measurements for incoming Data
+ /** \brief Get or create pre-prefix measurements for incoming Data.
* \note This function creates MtInfo but doesn't update it.
*/
MtInfo*
addPrefixMeasurements(const Data& data);
- /** \brief global per-face StrategyInfo
+ /** \brief Global per-face StrategyInfo.
* \todo Currently stored inside AccessStrategy instance; should be moved
* to measurements table or somewhere else.
*/
@@ -141,7 +142,7 @@
afterReceiveRetxInterest(const Interest& interest, const FaceEndpoint& ingress,
const shared_ptr<pit::Entry>& pitEntry);
- /** \brief send to last working nexthop
+ /** \brief Send to last working nexthop.
* \return whether an Interest is sent
*/
bool
@@ -153,7 +154,7 @@
afterRtoTimeout(const weak_ptr<pit::Entry>& pitWeak,
FaceId inFaceId, FaceId firstOutFaceId);
- /** \brief multicast to all nexthops
+ /** \brief Multicast to all nexthops.
* \param exceptFace don't forward to this face; also, \p inFace is always excluded
* \return number of Interests that were sent
*/
diff --git a/daemon/fw/algorithm.hpp b/daemon/fw/algorithm.hpp
index 2ff4c2c..3ae3880 100644
--- a/daemon/fw/algorithm.hpp
+++ b/daemon/fw/algorithm.hpp
@@ -35,13 +35,13 @@
namespace nfd::fw {
-/** \brief determine whether forwarding the Interest in \p pitEntry to \p outFace would violate scope
+/** \brief Determine whether forwarding the Interest in \p pitEntry to \p outFace would violate scope.
* \sa https://redmine.named-data.net/projects/nfd/wiki/ScopeControl
*/
bool
wouldViolateScope(const Face& inFace, const Interest& interest, const Face& outFace);
-/** \brief indicates where duplicate Nonces are found
+/** \brief Indicates where duplicate Nonces are found.
*/
enum DuplicateNonceWhere {
DUPLICATE_NONCE_NONE = 0, ///< no duplicate Nonce is found
@@ -51,13 +51,13 @@
DUPLICATE_NONCE_OUT_OTHER = (1 << 3), ///< out-record of other face
};
-/** \brief determine whether \p pitEntry has duplicate Nonce \p nonce
+/** \brief Determine whether \p pitEntry has duplicate Nonce \p nonce.
* \return OR'ed DuplicateNonceWhere
*/
int
findDuplicateNonce(const pit::Entry& pitEntry, Interest::Nonce nonce, const Face& face);
-/** \brief determine whether \p pitEntry has any pending out-records
+/** \brief Determine whether \p pitEntry has any pending out-records.
* \return true if there is at least one out-record waiting for Data
*/
bool
@@ -66,10 +66,10 @@
/** \return last out-record time
* \pre pitEntry has one or more unexpired out-records
*/
-time::steady_clock::TimePoint
+time::steady_clock::time_point
getLastOutgoing(const pit::Entry& pitEntry);
-/** \brief pick an eligible NextHop with earliest out-record
+/** \brief Pick an eligible NextHop with earliest out-record.
* \note It is assumed that every nexthop has an out-record.
*/
fib::NextHopList::const_iterator
@@ -77,20 +77,20 @@
const fib::NextHopList& nexthops,
const shared_ptr<pit::Entry>& pitEntry);
-/** \brief determines whether a NextHop is eligible i.e. not the same inFace
+/** \brief Determines whether a NextHop is eligible, i.e., not the same \p inFace.
* \param inFace incoming face of current Interest
* \param interest incoming Interest
* \param nexthop next hop
* \param pitEntry PIT entry
* \param wantUnused if true, NextHop must not have unexpired out-record
- * \param now time::steady_clock::now(), ignored if !wantUnused
+ * \param now the current time, ignored if `wantUnused == false`
*/
bool
isNextHopEligible(const Face& inFace, const Interest& interest,
const fib::NextHop& nexthop,
const shared_ptr<pit::Entry>& pitEntry,
bool wantUnused = false,
- time::steady_clock::TimePoint now = time::steady_clock::TimePoint::min());
+ time::steady_clock::time_point now = time::steady_clock::time_point::min());
} // namespace nfd::fw
diff --git a/daemon/fw/asf-strategy.hpp b/daemon/fw/asf-strategy.hpp
index 0e6f3a2..b3d7396 100644
--- a/daemon/fw/asf-strategy.hpp
+++ b/daemon/fw/asf-strategy.hpp
@@ -34,12 +34,13 @@
namespace nfd::fw {
namespace asf {
-/** \brief Adaptive SRTT-based Forwarding Strategy
+/**
+ * \brief Adaptive SRTT-based forwarding strategy.
*
- * \see Vince Lehman, Ashlesh Gawande, Rodrigo Aldecoa, Dmitri Krioukov, Beichuan Zhang,
- * Lixia Zhang, and Lan Wang, "An Experimental Investigation of Hyperbolic Routing
- * with a Smart Forwarding Plane in NDN", NDN Technical Report NDN-0042, 2016.
- * https://named-data.net/publications/techreports/ndn-0042-1-asf/
+ * \see Vince Lehman, Ashlesh Gawande, Rodrigo Aldecoa, Dmitri Krioukov, Beichuan Zhang,
+ * Lixia Zhang, and Lan Wang, "An Experimental Investigation of Hyperbolic Routing
+ * with a Smart Forwarding Plane in NDN", NDN Technical Report NDN-0042, 2016.
+ * https://named-data.net/publications/techreports/ndn-0042-1-asf/
*/
class AsfStrategy : public Strategy
{
diff --git a/daemon/fw/best-route-strategy.hpp b/daemon/fw/best-route-strategy.hpp
index 484ac51..56e64a5 100644
--- a/daemon/fw/best-route-strategy.hpp
+++ b/daemon/fw/best-route-strategy.hpp
@@ -32,22 +32,23 @@
namespace nfd::fw {
-/** \brief Best Route strategy
+/**
+ * \brief "Best route" forwarding strategy.
*
- * This strategy forwards a new Interest to the lowest-cost nexthop (except downstream).
- * After that, if consumer retransmits the Interest (and is not suppressed according to
- * exponential backoff algorithm), the strategy forwards the Interest again to
- * the lowest-cost nexthop (except downstream) that is not previously used.
- * If all nexthops have been used, the strategy starts over with the first nexthop.
+ * This strategy forwards a new Interest to the lowest-cost nexthop (except downstream).
+ * After that, if consumer retransmits the Interest (and is not suppressed according to
+ * exponential backoff algorithm), the strategy forwards the Interest again to
+ * the lowest-cost nexthop (except downstream) that is not previously used.
+ * If all nexthops have been used, the strategy starts over with the first nexthop.
*
- * This strategy returns Nack to all downstreams with reason NoRoute
- * if there is no usable nexthop, which may be caused by:
+ * This strategy returns Nack to all downstreams with reason NoRoute
+ * if there is no usable nexthop, which may be caused by:
* (a) the FIB entry contains no nexthop;
* (b) the FIB nexthop happens to be the sole downstream;
* (c) the FIB nexthops violate scope.
*
- * 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.
+ * 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 BestRouteStrategy : public Strategy
, public ProcessNackTraits<BestRouteStrategy>
diff --git a/daemon/fw/face-table.cpp b/daemon/fw/face-table.cpp
index 93567bf..75b1190 100644
--- a/daemon/fw/face-table.cpp
+++ b/daemon/fw/face-table.cpp
@@ -36,20 +36,15 @@
NFD_LOG_INIT(FaceTable);
-FaceTable::FaceTable()
- : m_lastFaceId(face::FACEID_RESERVED_MAX)
-{
-}
-
Face*
-FaceTable::get(FaceId id) const
+FaceTable::get(FaceId id) const noexcept
{
auto i = m_faces.find(id);
return i == m_faces.end() ? nullptr : i->second.get();
}
size_t
-FaceTable::size() const
+FaceTable::size() const noexcept
{
return m_faces.size();
}
diff --git a/daemon/fw/face-table.hpp b/daemon/fw/face-table.hpp
index d1c51c7..b19530d 100644
--- a/daemon/fw/face-table.hpp
+++ b/daemon/fw/face-table.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,14 +33,13 @@
namespace nfd {
-/** \brief container of all faces
+/**
+ * \brief Container of all faces.
*/
class FaceTable : noncopyable
{
public:
- FaceTable();
-
- /** \brief add a face
+ /** \brief Add a face.
*
* FaceTable obtains shared ownership of the face.
* The channel or protocol factory that creates the face may retain ownership.
@@ -48,29 +47,26 @@
void
add(shared_ptr<Face> face);
- /** \brief add a special face with a reserved FaceId
+ /** \brief Add a special face with a reserved FaceId.
*/
void
addReserved(shared_ptr<Face> face, FaceId faceId);
- /** \brief get face by FaceId
- * \return a face if found, nullptr if not found;
- * face->shared_from_this() can be used if shared_ptr<Face> is desired
+ /** \brief Get face by FaceId.
+ * \return A pointer to the face if found, nullptr otherwise;
+ * `face->shared_from_this()` can be used if a `shared_ptr` is desired.
*/
Face*
- get(FaceId id) const;
+ get(FaceId id) const noexcept;
- /** \return count of faces
+ /** \brief Return the total number of faces.
*/
size_t
- size() const;
+ size() const noexcept;
public: // enumeration
using FaceMap = std::map<FaceId, shared_ptr<Face>>;
using ForwardRange = boost::indirected_range<const boost::select_second_const_range<FaceMap>>;
-
- /** \brief ForwardIterator for Face&
- */
using const_iterator = boost::range_iterator<ForwardRange>::type;
const_iterator
@@ -101,7 +97,7 @@
getForwardRange() const;
private:
- FaceId m_lastFaceId;
+ FaceId m_lastFaceId = face::FACEID_RESERVED_MAX;
FaceMap m_faces;
};
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index f4f5928..172331f 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -86,8 +86,6 @@
m_strategyChoice.setDefaultStrategy(getDefaultStrategyName());
}
-Forwarder::~Forwarder() = default;
-
void
Forwarder::onIncomingInterest(const Interest& interest, const FaceEndpoint& ingress)
{
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index 373d395..a2f2af7 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -56,144 +56,146 @@
explicit
Forwarder(FaceTable& faceTable);
- NFD_VIRTUAL_WITH_TESTS
- ~Forwarder();
+#ifdef NFD_WITH_TESTS
+ virtual
+ ~Forwarder() = default;
+#endif
const ForwarderCounters&
- getCounters() const
+ getCounters() const noexcept
{
return m_counters;
}
fw::UnsolicitedDataPolicy&
- getUnsolicitedDataPolicy() const
+ getUnsolicitedDataPolicy() const noexcept
{
return *m_unsolicitedDataPolicy;
}
void
- setUnsolicitedDataPolicy(unique_ptr<fw::UnsolicitedDataPolicy> policy)
+ setUnsolicitedDataPolicy(unique_ptr<fw::UnsolicitedDataPolicy> policy) noexcept
{
BOOST_ASSERT(policy != nullptr);
m_unsolicitedDataPolicy = std::move(policy);
}
NameTree&
- getNameTree()
+ getNameTree() noexcept
{
return m_nameTree;
}
Fib&
- getFib()
+ getFib() noexcept
{
return m_fib;
}
Pit&
- getPit()
+ getPit() noexcept
{
return m_pit;
}
Cs&
- getCs()
+ getCs() noexcept
{
return m_cs;
}
Measurements&
- getMeasurements()
+ getMeasurements() noexcept
{
return m_measurements;
}
StrategyChoice&
- getStrategyChoice()
+ getStrategyChoice() noexcept
{
return m_strategyChoice;
}
DeadNonceList&
- getDeadNonceList()
+ getDeadNonceList() noexcept
{
return m_deadNonceList;
}
NetworkRegionTable&
- getNetworkRegionTable()
+ getNetworkRegionTable() noexcept
{
return m_networkRegionTable;
}
- /** \brief register handler for forwarder section of NFD configuration file
+ /** \brief Register handler for forwarder section of NFD configuration file.
*/
void
setConfigFile(ConfigFile& configFile);
NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE: // pipelines
- /** \brief incoming Interest pipeline
+ /** \brief Incoming Interest pipeline.
* \param interest the incoming Interest, must be well-formed and created with make_shared
* \param ingress face on which \p interest was received and endpoint of the sender
*/
NFD_VIRTUAL_WITH_TESTS void
onIncomingInterest(const Interest& interest, const FaceEndpoint& ingress);
- /** \brief Interest loop pipeline
+ /** \brief Interest loop pipeline.
*/
NFD_VIRTUAL_WITH_TESTS void
onInterestLoop(const Interest& interest, const FaceEndpoint& ingress);
- /** \brief Content Store miss pipeline
+ /** \brief Content Store miss pipeline.
*/
NFD_VIRTUAL_WITH_TESTS void
onContentStoreMiss(const Interest& interest, const FaceEndpoint& ingress,
const shared_ptr<pit::Entry>& pitEntry);
- /** \brief Content Store hit pipeline
+ /** \brief Content Store hit pipeline.
*/
NFD_VIRTUAL_WITH_TESTS void
onContentStoreHit(const Interest& interest, const FaceEndpoint& ingress,
const shared_ptr<pit::Entry>& pitEntry, const Data& data);
- /** \brief outgoing Interest pipeline
+ /** \brief Outgoing Interest pipeline.
* \return A pointer to the out-record created or nullptr if the Interest was dropped
*/
NFD_VIRTUAL_WITH_TESTS pit::OutRecord*
onOutgoingInterest(const Interest& interest, Face& egress,
const shared_ptr<pit::Entry>& pitEntry);
- /** \brief Interest finalize pipeline
+ /** \brief Interest finalize pipeline.
*/
NFD_VIRTUAL_WITH_TESTS void
onInterestFinalize(const shared_ptr<pit::Entry>& pitEntry);
- /** \brief incoming Data pipeline
+ /** \brief Incoming Data pipeline.
* \param data the incoming Data, must be well-formed and created with make_shared
* \param ingress face on which \p data was received and endpoint of the sender
*/
NFD_VIRTUAL_WITH_TESTS void
onIncomingData(const Data& data, const FaceEndpoint& ingress);
- /** \brief Data unsolicited pipeline
+ /** \brief Data unsolicited pipeline.
*/
NFD_VIRTUAL_WITH_TESTS void
onDataUnsolicited(const Data& data, const FaceEndpoint& ingress);
- /** \brief outgoing Data pipeline
+ /** \brief Outgoing Data pipeline.
* \return Whether the Data was transmitted (true) or dropped (false)
*/
NFD_VIRTUAL_WITH_TESTS bool
onOutgoingData(const Data& data, Face& egress);
- /** \brief incoming Nack pipeline
+ /** \brief Incoming Nack pipeline.
* \param nack the incoming Nack, must be well-formed
* \param ingress face on which \p nack is received and endpoint of the sender
*/
NFD_VIRTUAL_WITH_TESTS void
onIncomingNack(const lp::Nack& nack, const FaceEndpoint& ingress);
- /** \brief outgoing Nack pipeline
+ /** \brief Outgoing Nack pipeline.
* \return Whether the Nack was transmitted (true) or dropped (false)
*/
NFD_VIRTUAL_WITH_TESTS bool
@@ -207,12 +209,12 @@
onNewNextHop(const Name& prefix, const fib::NextHop& nextHop);
private:
- /** \brief set a new expiry timer (now + \p duration) on a PIT entry
+ /** \brief Set a new expiry timer (now + \p duration) on a PIT entry.
*/
void
setExpiryTimer(const shared_ptr<pit::Entry>& pitEntry, time::milliseconds duration);
- /** \brief insert Nonce to Dead Nonce List if necessary
+ /** \brief Insert Nonce to Dead Nonce List if necessary.
* \param upstream if null, insert Nonces from all out-records;
* if not null, insert Nonce only on the out-records of this face
*/
@@ -225,7 +227,7 @@
NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
/**
- * \brief Configuration options from "forwarder" section
+ * \brief Configuration options from the `forwarder` section.
*/
struct Config
{
diff --git a/daemon/fw/multicast-strategy.hpp b/daemon/fw/multicast-strategy.hpp
index 6abbb38..da01018 100644
--- a/daemon/fw/multicast-strategy.hpp
+++ b/daemon/fw/multicast-strategy.hpp
@@ -31,7 +31,8 @@
namespace nfd::fw {
-/** \brief A forwarding strategy that forwards Interests to all FIB nexthops
+/**
+ * \brief A forwarding strategy that forwards Interests to all FIB nexthops.
*/
class MulticastStrategy : public Strategy
{
diff --git a/daemon/fw/random-strategy.hpp b/daemon/fw/random-strategy.hpp
index 31b1e26..4150d9f 100644
--- a/daemon/fw/random-strategy.hpp
+++ b/daemon/fw/random-strategy.hpp
@@ -31,9 +31,10 @@
namespace nfd::fw {
-/** \brief A forwarding strategy that randomly chooses a nexthop
+/**
+ * \brief A forwarding strategy that randomly chooses a nexthop.
*
- * Sends the incoming Interest to a random outgoing face, excluding the incoming face.
+ * Sends the incoming Interest to a random outgoing face, excluding the incoming face.
*/
class RandomStrategy : public Strategy
, public ProcessNackTraits<RandomStrategy>
diff --git a/daemon/fw/retx-suppression-exponential.cpp b/daemon/fw/retx-suppression-exponential.cpp
index 6d8cdcb..39af1f5 100644
--- a/daemon/fw/retx-suppression-exponential.cpp
+++ b/daemon/fw/retx-suppression-exponential.cpp
@@ -46,9 +46,7 @@
}
public:
- /** \brief if last transmission occurred within suppressionInterval,
- * retransmission will be suppressed
- */
+ // If the last transmission occurred within this interval, retx will be suppressed
RetxSuppressionExponential::Duration suppressionInterval;
};
diff --git a/daemon/fw/retx-suppression-exponential.hpp b/daemon/fw/retx-suppression-exponential.hpp
index fd8e2c6..82dec6c 100644
--- a/daemon/fw/retx-suppression-exponential.hpp
+++ b/daemon/fw/retx-suppression-exponential.hpp
@@ -51,19 +51,19 @@
Duration maxInterval = DEFAULT_MAX_INTERVAL,
float multiplier = DEFAULT_MULTIPLIER);
- /** \brief determines whether Interest is a retransmission per pit entry
- * and if so, whether it shall be forwarded or suppressed
+ /** \brief Determines whether Interest is a retransmission per pit entry
+ * and if so, whether it shall be forwarded or suppressed.
*/
RetxSuppressionResult
decidePerPitEntry(pit::Entry& pitEntry);
- /** \brief determines whether Interest is a retransmission per upstream
- * and if so, whether it shall be forwarded or suppressed
+ /** \brief Determines whether Interest is a retransmission per upstream
+ * and if so, whether it shall be forwarded or suppressed.
*/
RetxSuppressionResult
decidePerUpstream(pit::Entry& pitEntry, Face& outFace);
- /** \brief Increment the suppression interval for out record
+ /** \brief Increment the suppression interval for out record.
*/
void
incrementIntervalForOutRecord(pit::OutRecord& outRecord);
diff --git a/daemon/fw/retx-suppression-fixed.hpp b/daemon/fw/retx-suppression-fixed.hpp
index fdd1114..7090b99 100644
--- a/daemon/fw/retx-suppression-fixed.hpp
+++ b/daemon/fw/retx-suppression-fixed.hpp
@@ -31,8 +31,9 @@
namespace nfd::fw {
-/** \brief a retransmission suppression decision algorithm that
- * suppresses retransmissions within a fixed duration
+/**
+ * \brief A retransmission suppression decision algorithm that
+ * suppresses retransmissions within a fixed duration.
*/
class RetxSuppressionFixed
{
@@ -40,8 +41,8 @@
explicit
RetxSuppressionFixed(const time::milliseconds& minRetxInterval = DEFAULT_MIN_RETX_INTERVAL);
- /** \brief determines whether Interest is a retransmission,
- * and if so, whether it shall be forwarded or suppressed
+ /** \brief Determines whether Interest is a retransmission,
+ * and if so, whether it shall be forwarded or suppressed.
*/
RetxSuppressionResult
decidePerPitEntry(pit::Entry& pitEntry) const;
diff --git a/daemon/fw/scope-prefix.hpp b/daemon/fw/scope-prefix.hpp
index 9b48b22..cbc5d1c 100644
--- a/daemon/fw/scope-prefix.hpp
+++ b/daemon/fw/scope-prefix.hpp
@@ -28,12 +28,12 @@
#include "core/common.hpp"
-/** \brief contain name prefixes that affect namespace-based scope control
+/** \brief Contain name prefixes that affect namespace-based scope control.
* \sa https://redmine.named-data.net/projects/nfd/wiki/ScopeControl
*/
namespace nfd::scope_prefix {
-/** \brief ndn:/localhost
+/** \brief The localhost scope `ndn:/localhost`.
*
* The localhost scope limits propagation to the applications on the originating host.
*
@@ -43,7 +43,7 @@
*/
inline const Name LOCALHOST{"/localhost"};
-/** \brief ndn:/localhop
+/** \brief The localhop scope `ndn:/localhop`.
*
* The localhop scope limits propagation to no further than the next node.
*
diff --git a/daemon/fw/self-learning-strategy.hpp b/daemon/fw/self-learning-strategy.hpp
index 59cf98b..665d24e 100644
--- a/daemon/fw/self-learning-strategy.hpp
+++ b/daemon/fw/self-learning-strategy.hpp
@@ -32,12 +32,13 @@
namespace nfd::fw {
-/** \brief Self-learning forwarding strategy
+/**
+ * \brief Self-learning forwarding strategy.
*
- * This strategy first broadcasts Interest to learn a single path towards data,
- * then unicasts subsequent Interests along the learned path.
+ * This strategy first broadcasts Interest to learn a single path towards data,
+ * then unicasts subsequent Interests along the learned path.
*
- * \see https://redmine.named-data.net/attachments/864/Self-learning-strategy-v1.pdf
+ * \see https://redmine.named-data.net/attachments/864/Self-learning-strategy-v1.pdf
*/
class SelfLearningStrategy : public Strategy
{
@@ -90,7 +91,7 @@
const shared_ptr<pit::Entry>& pitEntry) override;
private: // operations
- /** \brief Send an Interest to all possible faces
+ /** \brief Send an Interest to all possible faces.
*
* This function is invoked when the forwarder has no matching FIB entries for
* an incoming discovery Interest, which will be forwarded to faces that
@@ -102,7 +103,7 @@
broadcastInterest(const Interest& interest, const Face& inFace,
const shared_ptr<pit::Entry>& pitEntry);
- /** \brief Send an Interest to \p nexthops
+ /** \brief Send an Interest to \p nexthops.
*/
void
multicastInterest(const Interest& interest, const Face& inFace,
@@ -110,12 +111,12 @@
const fib::NextHopList& nexthops);
/** \brief Find a Prefix Announcement for the Data on the RIB thread, and forward
- * the Data with the Prefix Announcement on the main thread
+ * the Data with the Prefix Announcement on the main thread.
*/
void
asyncProcessData(const shared_ptr<pit::Entry>& pitEntry, const Face& inFace, const Data& data);
- /** \brief Check whether a PrefixAnnouncement needs to be attached to an incoming Data
+ /** \brief Check whether a PrefixAnnouncement needs to be attached to an incoming Data.
*
* The conditions that a Data packet requires a PrefixAnnouncement are
* - the incoming Interest was discovery and
@@ -125,13 +126,13 @@
static bool
needPrefixAnn(const shared_ptr<pit::Entry>& pitEntry);
- /** \brief Add a route using RibManager::slAnnounce on the RIB thread
+ /** \brief Add a route using RibManager::slAnnounce on the RIB thread.
*/
void
addRoute(const shared_ptr<pit::Entry>& pitEntry, const Face& inFace,
const Data& data, const ndn::PrefixAnnouncement& pa);
- /** \brief renew a route using RibManager::slRenew on the RIB thread
+ /** \brief Renew a route using RibManager::slRenew on the RIB thread.
*/
void
renewRoute(const Name& name, FaceId inFaceId, time::milliseconds maxLifetime);
diff --git a/daemon/fw/strategy-info.hpp b/daemon/fw/strategy-info.hpp
index db6e9e6..fdf457b 100644
--- a/daemon/fw/strategy-info.hpp
+++ b/daemon/fw/strategy-info.hpp
@@ -30,7 +30,8 @@
namespace nfd::fw {
-/** \brief Contains arbitrary information placed by the forwarding strategy on table entries
+/**
+ * \brief Contains arbitrary information placed by the forwarding strategy on table entries.
*/
class StrategyInfo
{
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index ce8ba23..285e1a8 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -36,16 +36,17 @@
class StrategyParameters;
/**
- * \brief Represents a forwarding strategy
+ * \brief Base class of all forwarding strategies.
*/
class Strategy : noncopyable
{
public: // registry
- /** \brief Register a strategy type
- * \tparam S subclass of Strategy
- * \param strategyName strategy program name, must contain version
- * \note It is permitted to register the same strategy type under multiple names,
- * which is useful in tests and for creating aliases.
+ /**
+ * \brief Register a strategy type.
+ * \tparam S subclass of Strategy
+ * \param strategyName strategy program name, must contain version
+ * \note It is permitted to register the same strategy type under multiple names,
+ * which is useful in tests and for creating aliases.
*/
template<typename S>
static void
@@ -59,30 +60,34 @@
BOOST_VERIFY(r.second);
}
- /** \return Whether a strategy instance can be created from \p instanceName
- * \param instanceName strategy instance name, may contain version and parameters
- * \note This function finds a strategy type using same rules as \p create ,
- * but does not attempt to construct an instance.
+ /**
+ * \brief Returns whether a strategy instance can be created from \p instanceName.
+ * \param instanceName strategy instance name, may contain version and parameters
+ * \note This function finds a strategy type using the same rules as create(),
+ * but does not attempt to construct an instance.
*/
static bool
canCreate(const Name& instanceName);
- /** \return A strategy instance created from \p instanceName
- * \retval nullptr if `canCreate(instanceName) == false`
- * \throw std::invalid_argument strategy type constructor does not accept
- * specified version or parameters
+ /**
+ * \brief Returns a strategy instance created from \p instanceName.
+ * \retval nullptr if `canCreate(instanceName) == false`
+ * \throw std::invalid_argument strategy type constructor does not accept the
+ * specified version or parameters
*/
static unique_ptr<Strategy>
create(const Name& instanceName, Forwarder& forwarder);
- /** \return Whether \p instanceNameA and \p instanceNameA will initiate same strategy type
+ /**
+ * \brief Returns whether two names will instantiate the same strategy type.
*/
static bool
areSameType(const Name& instanceNameA, const Name& instanceNameB);
- /** \return Registered versioned strategy names
+ /**
+ * \brief Returns all registered versioned strategy names.
*/
- static std::set<Name>
+ [[nodiscard]] static std::set<Name>
listRegistered();
public: // constructor, destructor, strategy info
@@ -97,22 +102,24 @@
~Strategy();
#ifdef DOXYGEN
- /** \return Strategy program name
+ /**
+ * \brief Returns the strategy's program name.
*
- * The strategy name is defined by the strategy program.
- * It must end with a version component.
+ * The strategy name is defined by the strategy program.
+ * It must end with a version component.
*/
static const Name&
getStrategyName();
#endif
- /** \return Strategy instance name
+ /**
+ * \brief Returns the strategy's instance name.
*
- * The instance name is assigned during instantiation.
- * It contains a version component, and may have extra parameter components.
+ * The instance name is assigned during instantiation.
+ * It contains a version component and may have extra parameter components.
*/
const Name&
- getInstanceName() const
+ getInstanceName() const noexcept
{
return m_name;
}
@@ -356,19 +363,19 @@
lookupFib(const pit::Entry& pitEntry) const;
MeasurementsAccessor&
- getMeasurements()
+ getMeasurements() noexcept
{
return m_measurements;
}
Face*
- getFace(FaceId id) const
+ getFace(FaceId id) const noexcept
{
return getFaceTable().get(id);
}
const FaceTable&
- getFaceTable() const
+ getFaceTable() const noexcept
{
return m_forwarder.m_faceTable;
}
@@ -405,7 +412,7 @@
* \note This must be called by strategy subclass constructor.
*/
void
- setInstanceName(const Name& name)
+ setInstanceName(const Name& name) noexcept
{
m_name = name;
}