Simplify some code with Boost.Operators
Change-Id: Ic873bcbaf6be00d5c35601cfc8090df534d815ee
diff --git a/daemon/rib/readvertise/readvertised-route.hpp b/daemon/rib/readvertise/readvertised-route.hpp
index a57fe70..bc2d8c1 100644
--- a/daemon/rib/readvertise/readvertised-route.hpp
+++ b/daemon/rib/readvertise/readvertised-route.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,7 +33,8 @@
namespace nfd::rib {
-/** \brief State of a readvertised route.
+/**
+ * \brief State of a readvertised route.
*/
class ReadvertisedRoute : noncopyable
{
@@ -41,25 +42,23 @@
explicit
ReadvertisedRoute(const Name& prefix)
: prefix(prefix)
- , nRibRoutes(0)
- , retryDelay(0)
{
}
+ friend bool
+ operator<(const ReadvertisedRoute& lhs, const ReadvertisedRoute& rhs)
+ {
+ return lhs.prefix < rhs.prefix;
+ }
+
public:
Name prefix; ///< readvertised prefix
mutable ndn::security::SigningInfo signer; ///< signer for commands
- mutable size_t nRibRoutes; ///< number of RIB routes that cause the readvertisement
- mutable time::milliseconds retryDelay; ///< retry interval (not used for refresh)
+ mutable size_t nRibRoutes = 0; ///< number of RIB routes that cause the readvertisement
+ mutable time::milliseconds retryDelay = 0_ms; ///< retry interval (not used for refresh)
mutable scheduler::ScopedEventId retryEvt; ///< retry or refresh event
};
-inline bool
-operator<(const ReadvertisedRoute& lhs, const ReadvertisedRoute& rhs)
-{
- return lhs.prefix < rhs.prefix;
-}
-
using ReadvertisedRouteContainer = std::set<ReadvertisedRoute>;
} // namespace nfd::rib