Add more `noexcept`
Change-Id: Ifcb411b9c7cd562276df615db86c9dac3ede9afb
diff --git a/ndn-cxx/encoding/block.cpp b/ndn-cxx/encoding/block.cpp
index bccb706..b4bbd02 100644
--- a/ndn-cxx/encoding/block.cpp
+++ b/ndn-cxx/encoding/block.cpp
@@ -480,7 +480,7 @@
}
bool
-operator==(const Block& lhs, const Block& rhs)
+operator==(const Block& lhs, const Block& rhs) noexcept
{
return lhs.type() == rhs.type() &&
lhs.value_size() == rhs.value_size() &&
diff --git a/ndn-cxx/encoding/block.hpp b/ndn-cxx/encoding/block.hpp
index 4f9e840..81269c8 100644
--- a/ndn-cxx/encoding/block.hpp
+++ b/ndn-cxx/encoding/block.hpp
@@ -367,14 +367,14 @@
encode();
/** @brief Return the first sub-element of the specified TLV-TYPE
- * @pre parse() has been executed
+ * @pre parse() has been called
* @throw tlv::Error a sub-element of the specified type does not exist
*/
const Block&
get(uint32_t type) const;
/** @brief Find the first sub-element of the specified TLV-TYPE
- * @pre parse() has been executed
+ * @pre parse() has been called
* @return iterator in elements() to the found sub-element, or elements_end() if no such
* sub-element exists in elements()
*/
@@ -382,7 +382,7 @@
find(uint32_t type) const;
/** @brief Remove all sub-elements of the specified TLV-TYPE
- * @pre parse() has been executed
+ * @pre parse() has been called
* @post `find(type) == elements_end()`
*/
void
@@ -418,41 +418,46 @@
element_iterator
insert(element_const_iterator pos, const Block& element);
- /** @brief Get container of sub-elements
- * @pre parse() has been executed
+ /**
+ * @brief Get container of sub-elements.
+ * @pre parse() has been called.
*/
const element_container&
- elements() const
+ elements() const noexcept
{
return m_elements;
}
- /** @brief Equivalent to elements().begin()
+ /**
+ * @brief Equivalent to `elements().begin()`.
*/
element_const_iterator
- elements_begin() const
+ elements_begin() const noexcept
{
return m_elements.begin();
}
- /** @brief Equivalent to elements().end()
+ /**
+ * @brief Equivalent to `elements().end()`.
*/
element_const_iterator
- elements_end() const
+ elements_end() const noexcept
{
return m_elements.end();
}
- /** @brief Equivalent to elements().size()
+ /**
+ * @brief Equivalent to `elements().size()`.
*/
size_t
- elements_size() const
+ elements_size() const noexcept
{
return m_elements.size();
}
public: // misc
- /** @brief Implicit conversion to `boost::asio::const_buffer`
+ /**
+ * @brief Implicit conversion to `boost::asio::const_buffer`.
*/
operator boost::asio::const_buffer() const;
@@ -492,26 +497,29 @@
uint32_t m_type = tlv::Invalid; ///< TLV-TYPE
- /** @brief Total size including Type-Length-Value
+ /**
+ * @brief Total size including Type-Length-Value.
*
- * This field is meaningful only if isValid() is true.
+ * This field is meaningful only if isValid() is true.
*/
size_t m_size = 0;
- /** @brief Contains the sub-elements
+ /**
+ * @brief Contains the sub-elements.
*
- * This field is valid only if parse() has been executed.
+ * This field is valid only if parse() has been called on the Block instance.
*/
mutable element_container m_elements;
- /** @brief Print @p block to @p os.
+ /**
+ * @brief Print @p block to @p os.
*
- * Default-constructed Block is printed as: `[invalid]`.
- * Zero-length Block is printed as: `TT[empty]`, where TT is TLV-TYPE in decimal.
- * Non-zero-length Block on which parse() has not been called is printed as: `TT[LL]=VVVV`,
- * where LL is TLV-LENGTH in decimal, and VVVV is TLV-VALUE in hexadecimal.
- * Block on which parse() has been called is printed as: `TT[LL]={SUB,SUB}`,
- * where each SUB is a sub-element printed using this format.
+ * Default-constructed Block is printed as: `[invalid]`.
+ * Zero-length Block is printed as: `TT[empty]`, where TT is TLV-TYPE in decimal.
+ * Non-zero-length Block on which parse() has not been called is printed as: `TT[LL]=VVVV`,
+ * where LL is TLV-LENGTH in decimal, and VVVV is TLV-VALUE in hexadecimal.
+ * Block on which parse() has been called is printed as: `TT[LL]={SUB,SUB}`,
+ * where each SUB is a sub-element printed using this format.
*/
friend std::ostream&
operator<<(std::ostream& os, const Block& block);
@@ -523,13 +531,14 @@
inline Block&
Block::operator=(Block&&) noexcept = default;
-/** @brief Compare whether two Blocks have same TLV-TYPE, TLV-LENGTH, and TLV-VALUE
+/**
+ * @brief Compare whether two Blocks have the same TLV-TYPE, TLV-LENGTH, and TLV-VALUE.
*/
bool
-operator==(const Block& lhs, const Block& rhs);
+operator==(const Block& lhs, const Block& rhs) noexcept;
inline bool
-operator!=(const Block& lhs, const Block& rhs)
+operator!=(const Block& lhs, const Block& rhs) noexcept
{
return !(lhs == rhs);
}
diff --git a/ndn-cxx/encoding/tlv.hpp b/ndn-cxx/encoding/tlv.hpp
index a892736..a5f842f 100644
--- a/ndn-cxx/encoding/tlv.hpp
+++ b/ndn-cxx/encoding/tlv.hpp
@@ -182,7 +182,7 @@
* @sa https://named-data.net/doc/NDN-packet-spec/0.3/tlv.html#considerations-for-evolvability-of-tlv-based-encoding
*/
constexpr bool
-isCriticalType(uint32_t type)
+isCriticalType(uint32_t type) noexcept
{
return type <= 31 || (type & 0x01);
}
diff --git a/ndn-cxx/interest-filter.hpp b/ndn-cxx/interest-filter.hpp
index ac4600d..66d6cd2 100644
--- a/ndn-cxx/interest-filter.hpp
+++ b/ndn-cxx/interest-filter.hpp
@@ -122,21 +122,23 @@
return *m_regexFilter;
}
- /** \brief Get whether Interest loopback is allowed.
+ /**
+ * \brief Get whether Interest loopback is allowed.
*/
NDN_CXX_NODISCARD bool
- allowsLoopback() const
+ allowsLoopback() const noexcept
{
return m_allowsLoopback;
}
- /** \brief Set whether Interest loopback is allowed.
- * \param wantLoopback if true, this InterestFilter may receive Interests that are expressed
- * locally on the same \p ndn::Face ; if false, this InterestFilter can only
- * receive Interests received from the forwarder. The default is true.
+ /**
+ * \brief Set whether Interest loopback is allowed.
+ * \param wantLoopback If true, this InterestFilter may receive Interests that are expressed
+ * locally on the same Face; if false, this InterestFilter can only
+ * receive Interests received from the forwarder. The default is true.
*/
InterestFilter&
- allowLoopback(bool wantLoopback)
+ allowLoopback(bool wantLoopback) noexcept
{
m_allowsLoopback = wantLoopback;
return *this;
diff --git a/ndn-cxx/name-component.cpp b/ndn-cxx/name-component.cpp
index 0c80361..a18818a 100644
--- a/ndn-cxx/name-component.cpp
+++ b/ndn-cxx/name-component.cpp
@@ -46,7 +46,7 @@
static Convention g_conventionDecoding = Convention::EITHER;
Convention
-getConventionEncoding()
+getConventionEncoding() noexcept
{
return g_conventionEncoding;
}
@@ -65,7 +65,7 @@
}
Convention
-getConventionDecoding()
+getConventionDecoding() noexcept
{
return g_conventionDecoding;
}
@@ -77,13 +77,13 @@
}
static bool
-canDecodeMarkerConvention()
+canDecodeMarkerConvention() noexcept
{
return (to_underlying(g_conventionDecoding) & to_underlying(Convention::MARKER)) != 0;
}
static bool
-canDecodeTypedConvention()
+canDecodeTypedConvention() noexcept
{
return (to_underlying(g_conventionDecoding) & to_underlying(Convention::TYPED)) != 0;
}
@@ -220,49 +220,49 @@
////////////////////////////////////////////////////////////////////////////////
bool
-Component::isNumber() const
+Component::isNumber() const noexcept
{
return value_size() == 1 || value_size() == 2 ||
value_size() == 4 || value_size() == 8;
}
bool
-Component::isNumberWithMarker(uint8_t marker) const
+Component::isNumberWithMarker(uint8_t marker) const noexcept
{
return (value_size() == 2 || value_size() == 3 ||
value_size() == 5 || value_size() == 9) && value()[0] == marker;
}
bool
-Component::isSegment() const
+Component::isSegment() const noexcept
{
return (canDecodeMarkerConvention() && type() == tlv::GenericNameComponent && isNumberWithMarker(SEGMENT_MARKER)) ||
(canDecodeTypedConvention() && type() == tlv::SegmentNameComponent && isNumber());
}
bool
-Component::isByteOffset() const
+Component::isByteOffset() const noexcept
{
return (canDecodeMarkerConvention() && type() == tlv::GenericNameComponent && isNumberWithMarker(SEGMENT_OFFSET_MARKER)) ||
(canDecodeTypedConvention() && type() == tlv::ByteOffsetNameComponent && isNumber());
}
bool
-Component::isVersion() const
+Component::isVersion() const noexcept
{
return (canDecodeMarkerConvention() && type() == tlv::GenericNameComponent && isNumberWithMarker(VERSION_MARKER)) ||
(canDecodeTypedConvention() && type() == tlv::VersionNameComponent && isNumber());
}
bool
-Component::isTimestamp() const
+Component::isTimestamp() const noexcept
{
return (canDecodeMarkerConvention() && type() == tlv::GenericNameComponent && isNumberWithMarker(TIMESTAMP_MARKER)) ||
(canDecodeTypedConvention() && type() == tlv::TimestampNameComponent && isNumber());
}
bool
-Component::isSequenceNumber() const
+Component::isSequenceNumber() const noexcept
{
return (canDecodeMarkerConvention() && type() == tlv::GenericNameComponent && isNumberWithMarker(SEQUENCE_NUMBER_MARKER)) ||
(canDecodeTypedConvention() && type() == tlv::SequenceNumNameComponent && isNumber());
@@ -425,7 +425,7 @@
////////////////////////////////////////////////////////////////////////////////
bool
-Component::isImplicitSha256Digest() const
+Component::isImplicitSha256Digest() const noexcept
{
return type() == tlv::ImplicitSha256DigestComponent && value_size() == util::Sha256::DIGEST_SIZE;
}
@@ -443,7 +443,7 @@
}
bool
-Component::isParametersSha256Digest() const
+Component::isParametersSha256Digest() const noexcept
{
return type() == tlv::ParametersSha256DigestComponent && value_size() == util::Sha256::DIGEST_SIZE;
}
@@ -463,7 +463,7 @@
////////////////////////////////////////////////////////////////////////////////
bool
-Component::equals(const Component& other) const
+Component::equals(const Component& other) const noexcept
{
return type() == other.type() &&
value_size() == other.value_size() &&
diff --git a/ndn-cxx/name-component.hpp b/ndn-cxx/name-component.hpp
index 31cf2d4..b83d8e9 100644
--- a/ndn-cxx/name-component.hpp
+++ b/ndn-cxx/name-component.hpp
@@ -66,29 +66,33 @@
SEQUENCE_NUMBER_MARKER = 0xFE,
};
-/** @brief Return which Naming Conventions style to use while encoding.
+/**
+ * @brief Return which Naming Conventions style to use while encoding.
*
- * The library default is Convention::TYPED.
+ * The library default is Convention::TYPED.
*/
Convention
-getConventionEncoding();
+getConventionEncoding() noexcept;
-/** @brief Set which Naming Conventions style to use while encoding.
- * @param convention either Convention::MARKER or Convention::TYPED.
+/**
+ * @brief Set which Naming Conventions style to use while encoding.
+ * @param convention Either Convention::MARKER or Convention::TYPED.
*/
void
setConventionEncoding(Convention convention);
-/** @brief Return which Naming Conventions style(s) to accept while decoding.
+/**
+ * @brief Return which Naming Conventions style(s) to accept while decoding.
*
- * The current library default is Convention::EITHER, but this will change in the future.
+ * The current library default is Convention::EITHER, but this may change in the future.
*/
Convention
-getConventionDecoding();
+getConventionDecoding() noexcept;
-/** @brief Set which Naming Conventions style(s) to accept while decoding.
- * @param convention Convention::MARKER or Convention::TYPED accepts the specified style only;
- * Convention::EITHER accepts either.
+/**
+ * @brief Set which Naming Conventions style(s) to accept while decoding.
+ * @param convention Convention::MARKER or Convention::TYPED accepts the specified style only;
+ * Convention::EITHER accepts either.
*/
void
setConventionDecoding(Convention convention);
@@ -294,7 +298,7 @@
* @sa https://named-data.net/doc/NDN-packet-spec/current/tlv.html#non-negative-integer-encoding
*/
bool
- isNumber() const;
+ isNumber() const noexcept;
/**
* @brief Check if the component is a NameComponentWithMarker per NDN naming conventions rev1
@@ -302,42 +306,42 @@
* https://named-data.net/wp-content/uploads/2014/08/ndn-tr-22-ndn-memo-naming-conventions.pdf
*/
bool
- isNumberWithMarker(uint8_t marker) const;
+ isNumberWithMarker(uint8_t marker) const noexcept;
/**
* @brief Check if the component is a segment number per NDN naming conventions
* @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
bool
- isSegment() const;
+ isSegment() const noexcept;
/**
* @brief Check if the component is a byte offset per NDN naming conventions
* @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
bool
- isByteOffset() const;
+ isByteOffset() const noexcept;
/**
* @brief Check if the component is a version per NDN naming conventions
* @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
bool
- isVersion() const;
+ isVersion() const noexcept;
/**
* @brief Check if the component is a timestamp per NDN naming conventions
* @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
bool
- isTimestamp() const;
+ isTimestamp() const noexcept;
/**
* @brief Check if the component is a sequence number per NDN naming conventions
* @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
bool
- isSequenceNumber() const;
+ isSequenceNumber() const noexcept;
/**
* @brief Interpret this name component as a NonNegativeInteger
@@ -484,7 +488,7 @@
* @sa https://named-data.net/doc/NDN-packet-spec/0.3/name.html#implicit-digest-component
*/
bool
- isImplicitSha256Digest() const;
+ isImplicitSha256Digest() const noexcept;
/**
* @brief Create ImplicitSha256DigestComponent component
@@ -508,7 +512,7 @@
* @sa https://named-data.net/doc/NDN-packet-spec/0.3/name.html#parameters-digest-component
*/
bool
- isParametersSha256Digest() const;
+ isParametersSha256Digest() const noexcept;
/**
* @brief Create ParametersSha256DigestComponent component
@@ -538,7 +542,7 @@
public: // comparison
NDN_CXX_NODISCARD bool
- empty() const
+ empty() const noexcept
{
return value_size() == 0;
}
@@ -550,7 +554,7 @@
* @return true if the components are equal, otherwise false.
*/
bool
- equals(const Component& other) const;
+ equals(const Component& other) const noexcept;
/**
* @brief Compare this to the other Component using NDN canonical ordering
@@ -605,13 +609,13 @@
// argument-dependent lookup only and must be defined inline.
friend bool
- operator==(const Component& lhs, const Component& rhs)
+ operator==(const Component& lhs, const Component& rhs) noexcept
{
return lhs.equals(rhs);
}
friend bool
- operator!=(const Component& lhs, const Component& rhs)
+ operator!=(const Component& lhs, const Component& rhs) noexcept
{
return !lhs.equals(rhs);
}
diff --git a/ndn-cxx/name.cpp b/ndn-cxx/name.cpp
index 567bd46..8966281 100644
--- a/ndn-cxx/name.cpp
+++ b/ndn-cxx/name.cpp
@@ -297,7 +297,7 @@
}
bool
-Name::isPrefixOf(const Name& other) const
+Name::isPrefixOf(const Name& other) const noexcept
{
// This name is longer than the name we are checking against.
if (size() > other.size())
@@ -313,7 +313,7 @@
}
bool
-Name::equals(const Name& other) const
+Name::equals(const Name& other) const noexcept
{
if (size() != other.size())
return false;
diff --git a/ndn-cxx/name.hpp b/ndn-cxx/name.hpp
index 36c579b..2ee37d3 100644
--- a/ndn-cxx/name.hpp
+++ b/ndn-cxx/name.hpp
@@ -139,29 +139,32 @@
deepCopy() const;
public: // access
- /** @brief Checks if the name is empty, i.e. has no components.
+ /**
+ * @brief Checks if the name is empty, i.e., has no components.
*/
NDN_CXX_NODISCARD bool
- empty() const
+ empty() const noexcept
{
return m_wire.elements().empty();
}
- /** @brief Returns the number of components.
+ /**
+ * @brief Returns the number of components.
*/
size_t
- size() const
+ size() const noexcept
{
return m_wire.elements_size();
}
- /** @brief Returns an immutable reference to the component at the specified index.
- * @param i zero-based index of the component to return;
- * if negative, it is interpreted as offset from the end of the name
- * @warning No bounds checking is performed, using an out-of-range index is undefined behavior.
+ /**
+ * @brief Returns an immutable reference to the component at the specified index.
+ * @param i zero-based index of the component to return;
+ * if negative, it is interpreted as offset from the end of the name
+ * @warning No bounds checking is performed, using an out-of-range index is undefined behavior.
*/
const Component&
- get(ssize_t i) const
+ get(ssize_t i) const noexcept
{
if (i < 0) {
i += static_cast<ssize_t>(size());
@@ -169,19 +172,21 @@
return static_cast<const Component&>(m_wire.elements()[static_cast<size_t>(i)]);
}
- /** @brief Equivalent to `get(i)`.
+ /**
+ * @brief Equivalent to get().
*/
const Component&
- operator[](ssize_t i) const
+ operator[](ssize_t i) const noexcept
{
return get(i);
}
- /** @brief Returns an immutable reference to the component at the specified index,
- * with bounds checking.
- * @param i zero-based index of the component to return;
- * if negative, it is interpreted as offset from the end of the name
- * @throws Error The index is out of bounds.
+ /**
+ * @brief Returns an immutable reference to the component at the specified index,
+ * with bounds checking.
+ * @param i zero-based index of the component to return;
+ * if negative, it is interpreted as offset from the end of the name
+ * @throws Error The index is out of bounds.
*/
const Component&
at(ssize_t i) const;
@@ -190,7 +195,7 @@
* @param iStartComponent zero-based index of the first component;
* if negative, size()+iStartComponent is used instead
* @param nComponents number of desired components, starting at @p iStartComponent;
- * use @c npos to return all components until the end of the name
+ * use #npos to return all components until the end of the name
* @return a new PartialName containing the extracted components
*
* If @p iStartComponent is positive and indexes out of bounds, returns an empty PartialName.
@@ -220,7 +225,7 @@
/** @brief Begin iterator.
*/
const_iterator
- begin() const
+ begin() const noexcept
{
return reinterpret_cast<const_iterator>(m_wire.elements().data());
}
@@ -228,7 +233,7 @@
/** @brief End iterator.
*/
const_iterator
- end() const
+ end() const noexcept
{
return reinterpret_cast<const_iterator>(m_wire.elements().data() + m_wire.elements().size());
}
@@ -236,7 +241,7 @@
/** @brief Reverse begin iterator.
*/
const_reverse_iterator
- rbegin() const
+ rbegin() const noexcept
{
return const_reverse_iterator(end());
}
@@ -244,7 +249,7 @@
/** @brief Reverse end iterator.
*/
const_reverse_iterator
- rend() const
+ rend() const noexcept
{
return const_reverse_iterator(begin());
}
@@ -598,7 +603,7 @@
* @retval false this name is not a prefix of @p other
*/
bool
- isPrefixOf(const Name& other) const;
+ isPrefixOf(const Name& other) const noexcept;
/** @brief Check if this name equals another name.
*
@@ -606,7 +611,7 @@
* are equal.
*/
bool
- equals(const Name& other) const;
+ equals(const Name& other) const noexcept;
/** @brief Compare this to the other Name using NDN canonical ordering.
*
@@ -649,13 +654,13 @@
// argument-dependent lookup only and must be defined inline.
friend bool
- operator==(const Name& lhs, const Name& rhs)
+ operator==(const Name& lhs, const Name& rhs) noexcept
{
return lhs.equals(rhs);
}
friend bool
- operator!=(const Name& lhs, const Name& rhs)
+ operator!=(const Name& lhs, const Name& rhs) noexcept
{
return !lhs.equals(rhs);
}
@@ -684,8 +689,9 @@
return lhs.compare(rhs) >= 0;
}
- /** @brief Print the URI representation of a name.
- * @sa https://named-data.net/doc/NDN-packet-spec/0.3/name.html#ndn-uri-scheme
+ /**
+ * @brief Print the URI representation of a name.
+ * @sa https://named-data.net/doc/NDN-packet-spec/0.3/name.html#ndn-uri-scheme
*/
friend std::ostream&
operator<<(std::ostream& os, const Name& name)
@@ -695,7 +701,8 @@
}
public:
- /** @brief Indicates "until the end" in getSubName() and compare().
+ /**
+ * @brief Indicates "until the end" in getSubName() and compare().
*/
static const size_t npos;
@@ -705,8 +712,9 @@
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Name);
-/** @brief Parse URI from stream as Name.
- * @sa https://named-data.net/doc/NDN-packet-spec/0.3/name.html#ndn-uri-scheme
+/**
+ * @brief Parse URI from stream as Name.
+ * @sa https://named-data.net/doc/NDN-packet-spec/0.3/name.html#ndn-uri-scheme
*/
std::istream&
operator>>(std::istream& is, Name& name);
diff --git a/ndn-cxx/net/network-monitor-stub.hpp b/ndn-cxx/net/network-monitor-stub.hpp
index 054a85a..25f8849 100644
--- a/ndn-cxx/net/network-monitor-stub.hpp
+++ b/ndn-cxx/net/network-monitor-stub.hpp
@@ -35,45 +35,47 @@
class NetworkMonitorStub : public NetworkMonitor
{
public:
- /** \brief Constructor.
- * \param capabilities capabilities reported by \p getCapabilities
+ /**
+ * \brief Constructor.
+ * \param capabilities The capabilities reported by getCapabilities()
*/
explicit
NetworkMonitorStub(uint32_t capabilities);
- /** \brief Create a NetworkInterface instance.
+ /**
+ * \brief Create a NetworkInterface instance.
*/
static shared_ptr<NetworkInterface>
makeNetworkInterface();
- /** \brief Emit the \p onInterfaceAdded signal and add \p netif internally.
+ /** \brief Emit the #onInterfaceAdded signal and add \p netif internally.
* \param netif new network interface
* \post getNetworkInterface(netif->getName()) == netif
- * \post listNetworkInterface() contains netif
- * \throw std::invalid_argument a network interface with same name already exists
+ * \post listNetworkInterfaces() contains netif
+ * \throw std::invalid_argument a network interface with the same name already exists
*/
void
addInterface(shared_ptr<NetworkInterface> netif);
- /** \brief Emit the \p onInterfaceRemoved signal and remove \p netif internally.
+ /** \brief Emit the #onInterfaceRemoved signal and remove \p netif internally.
* \param ifname network interface name
* \post getNetworkInterface(ifname) == nullptr
- * \post listNetworkInterface() does not contains an interface with specified name
- * \note If specified interface name does not exist, this operation has no effect.
+ * \post listNetworkInterfaces() does not contains an interface with specified name
+ * \note If the specified interface name does not exist, this operation has no effect.
*/
void
removeInterface(const std::string& ifname);
- /** \brief Emit the \p onEnumerationCompleted signal.
+ /** \brief Emit the #onEnumerationCompleted signal.
*
* A real NetworkMonitor starts with an "enumerating" state, during which the initial
* information about network interfaces is collected from the OS. Upon discovering a network
- * interface, it emits the \p onInterfaceAdded signal. When the initial enumerating completes,
+ * interface, it emits the #onInterfaceAdded signal. When the initial enumerating completes,
* it emits the onEnumerationCompleted signal.
*
* To simulate this procedure on a newly constructed MockNetworkMonitor, the caller should
- * invoke \p addInterface once for each network interface that already exists, and then invoke
- * \p signalEnumerationCompleted .
+ * invoke addInterface() once for each network interface that already exists, and then invoke
+ * emitEnumerationCompleted().
*/
void
emitEnumerationCompleted();
diff --git a/ndn-cxx/security/validity-period.hpp b/ndn-cxx/security/validity-period.hpp
index 6d1941b..447daf4 100644
--- a/ndn-cxx/security/validity-period.hpp
+++ b/ndn-cxx/security/validity-period.hpp
@@ -45,9 +45,9 @@
/**
* @brief Construct ValidityPeriod relative to a timepoint.
- * @param validFrom NotBefore is computed as @c now+validFrom .
+ * @param validFrom NotBefore is computed as `now+validFrom`.
* This should be negative to construct a ValidityPeriod that includes @p now .
- * @param validUntil NotAfter is computed as @c now+validTo .
+ * @param validUntil NotAfter is computed as `now+validTo`.
* This should be positive to construct a ValidityPeriod that includes @p now .
* @param now Reference timepoint. Default is current system clock timestamp.
*/
diff --git a/ndn-cxx/util/logging.hpp b/ndn-cxx/util/logging.hpp
index 0019569..8b28909 100644
--- a/ndn-cxx/util/logging.hpp
+++ b/ndn-cxx/util/logging.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2021 Regents of the University of California.
+ * Copyright (c) 2013-2022 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -46,9 +46,10 @@
class Logging : noncopyable
{
public:
- /** \brief Get list of all registered logger names.
+ /**
+ * \brief Get list of all registered logger names.
*/
- static std::set<std::string>
+ NDN_CXX_NODISCARD static std::set<std::string>
getLoggerNames();
/** \brief Set severity level.
@@ -58,7 +59,7 @@
* \param level minimum severity level
*
* Log messages are output only if their severity is greater than the current minimum severity
- * level. The initial severity level is \c LogLevel::NONE, which enables FATAL messages only.
+ * level. The initial severity level is LogLevel::NONE, which enables FATAL messages only.
*/
static void
setLevel(const std::string& prefix, LogLevel level);
@@ -81,7 +82,7 @@
setLevel(const std::string& config);
/** \brief Set or replace log destination.
- * \param destination log backend, e.g., returned by `makeDefaultStreamDestination`
+ * \param destination log backend, e.g., returned by makeDefaultStreamDestination()
*
* The initial destination is `std::clog`.
*
@@ -98,23 +99,25 @@
* \param os a stream for log output; caller must ensure it remains valid
* until setDestination() is invoked again or program exits
* \param wantAutoFlush if true, the created logging sink will be auto-flushed
- *`
- * This is equivalent to `setDestination(makeDefaultStreamDestination(shared_ptr<std::ostream>(&os, nullDeleter)))`.
*
+ * This is equivalent to
+ * `setDestination(makeDefaultStreamDestination(shared_ptr<std::ostream>(&os, nullDeleter)))`.
*/
static void
setDestination(std::ostream& os, bool wantAutoFlush);
- /** \brief Flush log backend.
+ /**
+ * \brief Flush log backend.
*
- * This ensures all log messages are written to the destination stream.
+ * This ensures all log messages are written to the destination stream.
*/
static void
flush();
- /** \brief Create stream log destination using default formatting
+ /**
+ * \brief Create stream log destination using default formatting.
*/
- static boost::shared_ptr<boost::log::sinks::sink>
+ NDN_CXX_NODISCARD static boost::shared_ptr<boost::log::sinks::sink>
makeDefaultStreamDestination(shared_ptr<std::ostream> os, bool wantAutoFlush = true);
private:
@@ -126,7 +129,7 @@
void
registerLoggerNameImpl(std::string name);
- std::set<std::string>
+ NDN_CXX_NODISCARD std::set<std::string>
getLoggerNamesImpl() const;
/**