docs: fix capitalization in doxygen comments
Change-Id: Ibf5ee5119d12d60d382b0acef8dfd08277c18fcb
diff --git a/daemon/table/cleanup.hpp b/daemon/table/cleanup.hpp
index 3c84482..b1e95b1 100644
--- a/daemon/table/cleanup.hpp
+++ b/daemon/table/cleanup.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, 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,
@@ -32,10 +32,10 @@
namespace nfd {
-/** \brief cleanup tables when a face is destroyed
+/** \brief Cleanup tables when a face is destroyed.
*
- * This function enumerates the NameTree, calls Fib::removeNextHop for each FIB entry,
- * calls Pit::deleteInOutRecords for each PIT entry, and finally
+ * This function enumerates the NameTree, calls Fib::removeNextHop() for each FIB entry,
+ * calls Pit::deleteInOutRecords() for each PIT entry, and finally
* deletes any name tree entries that have become empty.
*
* \note It's a design choice to let Fib and Pit classes decide what to do with each entry.
diff --git a/daemon/table/cs-entry.hpp b/daemon/table/cs-entry.hpp
index a04f9f7..89f71f1 100644
--- a/daemon/table/cs-entry.hpp
+++ b/daemon/table/cs-entry.hpp
@@ -30,12 +30,12 @@
namespace nfd::cs {
-/** \brief a ContentStore entry
+/** \brief A ContentStore entry.
*/
class Entry
{
public: // exposed through ContentStore enumeration
- /** \brief return the stored Data
+ /** \brief Return the stored Data.
*/
const Data&
getData() const
@@ -43,7 +43,7 @@
return *m_data;
}
- /** \brief return stored Data name
+ /** \brief Return stored Data name.
*/
const Name&
getName() const
@@ -51,7 +51,7 @@
return m_data->getName();
}
- /** \brief return full name (including implicit digest) of the stored Data
+ /** \brief Return full name (including implicit digest) of the stored Data.
*/
const Name&
getFullName() const
@@ -59,7 +59,7 @@
return m_data->getFullName();
}
- /** \brief return whether the stored Data is unsolicited
+ /** \brief Return whether the stored Data is unsolicited.
*/
bool
isUnsolicited() const
@@ -67,12 +67,12 @@
return m_isUnsolicited;
}
- /** \brief check if the stored Data is fresh now
+ /** \brief Check if the stored Data is fresh now.
*/
bool
isFresh() const;
- /** \brief determine whether Interest can be satisified by the stored Data
+ /** \brief Determine whether Interest can be satisified by the stored Data.
*/
bool
canSatisfy(const Interest& interest) const;
@@ -80,12 +80,12 @@
public: // used by ContentStore implementation
Entry(shared_ptr<const Data> data, bool isUnsolicited);
- /** \brief recalculate when the entry would become non-fresh, relative to current time
+ /** \brief Recalculate when the entry would become non-fresh, relative to current time.
*/
void
updateFreshUntil();
- /** \brief clear 'unsolicited' flag
+ /** \brief Clear 'unsolicited' flag.
*/
void
clearUnsolicited()
@@ -96,7 +96,7 @@
private:
shared_ptr<const Data> m_data;
bool m_isUnsolicited;
- time::steady_clock::TimePoint m_freshUntil;
+ time::steady_clock::time_point m_freshUntil;
};
bool
@@ -108,7 +108,7 @@
bool
operator<(const Entry& lhs, const Entry& rhs);
-/** \brief an ordered container of ContentStore entries
+/** \brief An ordered container of ContentStore entries.
*
* This container uses std::less<> comparator to enable lookup with queryName.
*/
diff --git a/daemon/table/cs-policy-lru.hpp b/daemon/table/cs-policy-lru.hpp
index 8d7c814..9a62c6c 100644
--- a/daemon/table/cs-policy-lru.hpp
+++ b/daemon/table/cs-policy-lru.hpp
@@ -43,7 +43,7 @@
>
>;
-/** \brief Least-Recently-Used (LRU) replacement policy
+/** \brief Least-Recently-Used (LRU) replacement policy.
*/
class LruPolicy final : public Policy
{
@@ -70,7 +70,7 @@
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);
diff --git a/daemon/table/cs-policy-priority-fifo.hpp b/daemon/table/cs-policy-priority-fifo.hpp
index 48d1d66..eaa4c81 100644
--- a/daemon/table/cs-policy-priority-fifo.hpp
+++ b/daemon/table/cs-policy-priority-fifo.hpp
@@ -49,7 +49,7 @@
scheduler::EventId moveStaleEventId;
};
-/** \brief Priority FIFO replacement policy
+/** \brief Priority First-In-First-Out (FIFO) replacement policy.
*
* This policy maintains a set of cleanup queues to decide the eviction order of CS entries.
* The cleanup queues are three doubly linked lists that store EntryRefs.
@@ -88,25 +88,25 @@
evictEntries() final;
private:
- /** \brief evicts one entry
+ /** \brief Evicts one entry.
* \pre CS is not empty
*/
void
evictOne();
- /** \brief attaches the entry to an appropriate queue
+ /** \brief Attaches the entry to an appropriate queue.
* \pre the entry is not in any queue
*/
void
attachQueue(EntryRef i);
- /** \brief detaches the entry from its current queue
+ /** \brief Detaches the entry from its current queue.
* \post the entry is not in any queue
*/
void
detachQueue(EntryRef i);
- /** \brief moves an entry from FIFO queue to STALE queue
+ /** \brief Moves an entry from FIFO queue to STALE queue.
*/
void
moveToStaleQueue(EntryRef i);
diff --git a/daemon/table/cs-policy.hpp b/daemon/table/cs-policy.hpp
index de4c89c..748a45b 100644
--- a/daemon/table/cs-policy.hpp
+++ b/daemon/table/cs-policy.hpp
@@ -33,7 +33,7 @@
class Cs;
/**
- * \brief Represents a CS replacement policy
+ * \brief Represents a CS replacement policy.
*/
class Policy : noncopyable
{
@@ -47,13 +47,15 @@
BOOST_VERIFY(r.second);
}
- /** \return a cs::Policy identified by \p policyName,
- * or nullptr if \p policyName is unknown
+ /**
+ * \brief Returns a cs::Policy identified by \p policyName,
+ * or nullptr if \p policyName is unknown.
*/
static unique_ptr<Policy>
create(const std::string& policyName);
- /** \return a list of available policy names
+ /**
+ * \brief Returns a list of available policy names.
*/
static std::set<std::string>
getPolicyNames();
@@ -63,36 +65,39 @@
~Policy() = default;
const std::string&
- getName() const
+ getName() const noexcept
{
return m_policyName;
}
- /** \brief gets cs
+ /**
+ * \brief Returns a pointer to the associated CS instance.
*/
Cs*
- getCs() const
+ getCs() const noexcept
{
return m_cs;
}
- /** \brief sets cs
+ /**
+ * \brief Sets the associated CS instance.
*/
void
- setCs(Cs* cs)
+ setCs(Cs* cs) noexcept
{
m_cs = cs;
}
- /** \brief gets hard limit (in number of entries)
+ /**
+ * \brief Gets hard limit (in number of entries).
*/
size_t
- getLimit() const
+ getLimit() const noexcept
{
return m_limit;
}
- /** \brief sets hard limit (in number of entries)
+ /** \brief Sets hard limit (in number of entries).
* \post getLimit() == nMaxEntries
* \post cs.size() <= getLimit()
*
@@ -102,19 +107,19 @@
setLimit(size_t nMaxEntries);
public:
- /** \brief a reference to an CS entry
- * \note operator< of EntryRef compares the Data name enclosed in the Entry.
+ /** \brief A reference to a CS entry.
+ * \note `operator<` of EntryRef compares the Data name enclosed in the Entry.
*/
using EntryRef = Table::const_iterator;
- /** \brief emits when an entry is being evicted
+ /** \brief %Signal emitted when an entry is being evicted.
*
* A policy implementation should emit this signal to cause CS to erase an entry from its index.
* CS should connect to this signal and erase the entry upon signal emission.
*/
signal::Signal<Policy, EntryRef> beforeEvict;
- /** \brief invoked by CS after a new entry is inserted
+ /** \brief Invoked by CS after a new entry is inserted.
* \post cs.size() <= getLimit()
*
* The policy may evict entries if necessary.
@@ -123,20 +128,20 @@
void
afterInsert(EntryRef i);
- /** \brief invoked by CS after an existing entry is refreshed by same Data
+ /** \brief Invoked by CS after an existing entry is refreshed by same Data.
*
* The policy may witness this refresh to make better eviction decisions in the future.
*/
void
afterRefresh(EntryRef i);
- /** \brief invoked by CS before an entry is erased due to management command
+ /** \brief Invoked by CS before an entry is erased due to management command.
* \warning CS must not invoke this method if an entry is erased due to eviction.
*/
void
beforeErase(EntryRef i);
- /** \brief invoked by CS before an entry is used to match a lookup
+ /** \brief Invoked by CS before an entry is used to match a lookup.
*
* The policy may witness this usage to make better eviction decisions in the future.
*/
@@ -144,7 +149,7 @@
beforeUse(EntryRef i);
protected:
- /** \brief invoked after a new entry is created in CS
+ /** \brief Invoked after a new entry is created in CS.
*
* When overridden in a subclass, a policy implementation should decide whether to accept \p i.
* If \p i is accepted, it should be inserted into a cleanup index.
@@ -155,7 +160,7 @@
virtual void
doAfterInsert(EntryRef i) = 0;
- /** \brief invoked after an existing entry is refreshed by same Data
+ /** \brief Invoked after an existing entry is refreshed by same Data.
*
* When overridden in a subclass, a policy implementation may witness this operation
* and adjust its cleanup index.
@@ -163,7 +168,7 @@
virtual void
doAfterRefresh(EntryRef i) = 0;
- /** \brief invoked before an entry is erased due to management command
+ /** \brief Invoked before an entry is erased due to management command.
* \note This will not be invoked for an entry being evicted by policy.
*
* When overridden in a subclass, a policy implementation should erase \p i
@@ -172,7 +177,7 @@
virtual void
doBeforeErase(EntryRef i) = 0;
- /** \brief invoked before an entry is used to match a lookup
+ /** \brief Invoked before an entry is used to match a lookup.
*
* When overridden in a subclass, a policy implementation may witness this operation
* and adjust its cleanup index.
@@ -180,7 +185,7 @@
virtual void
doBeforeUse(EntryRef i) = 0;
- /** \brief evicts zero or more entries
+ /** \brief Evicts zero or more entries.
* \post CS size does not exceed hard limit
*/
virtual void
@@ -207,7 +212,7 @@
} // namespace nfd::cs
-/** \brief registers a CS policy
+/** \brief Registers a CS policy.
* \param P a subclass of nfd::cs::Policy
*/
#define NFD_REGISTER_CS_POLICY(P) \
diff --git a/daemon/table/cs.cpp b/daemon/table/cs.cpp
index 18d8fe2..3ad8bc9 100644
--- a/daemon/table/cs.cpp
+++ b/daemon/table/cs.cpp
@@ -157,7 +157,7 @@
}
void
-Cs::enableAdmit(bool shouldAdmit)
+Cs::enableAdmit(bool shouldAdmit) noexcept
{
if (m_shouldAdmit == shouldAdmit) {
return;
@@ -167,7 +167,7 @@
}
void
-Cs::enableServe(bool shouldServe)
+Cs::enableServe(bool shouldServe) noexcept
{
if (m_shouldServe == shouldServe) {
return;
diff --git a/daemon/table/cs.hpp b/daemon/table/cs.hpp
index cf91e17..a0bcbf6 100644
--- a/daemon/table/cs.hpp
+++ b/daemon/table/cs.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,7 +31,7 @@
namespace nfd {
namespace cs {
-/** \brief implements the Content Store
+/** \brief Implements the Content Store.
*
* This Content Store implementation consists of a Table and a replacement policy.
*
@@ -47,12 +47,12 @@
explicit
Cs(size_t nMaxPackets = 10);
- /** \brief inserts a Data packet
+ /** \brief Inserts a Data packet.
*/
void
insert(const Data& data, bool isUnsolicited = false);
- /** \brief asynchronously erases entries under \p prefix
+ /** \brief Asynchronously erases entries under \p prefix.
* \tparam AfterEraseCallback `void f(size_t nErased)`
* \param prefix name prefix of entries
* \param limit max number of entries to erase
@@ -67,7 +67,7 @@
cb(nErased);
}
- /** \brief finds the best matching Data packet
+ /** \brief Finds the best matching Data packet.
* \tparam HitCallback `void f(const Interest&, const Data&)`
* \tparam MissCallback `void f(const Interest&)`
* \param interest the Interest for lookup
@@ -88,7 +88,7 @@
hit(interest, match->getData());
}
- /** \brief get number of stored packets
+ /** \brief Get number of stored packets.
*/
size_t
size() const
@@ -97,15 +97,15 @@
}
public: // configuration
- /** \brief get capacity (in number of packets)
+ /** \brief Get capacity (in number of packets).
*/
size_t
- getLimit() const
+ getLimit() const noexcept
{
return m_policy->getLimit();
}
- /** \brief change capacity (in number of packets)
+ /** \brief Change capacity (in number of packets).
*/
void
setLimit(size_t nMaxPackets)
@@ -113,49 +113,49 @@
return m_policy->setLimit(nMaxPackets);
}
- /** \brief get replacement policy
+ /** \brief Get replacement policy.
*/
Policy*
- getPolicy() const
+ getPolicy() const noexcept
{
return m_policy.get();
}
- /** \brief change replacement policy
+ /** \brief Change replacement policy.
* \pre size() == 0
*/
void
setPolicy(unique_ptr<Policy> policy);
- /** \brief get CS_ENABLE_ADMIT flag
+ /** \brief Get CS_ENABLE_ADMIT flag.
* \sa https://redmine.named-data.net/projects/nfd/wiki/CsMgmt#Update-config
*/
bool
- shouldAdmit() const
+ shouldAdmit() const noexcept
{
return m_shouldAdmit;
}
- /** \brief set CS_ENABLE_ADMIT flag
+ /** \brief Set CS_ENABLE_ADMIT flag.
* \sa https://redmine.named-data.net/projects/nfd/wiki/CsMgmt#Update-config
*/
void
- enableAdmit(bool shouldAdmit);
+ enableAdmit(bool shouldAdmit) noexcept;
- /** \brief get CS_ENABLE_SERVE flag
+ /** \brief Get CS_ENABLE_SERVE flag.
* \sa https://redmine.named-data.net/projects/nfd/wiki/CsMgmt#Update-config
*/
bool
- shouldServe() const
+ shouldServe() const noexcept
{
return m_shouldServe;
}
- /** \brief set CS_ENABLE_SERVE flag
+ /** \brief Set CS_ENABLE_SERVE flag.
* \sa https://redmine.named-data.net/projects/nfd/wiki/CsMgmt#Update-config
*/
void
- enableServe(bool shouldServe);
+ enableServe(bool shouldServe) noexcept;
public: // enumeration
using const_iterator = Table::const_iterator;
diff --git a/daemon/table/fib-entry.hpp b/daemon/table/fib-entry.hpp
index c300208..03a2c2e 100644
--- a/daemon/table/fib-entry.hpp
+++ b/daemon/table/fib-entry.hpp
@@ -82,7 +82,7 @@
hasNextHop(const Face& face) const;
private:
- /** \brief adds a NextHop record to the entry
+ /** \brief Adds a NextHop record to the entry.
*
* If a NextHop record for \p face already exists in the entry, its cost is set to \p cost.
*
@@ -92,7 +92,7 @@
std::pair<NextHopList::iterator, bool>
addOrUpdateNextHop(Face& face, uint64_t cost);
- /** \brief removes a NextHop record
+ /** \brief Removes a NextHop record.
*
* If no NextHop record for face exists, do nothing.
*/
@@ -104,7 +104,7 @@
NextHopList::iterator
findNextHop(const Face& face);
- /** \brief sorts the nexthop list
+ /** \brief Sorts the nexthop list.
*/
void
sortNextHops();
diff --git a/daemon/table/fib.hpp b/daemon/table/fib.hpp
index 6073533..bfeedf8 100644
--- a/daemon/table/fib.hpp
+++ b/daemon/table/fib.hpp
@@ -43,7 +43,9 @@
namespace fib {
-/** \brief Represents the Forwarding Information Base (FIB)
+/**
+ * \brief Represents the Forwarding Information Base (FIB).
+ * \sa fib::Entry
*/
class Fib : noncopyable
{
@@ -52,32 +54,32 @@
Fib(NameTree& nameTree);
size_t
- size() const
+ size() const noexcept
{
return m_nItems;
}
public: // lookup
- /** \brief Performs a longest prefix match
+ /** \brief Performs a longest prefix match.
*/
const Entry&
findLongestPrefixMatch(const Name& prefix) const;
- /** \brief Performs a longest prefix match
+ /** \brief Performs a longest prefix match.
*
* This is equivalent to `findLongestPrefixMatch(pitEntry.getName())`
*/
const Entry&
findLongestPrefixMatch(const pit::Entry& pitEntry) const;
- /** \brief Performs a longest prefix match
+ /** \brief Performs a longest prefix match.
*
* This is equivalent to `findLongestPrefixMatch(measurementsEntry.getName())`
*/
const Entry&
findLongestPrefixMatch(const measurements::Entry& measurementsEntry) const;
- /** \brief Performs an exact match lookup
+ /** \brief Performs an exact match lookup.
*/
Entry*
findExactMatch(const Name& prefix);
@@ -91,7 +93,7 @@
return NameTree::getMaxDepth();
}
- /** \brief Find or insert a FIB entry
+ /** \brief Find or insert a FIB entry.
* \param prefix FIB entry name; it must not have more than \c getMaxDepth() components.
* \return the entry, and true for new entry or false for existing entry
*/
@@ -104,7 +106,7 @@
void
erase(const Entry& entry);
- /** \brief Add a NextHop record
+ /** \brief Add a NextHop record.
*
* If a NextHop record for \p face already exists in \p entry, its cost is set to \p cost.
*/
@@ -117,7 +119,7 @@
FIB_ENTRY_REMOVED ///< the nexthop is removed and the fib entry is removed
};
- /** \brief Remove the NextHop record for \p face from \p entry
+ /** \brief Remove the NextHop record for \p face from \p entry.
*/
RemoveNextHopResult
removeNextHop(Entry& entry, const Face& face);
@@ -147,7 +149,7 @@
}
public: // signal
- /** \brief signals on Fib entry nexthop creation
+ /** \brief Signals on Fib entry nexthop creation.
*/
signal::Signal<Fib, Name, NextHop> afterNewNextHop;
diff --git a/daemon/table/measurements-accessor.hpp b/daemon/table/measurements-accessor.hpp
index 244897b..9895beb 100644
--- a/daemon/table/measurements-accessor.hpp
+++ b/daemon/table/measurements-accessor.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, 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,
@@ -37,10 +37,11 @@
namespace measurements {
-/** \brief allows Strategy to access portion of Measurements table under its namespace
+/**
+ * \brief Allows fw::Strategy to access the portion of Measurements table under its namespace.
*
- * All public methods have the same semantics as the same method on \p Measurements,
- * but would return nullptr if the entry falls out of the strategy's authority.
+ * All public methods have the same semantics as the corresponding methods on Measurements,
+ * but will return nullptr if the entry falls out of the strategy's authority.
*/
class MeasurementsAccessor : noncopyable
{
@@ -50,46 +51,44 @@
~MeasurementsAccessor();
- /** \brief find or insert a Measurements entry for \p name
+ /** \brief Find or insert a Measurements entry for \p name.
*/
Entry*
get(const Name& name);
- /** \brief find or insert a Measurements entry for \p fibEntry->getPrefix()
+ /** \brief Find or insert a Measurements entry for \p fibEntry->getPrefix().
*/
Entry*
get(const fib::Entry& fibEntry);
- /** \brief find or insert a Measurements entry for \p pitEntry->getName()
+ /** \brief Find or insert a Measurements entry for \p pitEntry->getName().
*/
Entry*
get(const pit::Entry& pitEntry);
- /** \brief find or insert a Measurements entry for child's parent
+ /** \brief Find or insert a Measurements entry for child's parent.
*/
Entry*
getParent(const Entry& child);
- /** \brief perform a longest prefix match for \p name
+ /** \brief Perform a longest prefix match for \p name.
*/
Entry*
findLongestPrefixMatch(const Name& name,
- const EntryPredicate& pred =
- AnyEntry()) const;
+ const EntryPredicate& pred = AnyEntry()) const;
- /** \brief perform a longest prefix match for \p pitEntry.getName()
+ /** \brief Perform a longest prefix match for \p pitEntry.getName().
*/
Entry*
findLongestPrefixMatch(const pit::Entry& pitEntry,
- const EntryPredicate& pred =
- AnyEntry()) const;
+ const EntryPredicate& pred = AnyEntry()) const;
- /** \brief perform an exact match
+ /** \brief Perform an exact match.
*/
Entry*
findExactMatch(const Name& name) const;
- /** \brief extend lifetime of an entry
+ /** \brief Extend lifetime of an entry.
*
* The entry will be kept until at least now()+lifetime.
*/
@@ -97,7 +96,7 @@
extendLifetime(Entry& entry, const time::nanoseconds& lifetime);
private:
- /** \brief perform access control to Measurements entry
+ /** \brief Perform access control to Measurements entry.
* \return entry if strategy has access to namespace, otherwise nullptr
*/
Entry*
diff --git a/daemon/table/measurements-entry.hpp b/daemon/table/measurements-entry.hpp
index a3983ae..84624a2 100644
--- a/daemon/table/measurements-entry.hpp
+++ b/daemon/table/measurements-entry.hpp
@@ -50,14 +50,14 @@
}
const Name&
- getName() const
+ getName() const noexcept
{
return m_name;
}
private:
Name m_name;
- time::steady_clock::TimePoint m_expiry = time::steady_clock::TimePoint::min();
+ time::steady_clock::time_point m_expiry = time::steady_clock::time_point::min();
scheduler::EventId m_cleanup;
name_tree::Entry* m_nameTreeEntry = nullptr;
diff --git a/daemon/table/measurements.hpp b/daemon/table/measurements.hpp
index 342d753..1bd0eb7 100644
--- a/daemon/table/measurements.hpp
+++ b/daemon/table/measurements.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,
@@ -41,23 +41,26 @@
namespace measurements {
-/** \brief A predicate that accepts or rejects an entry
+/**
+ * \brief A predicate that accepts or rejects an entry.
*/
using EntryPredicate = std::function<bool(const Entry&)>;
-/** \brief An \c EntryPredicate that accepts any entry
+/**
+ * \brief An #EntryPredicate that accepts any entry.
*/
class AnyEntry
{
public:
- bool
- operator()(const Entry&) const
+ constexpr bool
+ operator()(const Entry&) const noexcept
{
return true;
}
};
-/** \brief An \c EntryPredicate that accepts an entry if it has StrategyInfo of type T
+/**
+ * \brief An #EntryPredicate that accepts an entry if it has StrategyInfo of type T.
*/
template<typename T>
class EntryWithStrategyInfo
@@ -70,11 +73,12 @@
}
};
-/** \brief The Measurements table
+/**
+ * \brief The %Measurements table.
*
- * The Measurements table is a data structure for forwarding strategies to store per name prefix
- * measurements. A strategy can access this table via \c Strategy::getMeasurements(), and then
- * place any object that derive from \c StrategyInfo type onto Measurements entries.
+ * The %Measurements table is a data structure for forwarding strategies to store per name prefix
+ * measurements. A strategy can access this table via fw::Strategy::getMeasurements(), and then
+ * place any object that derive from StrategyInfo type onto %Measurements entries.
*/
class Measurements : noncopyable
{
@@ -82,7 +86,7 @@
explicit
Measurements(NameTree& nameTree);
- /** \brief maximum depth of a Measurements entry
+ /** \brief Maximum depth of a %Measurements entry.
*/
static constexpr size_t
getMaxDepth()
@@ -90,44 +94,44 @@
return NameTree::getMaxDepth();
}
- /** \brief Find or insert an entry by name
+ /** \brief Find or insert an entry by name.
*
- * An entry name can have at most \c getMaxDepth() components. If \p name exceeds this limit,
- * it is truncated to the first \c getMaxDepth() components.
+ * An entry name can have at most getMaxDepth() components. If \p name exceeds this limit,
+ * it is truncated to the first getMaxDepth() components.
*/
Entry&
get(const Name& name);
- /** \brief Equivalent to `get(fibEntry.getPrefix())`
+ /** \brief Equivalent to `get(fibEntry.getPrefix())`.
*/
Entry&
get(const fib::Entry& fibEntry);
- /** \brief Equivalent to `get(pitEntry.getName(), std::min(pitEntry.getName().size(), getMaxDepth()))`
+ /** \brief Equivalent to `get(pitEntry.getName(), std::min(pitEntry.getName().size(), getMaxDepth()))`.
*/
Entry&
get(const pit::Entry& pitEntry);
- /** \brief Find or insert a parent entry
+ /** \brief Find or insert a parent entry.
* \retval nullptr child is the root entry
* \return get(child.getName().getPrefix(-1))
*/
Entry*
getParent(const Entry& child);
- /** \brief Perform a longest prefix match for \p name
+ /** \brief Perform a longest prefix match for \p name.
*/
Entry*
findLongestPrefixMatch(const Name& name,
const EntryPredicate& pred = AnyEntry()) const;
- /** \brief Perform a longest prefix match for `pitEntry.getName()`
+ /** \brief Perform a longest prefix match for `pitEntry.getName()`.
*/
Entry*
findLongestPrefixMatch(const pit::Entry& pitEntry,
const EntryPredicate& pred = AnyEntry()) const;
- /** \brief Perform an exact match
+ /** \brief Perform an exact match.
*/
Entry*
findExactMatch(const Name& name) const;
@@ -138,7 +142,7 @@
return 4_s;
}
- /** \brief Extend lifetime of an entry
+ /** \brief Extend lifetime of an entry.
*
* The entry will be kept until at least now()+lifetime.
*/
@@ -158,7 +162,7 @@
Entry&
get(name_tree::Entry& nte);
- /** \tparam K a parameter acceptable to \c NameTree::findLongestPrefixMatch
+ /** \tparam K a parameter acceptable to NameTree::findLongestPrefixMatch()
*/
template<typename K>
Entry*
diff --git a/daemon/table/name-tree-entry.hpp b/daemon/table/name-tree-entry.hpp
index 644d86b..8923d9c 100644
--- a/daemon/table/name-tree-entry.hpp
+++ b/daemon/table/name-tree-entry.hpp
@@ -35,7 +35,8 @@
class Node;
-/** \brief An entry in the name tree
+/**
+ * \brief An entry in the name tree.
*/
class Entry : noncopyable
{
@@ -43,7 +44,7 @@
Entry(const Name& prefix, Node* node);
const Name&
- getName() const
+ getName() const noexcept
{
return m_name;
}
@@ -52,12 +53,12 @@
* \retval nullptr this entry is the root entry, i.e. getName() == Name()
*/
Entry*
- getParent() const
+ getParent() const noexcept
{
return m_parent;
}
- /** \brief Set parent of this entry
+ /** \brief Set parent of this entry.
* \param entry entry of getName().getPrefix(-1)
* \pre getParent() == nullptr
* \post getParent() == &entry
@@ -66,14 +67,15 @@
void
setParent(Entry& entry);
- /** \brief Unset parent of this entry
+ /** \brief Unset parent of this entry.
* \post getParent() == nullptr
* \post parent.getChildren() does not contain this
*/
void
unsetParent();
- /** \brief Check whether this entry has any children
+ /**
+ * \brief Check whether this entry has any children.
*/
bool
hasChildren() const
@@ -81,10 +83,11 @@
return !m_children.empty();
}
- /** \return children of this entry
+ /**
+ * \brief Returns the children of this entry.
*/
const std::vector<Entry*>&
- getChildren() const
+ getChildren() const noexcept
{
return m_children;
}
@@ -176,14 +179,14 @@
friend Node* getNode(const Entry& entry);
};
-/** \brief a functor to get a table entry from a name tree entry
+/** \brief A functor to get a table entry from a name tree entry.
* \tparam ENTRY type of single table entry attached to name tree entry, such as fib::Entry
*/
template<typename ENTRY>
class GetTableEntry
{
public:
- /** \brief A function pointer to the getter on Entry class that returns ENTRY
+ /** \brief A function pointer to the getter on Entry class that returns ENTRY.
*/
using Getter = ENTRY* (Entry::*)() const;
diff --git a/daemon/table/name-tree-hashtable.hpp b/daemon/table/name-tree-hashtable.hpp
index de96d0a..1328c2e 100644
--- a/daemon/table/name-tree-hashtable.hpp
+++ b/daemon/table/name-tree-hashtable.hpp
@@ -32,27 +32,27 @@
class Entry;
-/** \brief a single hash value
+/** \brief A single hash value.
*/
using HashValue = size_t;
-/** \brief a sequence of hash values
+/** \brief A sequence of hash values.
* \sa computeHashes
*/
using HashSequence = std::vector<HashValue>;
-/** \brief computes hash value of \p name.getPrefix(prefixLen)
+/** \brief Computes hash value of \p name.getPrefix(prefixLen).
*/
HashValue
computeHash(const Name& name, size_t prefixLen = std::numeric_limits<size_t>::max());
-/** \brief computes hash values for each prefix of \p name.getPrefix(prefixLen)
+/** \brief Computes hash values for each prefix of \p name.getPrefix(prefixLen).
* \return a hash sequence, where the i-th hash value equals computeHash(name, i)
*/
HashSequence
computeHashes(const Name& name, size_t prefixLen = std::numeric_limits<size_t>::max());
-/** \brief a hashtable node
+/** \brief A hashtable node.
*
* Zero or more nodes can be added to a hashtable bucket. They are organized as
* a doubly linked list through prev and next pointers.
@@ -83,7 +83,7 @@
Node*
getNode(const Entry& entry);
-/** \brief invoke a function for each node in a doubly linked list
+/** \brief Invoke a function for each node in a doubly linked list.
* \tparam N either Node or const Node
* \tparam F a functor with signature void F(N*)
* \note It's safe to delete the node in the function.
@@ -100,50 +100,50 @@
}
}
-/** \brief provides options for Hashtable
+/**
+ * \brief Provides options for Hashtable.
*/
-class HashtableOptions
+struct HashtableOptions
{
-public:
- /** \brief constructor
+ /** \brief Constructor.
* \post initialSize == size
* \post minSize == size
*/
explicit
HashtableOptions(size_t size = 16);
-public:
- /** \brief initial number of buckets
+ /** \brief Initial number of buckets.
*/
size_t initialSize;
- /** \brief minimal number of buckets
+ /** \brief Minimal number of buckets.
*/
size_t minSize;
- /** \brief if hashtable has more than nBuckets*expandLoadFactor nodes, it will be expanded
+ /** \brief If the hashtable has more than `nBuckets*expandLoadFactor` nodes, it will be expanded.
*/
float expandLoadFactor = 0.5f;
- /** \brief when hashtable is expanded, its new size is nBuckets*expandFactor
+ /** \brief When the hashtable is expanded, its new size will be `nBuckets*expandFactor`.
*/
float expandFactor = 2.0f;
- /** \brief if hashtable has less than nBuckets*shrinkLoadFactor nodes, it will be shrunk
+ /** \brief If the hashtable has less than `nBuckets*shrinkLoadFactor` nodes, it will be shrunk.
*/
float shrinkLoadFactor = 0.1f;
- /** \brief when hashtable is shrunk, its new size is max(nBuckets*shrinkFactor, minSize)
+ /** \brief When the hashtable is shrunk, its new size will be `max(nBuckets*shrinkFactor, minSize)`.
*/
float shrinkFactor = 0.5f;
};
-/** \brief a hashtable for fast exact name lookup
+/**
+ * \brief A hashtable for fast exact name lookup.
*
- * The Hashtable contains a number of buckets.
- * Each node is placed into a bucket determined by a hash value computed from its name.
- * Hash collision is resolved through a doubly linked list in each bucket.
- * The number of buckets is adjusted according to how many nodes are stored.
+ * The Hashtable contains a number of buckets.
+ * Each node is placed into a bucket determined by a hash value computed from its name.
+ * Hash collision is resolved through a doubly linked list in each bucket.
+ * The number of buckets is adjusted according to how many nodes are stored.
*/
class Hashtable
{
@@ -153,7 +153,7 @@
explicit
Hashtable(const Options& options);
- /** \brief deallocates all nodes
+ /** \brief Deallocates all nodes.
*/
~Hashtable();
@@ -191,39 +191,39 @@
return m_buckets[bucket]; // don't use m_bucket.at() for better performance
}
- /** \brief find node for name.getPrefix(prefixLen)
+ /** \brief Find node for name.getPrefix(prefixLen).
* \pre name.size() > prefixLen
*/
const Node*
find(const Name& name, size_t prefixLen) const;
- /** \brief find node for name.getPrefix(prefixLen)
+ /** \brief Find node for name.getPrefix(prefixLen).
* \pre name.size() > prefixLen
* \pre hashes == computeHashes(name)
*/
const Node*
find(const Name& name, size_t prefixLen, const HashSequence& hashes) const;
- /** \brief find or insert node for name.getPrefix(prefixLen)
+ /** \brief Find or insert node for name.getPrefix(prefixLen).
* \pre name.size() > prefixLen
* \pre hashes == computeHashes(name)
*/
std::pair<const Node*, bool>
insert(const Name& name, size_t prefixLen, const HashSequence& hashes);
- /** \brief delete node
+ /** \brief Delete node.
* \pre node exists in this hashtable
*/
void
erase(Node* node);
private:
- /** \brief attach node to bucket
+ /** \brief Attach node to bucket.
*/
void
attach(size_t bucket, Node* node);
- /** \brief detach node from bucket
+ /** \brief Detach node from bucket.
*/
void
detach(size_t bucket, Node* node);
diff --git a/daemon/table/name-tree-iterator.cpp b/daemon/table/name-tree-iterator.cpp
index 001bb06..ecfe40d 100644
--- a/daemon/table/name-tree-iterator.cpp
+++ b/daemon/table/name-tree-iterator.cpp
@@ -37,18 +37,11 @@
NFD_LOG_INIT(NameTreeIterator);
-Iterator::Iterator()
- : m_entry(nullptr)
- , m_ref(nullptr)
- , m_state(0)
-{
-}
+Iterator::Iterator() = default;
Iterator::Iterator(shared_ptr<EnumerationImpl> impl, const Entry* ref)
: m_impl(std::move(impl))
- , m_entry(nullptr)
, m_ref(ref)
- , m_state(0)
{
m_impl->advance(*this);
NFD_LOG_TRACE("initialized " << *this);
diff --git a/daemon/table/name-tree-iterator.hpp b/daemon/table/name-tree-iterator.hpp
index 4a76a53..4458a3e 100644
--- a/daemon/table/name-tree-iterator.hpp
+++ b/daemon/table/name-tree-iterator.hpp
@@ -34,33 +34,36 @@
class NameTree;
-/** \brief a predicate to accept or reject an Entry in find operations
+/**
+ * \brief A predicate to accept or reject an Entry in find operations.
*/
using EntrySelector = std::function<bool(const Entry&)>;
-/** \brief an EntrySelector that accepts every Entry
+/**
+ * \brief An #EntrySelector that accepts every Entry.
*/
struct AnyEntry
{
- bool
- operator()(const Entry&) const
+ constexpr bool
+ operator()(const Entry&) const noexcept
{
return true;
}
};
-/** \brief a predicate to accept or reject an Entry and its children
+/** \brief A predicate to accept or reject an Entry and its children.
* \return `.first` indicates whether entry should be accepted;
* `.second` indicates whether entry's children should be visited
*/
using EntrySubTreeSelector = std::function<std::pair<bool, bool>(const Entry&)>;
-/** \brief an EntrySubTreeSelector that accepts every Entry and its children
+/**
+ * \brief An #EntrySubTreeSelector that accepts every Entry and its children.
*/
struct AnyEntrySubTree
{
- std::pair<bool, bool>
- operator()(const Entry&) const
+ constexpr std::pair<bool, bool>
+ operator()(const Entry&) const noexcept
{
return {true, true};
}
@@ -68,7 +71,8 @@
class EnumerationImpl;
-/** \brief NameTree iterator
+/**
+ * \brief NameTree iterator.
*/
class Iterator
{
@@ -113,21 +117,21 @@
}
private:
- /** \brief enumeration implementation; nullptr for end iterator
+ /** \brief Enumeration implementation; nullptr for end iterator.
*/
shared_ptr<EnumerationImpl> m_impl;
- /** \brief current entry; nullptr for uninitialized iterator
+ /** \brief Current entry; nullptr for uninitialized iterator.
*/
- const Entry* m_entry;
+ const Entry* m_entry = nullptr;
- /** \brief reference entry used by enumeration implementation
+ /** \brief Reference entry used by enumeration implementation.
*/
- const Entry* m_ref;
+ const Entry* m_ref = nullptr;
- /** \brief state used by enumeration implementation
+ /** \brief State used by enumeration implementation.
*/
- int m_state;
+ int m_state = 0;
friend std::ostream& operator<<(std::ostream&, const Iterator&);
friend class FullEnumerationImpl;
@@ -138,7 +142,7 @@
std::ostream&
operator<<(std::ostream& os, const Iterator& i);
-/** \brief enumeration operation implementation
+/** \brief Enumeration operation implementation.
*/
class EnumerationImpl
{
@@ -157,7 +161,7 @@
const Hashtable& ht;
};
-/** \brief full enumeration implementation
+/** \brief Full enumeration implementation.
*/
class FullEnumerationImpl final : public EnumerationImpl
{
@@ -171,7 +175,7 @@
EntrySelector m_pred;
};
-/** \brief partial enumeration implementation
+/** \brief Partial enumeration implementation.
*
* Iterator::m_ref should be initialized to subtree root.
* Iterator::m_state LSB indicates whether to visit children of m_entry.
@@ -188,7 +192,7 @@
EntrySubTreeSelector m_pred;
};
-/** \brief partial enumeration implementation
+/** \brief Partial enumeration implementation.
*
* Iterator::m_ref should be initialized to longest prefix matched entry.
*/
@@ -205,7 +209,7 @@
EntrySelector m_pred;
};
-/** \brief a Forward Range of name tree entries
+/** \brief A Forward Range of name tree entries.
*
* This type has .begin() and .end() methods which return Iterator.
* This type is usable with range-based for.
diff --git a/daemon/table/network-region-table.hpp b/daemon/table/network-region-table.hpp
index 96acf87..b4ee652 100644
--- a/daemon/table/network-region-table.hpp
+++ b/daemon/table/network-region-table.hpp
@@ -30,7 +30,7 @@
namespace nfd {
-/** \brief stores a collection of producer region names
+/** \brief Stores a collection of producer region names.
*
* This table is used in forwarding to process Interests with Link objects.
*
@@ -40,7 +40,7 @@
class NetworkRegionTable : public std::set<Name>
{
public:
- /** \brief determines whether an Interest has reached a producer region
+ /** \brief Determines whether an Interest has reached a producer region.
* \param forwardingHint forwarding hint of an Interest
* \retval true the Interest has reached a producer region
* \retval false the Interest has not reached a producer region
diff --git a/daemon/table/pit-entry.hpp b/daemon/table/pit-entry.hpp
index bc4f1d3..f612512 100644
--- a/daemon/table/pit-entry.hpp
+++ b/daemon/table/pit-entry.hpp
@@ -38,12 +38,12 @@
namespace nfd::pit {
/**
- * \brief An unordered collection of in-records
+ * \brief An unordered collection of in-records.
*/
using InRecordCollection = std::list<InRecord>;
/**
- * \brief An unordered collection of out-records
+ * \brief An unordered collection of out-records.
*/
using OutRecordCollection = std::list<OutRecord>;
@@ -134,24 +134,24 @@
return m_inRecords.end();
}
- /** \brief get the in-record for \p face
+ /** \brief Get the in-record for \p face.
* \return an iterator to the in-record, or in_end() if it does not exist
*/
InRecordCollection::iterator
getInRecord(const Face& face);
- /** \brief insert or update an in-record
+ /** \brief Insert or update an in-record.
* \return an iterator to the new or updated in-record
*/
InRecordCollection::iterator
insertOrUpdateInRecord(Face& face, const Interest& interest);
- /** \brief delete the in-record for \p face if it exists
+ /** \brief Delete the in-record for \p face if it exists.
*/
void
deleteInRecord(const Face& face);
- /** \brief delete all in-records
+ /** \brief Delete all in-records.
*/
void
clearInRecords();
@@ -201,35 +201,35 @@
return m_outRecords.end();
}
- /** \brief get the out-record for \p face
+ /** \brief Get the out-record for \p face.
* \return an iterator to the out-record, or out_end() if it does not exist
*/
OutRecordCollection::iterator
getOutRecord(const Face& face);
- /** \brief insert or update an out-record
+ /** \brief Insert or update an out-record.
* \return an iterator to the new or updated out-record
*/
OutRecordCollection::iterator
insertOrUpdateOutRecord(Face& face, const Interest& interest);
- /** \brief delete the out-record for \p face if it exists
+ /** \brief Delete the out-record for \p face if it exists.
*/
void
deleteOutRecord(const Face& face);
public:
- /** \brief Expiry timer
+ /** \brief Expiry timer.
*
* This timer is used in forwarding pipelines to delete the entry
*/
scheduler::EventId expiryTimer;
- /** \brief Indicates whether this PIT entry is satisfied
+ /** \brief Indicates whether this PIT entry is satisfied.
*/
bool isSatisfied = false;
- /** \brief Data freshness period
+ /** \brief Data freshness period.
* \note This field is meaningful only if isSatisfied is true
*/
time::milliseconds dataFreshnessPeriod = 0_ms;
diff --git a/daemon/table/pit-face-record.hpp b/daemon/table/pit-face-record.hpp
index edb0783..830316e 100644
--- a/daemon/table/pit-face-record.hpp
+++ b/daemon/table/pit-face-record.hpp
@@ -31,9 +31,10 @@
namespace nfd::pit {
-/** \brief Contains information about an Interest on an incoming or outgoing face
- * \note This is an implementation detail to extract common functionality
- * of InRecord and OutRecord
+/**
+ * \brief Contains information about an Interest on an incoming or outgoing face.
+ * \note This class is an implementation detail to extract common functionality
+ * of InRecord and OutRecord.
*/
class FaceRecord : public StrategyInfoHost
{
@@ -45,33 +46,33 @@
}
Face&
- getFace() const
+ getFace() const noexcept
{
return m_face;
}
Interest::Nonce
- getLastNonce() const
+ getLastNonce() const noexcept
{
return m_lastNonce;
}
- time::steady_clock::TimePoint
- getLastRenewed() const
+ time::steady_clock::time_point
+ getLastRenewed() const noexcept
{
return m_lastRenewed;
}
- /** \brief Returns the time point at which this record expires
+ /** \brief Returns the time point at which this record expires.
* \return getLastRenewed() + InterestLifetime
*/
- time::steady_clock::TimePoint
- getExpiry() const
+ time::steady_clock::time_point
+ getExpiry() const noexcept
{
return m_expiry;
}
- /** \brief updates lastNonce, lastRenewed, expiry fields
+ /** \brief Updates lastNonce, lastRenewed, expiry fields.
*/
void
update(const Interest& interest);
@@ -79,8 +80,8 @@
private:
Face& m_face;
Interest::Nonce m_lastNonce{0, 0, 0, 0};
- time::steady_clock::TimePoint m_lastRenewed = time::steady_clock::TimePoint::min();
- time::steady_clock::TimePoint m_expiry = time::steady_clock::TimePoint::min();
+ time::steady_clock::time_point m_lastRenewed = time::steady_clock::time_point::min();
+ time::steady_clock::time_point m_expiry = time::steady_clock::time_point::min();
};
} // namespace nfd::pit
diff --git a/daemon/table/pit-in-record.hpp b/daemon/table/pit-in-record.hpp
index c61f61d..95dc710 100644
--- a/daemon/table/pit-in-record.hpp
+++ b/daemon/table/pit-in-record.hpp
@@ -30,7 +30,8 @@
namespace nfd::pit {
-/** \brief Contains information about an Interest from an incoming face
+/**
+ * \brief Contains information about an Interest from an incoming face.
*/
class InRecord : public FaceRecord
{
@@ -38,7 +39,7 @@
using FaceRecord::FaceRecord;
const Interest&
- getInterest() const
+ getInterest() const noexcept
{
BOOST_ASSERT(m_interest != nullptr);
return *m_interest;
diff --git a/daemon/table/pit-iterator.hpp b/daemon/table/pit-iterator.hpp
index 014ddc1..2138b77 100644
--- a/daemon/table/pit-iterator.hpp
+++ b/daemon/table/pit-iterator.hpp
@@ -31,7 +31,8 @@
namespace nfd::pit {
-/** \brief PIT iterator
+/**
+ * \brief PIT iterator.
*/
class Iterator
{
@@ -42,7 +43,7 @@
using pointer = value_type*;
using reference = value_type&;
- /** \brief constructor
+ /** \brief Constructor.
* \param ntIt a name tree iterator that visits name tree entries with one or more PIT entries
* \param iPitEntry make this iterator to dereference to the i-th PIT entry in name tree entry
*/
diff --git a/daemon/table/pit-out-record.hpp b/daemon/table/pit-out-record.hpp
index aeb7523..f165370 100644
--- a/daemon/table/pit-out-record.hpp
+++ b/daemon/table/pit-out-record.hpp
@@ -30,42 +30,43 @@
namespace nfd::pit {
-/** \brief Contains information about an Interest toward an outgoing face
+/**
+ * \brief Contains information about an Interest toward an outgoing face.
*/
class OutRecord : public FaceRecord
{
public:
using FaceRecord::FaceRecord;
- /** \return last NACK returned by \p getFace()
+ /** \brief Returns the last NACK returned by getFace().
*
* A nullptr return value means the Interest is still pending or has timed out.
* A non-null return value means the last outgoing Interest has been NACKed.
*/
const lp::NackHeader*
- getIncomingNack() const
+ getIncomingNack() const noexcept
{
return m_incomingNack.get();
}
- /** \brief sets a NACK received from \p getFace()
+ /** \brief Sets a NACK received from getFace().
* \return whether incoming NACK is accepted
*
* This is invoked in incoming NACK pipeline.
- * An incoming NACK is accepted if its Nonce matches \p getLastNonce().
- * If accepted, \p nack.getHeader() will be copied,
- * and any pointer previously returned by \p .getIncomingNack() .
+ * An incoming NACK is accepted if its Nonce matches getLastNonce().
+ * If accepted, `nack.getHeader()` will be copied,
+ * and any pointer previously returned by getIncomingNack().
*/
bool
setIncomingNack(const lp::Nack& nack);
- /** \brief clears last NACK
+ /** \brief Clears last NACK.
*
* This is invoked in outgoing Interest pipeline.
- * This invalidates any pointer previously returned by \p .getIncomingNack() .
+ * This invalidates any pointer previously returned by getIncomingNack().
*/
void
- clearIncomingNack()
+ clearIncomingNack() noexcept
{
m_incomingNack.reset();
}