diff --git a/daemon/rib/fib-updater.cpp b/daemon/rib/fib-updater.cpp
index 0b8fc0e..8d3b818 100644
--- a/daemon/rib/fib-updater.cpp
+++ b/daemon/rib/fib-updater.cpp
@@ -68,7 +68,7 @@
 
   // Compute updates and add to m_fibUpdates
   for (const RibUpdate& update : batch) {
-    switch (update.getAction()) {
+    switch (update.action) {
     case RibUpdate::REGISTER:
       computeUpdatesForRegistration(update);
       break;
@@ -88,42 +88,38 @@
 void
 FibUpdater::computeUpdatesForRegistration(const RibUpdate& update)
 {
-  const Name& prefix = update.getName();
-  const Route& route = update.getRoute();
-
-  auto it = m_rib.find(prefix);
+  auto it = m_rib.find(update.name);
 
   // Name prefix exists
   if (it != m_rib.end()) {
     shared_ptr<const RibEntry> entry(it->second);
-
-    auto existingRoute = entry->findRoute(route);
+    auto existingRoute = entry->findRoute(update.route);
 
     // Route will be new
     if (existingRoute == entry->end()) {
       // Will the new route change the namespace's capture flag?
-      bool willCaptureBeTurnedOn = (entry->hasCapture() == false && route.isRibCapture());
+      bool willCaptureBeTurnedOn = (!entry->hasCapture() && update.route.isRibCapture());
 
-      createFibUpdatesForNewRoute(*entry, route, willCaptureBeTurnedOn);
+      createFibUpdatesForNewRoute(*entry, update.route, willCaptureBeTurnedOn);
     }
     else {
       // Route already exists
       RibEntry entryCopy = *entry;
 
-      Route& routeToUpdate = *entryCopy.findRoute(route);
-      routeToUpdate.flags = route.flags;
-      routeToUpdate.cost = route.cost;
-      routeToUpdate.expires = route.expires;
+      Route& routeToUpdate = *entryCopy.findRoute(update.route);
+      routeToUpdate.flags = update.route.flags;
+      routeToUpdate.cost = update.route.cost;
+      routeToUpdate.expires = update.route.expires;
 
-      createFibUpdatesForUpdatedRoute(entryCopy, route, *existingRoute);
+      createFibUpdatesForUpdatedRoute(entryCopy, update.route, *existingRoute);
     }
   }
   else {
     // New name in RIB
     // Find prefix's parent
-    shared_ptr<RibEntry> parent = m_rib.findParent(prefix);
+    shared_ptr<RibEntry> parent = m_rib.findParent(update.name);
 
-    Rib::RibEntryList descendants = m_rib.findDescendantsForNonInsertedName(prefix);
+    Rib::RibEntryList descendants = m_rib.findDescendantsForNonInsertedName(update.name);
     Rib::RibEntryList children;
 
     for (const auto& descendant : descendants) {
@@ -134,44 +130,40 @@
       }
     }
 
-    createFibUpdatesForNewRibEntry(prefix, route, children);
+    createFibUpdatesForNewRibEntry(update.name, update.route, children);
   }
 }
 
 void
 FibUpdater::computeUpdatesForUnregistration(const RibUpdate& update)
 {
-  const Name& prefix = update.getName();
-  const Route& route = update.getRoute();
-
-  auto ribIt = m_rib.find(prefix);
+  auto ribIt = m_rib.find(update.name);
 
   // Name prefix exists
   if (ribIt != m_rib.end()) {
     shared_ptr<const RibEntry> entry(ribIt->second);
     const bool hadCapture = entry->hasCapture();
 
-    auto existing = entry->findRoute(route);
+    auto existing = entry->findRoute(update.route);
     if (existing != entry->end()) {
       RibEntry temp = *entry;
 
       // Erase route in temp entry
-      temp.eraseRoute(route);
+      temp.eraseRoute(update.route);
 
-      const bool captureWasTurnedOff = (hadCapture && !temp.hasCapture());
-
+      bool captureWasTurnedOff = (hadCapture && !temp.hasCapture());
       createFibUpdatesForErasedRoute(temp, *existing, captureWasTurnedOff);
 
       // The RibEntry still has the face ID; need to update FIB
       // with lowest cost for the same face instead of removing the face from the FIB
-      const Route* next = entry->getRouteWithSecondLowestCostByFaceId(route.faceId);
+      const Route* next = entry->getRouteWithSecondLowestCostByFaceId(update.route.faceId);
 
       if (next != nullptr) {
         createFibUpdatesForNewRoute(temp, *next, false);
       }
 
       // The RibEntry will be empty after this removal
-      if (entry->getNRoutes() == 1) {
+      if (entry->getRoutes().size() == 1) {
         createFibUpdatesForErasedRibEntry(*entry);
       }
     }
@@ -562,7 +554,7 @@
     // If capture is turned off for the route and another route is installed in the RibEntry,
     // add ancestors to self
     Rib::RouteSet routesToAdd;
-    if (captureWasTurnedOff && entry.getNRoutes() != 0) {
+    if (captureWasTurnedOff && !entry.empty()) {
       // Look for an ancestors that were blocked previously
       routesToAdd = m_rib.getAncestorRoutes(entry);
 
@@ -589,7 +581,7 @@
     // If capture is turned off for the route and another route is installed in the RibEntry,
     // add ancestors to self
     Rib::RouteSet routesToAdd;
-    if (captureWasTurnedOff && entry.getNRoutes() != 0) {
+    if (captureWasTurnedOff && !entry.empty()) {
       // Look for an ancestors that were blocked previously
       routesToAdd = m_rib.getAncestorRoutes(entry);
 
@@ -604,11 +596,10 @@
   Rib::RouteSet ancestorRoutes = m_rib.getAncestorRoutes(entry);
 
   // If the current entry has capture set or is pending removal, don't add inherited route
-  if (!entry.hasCapture() && entry.getNRoutes() != 0) {
+  if (!entry.hasCapture() && !entry.empty()) {
     // If there is an ancestor route which is the same as the erased route, add that route
     // to the current entry
     auto it = ancestorRoutes.find(route);
-
     if (it != ancestorRoutes.end()) {
       addInheritedRoute(entry.getName(), *it);
       addFibUpdate(FibUpdate::createAddUpdate(entry.getName(), it->faceId, it->cost));
@@ -684,23 +675,13 @@
 void
 FibUpdater::addInheritedRoute(const Name& name, const Route& route)
 {
-  RibUpdate update;
-  update.setAction(RibUpdate::REGISTER)
-        .setName(name)
-        .setRoute(route);
-
-  m_inheritedRoutes.push_back(update);
+  m_inheritedRoutes.push_back({RibUpdate::REGISTER, name, route});
 }
 
 void
 FibUpdater::removeInheritedRoute(const Name& name, const Route& route)
 {
-  RibUpdate update;
-  update.setAction(RibUpdate::UNREGISTER)
-        .setName(name)
-        .setRoute(route);
-
-  m_inheritedRoutes.push_back(update);
+  m_inheritedRoutes.push_back({RibUpdate::UNREGISTER, name, route});
 }
 
 } // namespace nfd::rib
diff --git a/daemon/rib/rib-entry.cpp b/daemon/rib/rib-entry.cpp
index 1df227e..29c9eb7 100644
--- a/daemon/rib/rib-entry.cpp
+++ b/daemon/rib/rib-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -72,35 +72,20 @@
 void
 RibEntry::eraseRoute(const Route& route)
 {
-  auto it = findRoute(route);
-  eraseRoute(it);
-}
-
-bool
-RibEntry::hasRoute(const Route& route)
-{
-  auto it = findRoute(route);
-  return it != end();
+  eraseRoute(findRoute(route));
 }
 
 bool
 RibEntry::hasFaceId(uint64_t faceId) const
 {
-  auto it = std::find_if(begin(), end(), [faceId] (const auto& r) { return r.faceId == faceId; });
-  return it != end();
-}
-
-size_t
-RibEntry::getNRoutes() const
-{
-  return m_routes.size();
+  return std::find_if(begin(), end(), [=] (const auto& r) { return r.faceId == faceId; }) != end();
 }
 
 void
 RibEntry::addChild(shared_ptr<RibEntry> child)
 {
   BOOST_ASSERT(!child->getParent());
-  child->setParent(this->shared_from_this());
+  child->m_parent = shared_from_this();
   m_children.push_back(std::move(child));
 }
 
@@ -108,7 +93,7 @@
 RibEntry::removeChild(shared_ptr<RibEntry> child)
 {
   BOOST_ASSERT(child->getParent().get() == this);
-  child->setParent(nullptr);
+  child->m_parent = nullptr;
   m_children.remove(child);
 }
 
@@ -156,12 +141,6 @@
 }
 
 bool
-RibEntry::hasCapture() const
-{
-  return m_nRoutesWithCaptureSet > 0;
-}
-
-bool
 RibEntry::hasChildInheritOnFaceId(uint64_t faceId) const
 {
   for (const Route& route : m_routes) {
diff --git a/daemon/rib/rib-entry.hpp b/daemon/rib/rib-entry.hpp
index 6fbd198..6ec8b65 100644
--- a/daemon/rib/rib-entry.hpp
+++ b/daemon/rib/rib-entry.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-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -42,17 +42,29 @@
   using iterator = RouteList::iterator;
   using const_iterator = RouteList::const_iterator;
 
-  void
-  setName(const Name& prefix);
-
   const Name&
-  getName() const;
+  getName() const noexcept
+  {
+    return m_name;
+  }
+
+  void
+  setName(const Name& prefix)
+  {
+    m_name = prefix;
+  }
 
   shared_ptr<RibEntry>
-  getParent() const;
+  getParent() const
+  {
+    return m_parent;
+  }
 
-  bool
-  hasParent() const;
+  const std::list<shared_ptr<RibEntry>>&
+  getChildren() const noexcept
+  {
+    return m_children;
+  }
 
   void
   addChild(shared_ptr<RibEntry> child);
@@ -60,12 +72,6 @@
   void
   removeChild(shared_ptr<RibEntry> child);
 
-  const std::list<shared_ptr<RibEntry>>&
-  getChildren() const;
-
-  bool
-  hasChildren() const;
-
   /** \brief Inserts a new route into the entry's route list.
    *
    *  If another route already exists with the same faceId and origin,
@@ -95,21 +101,12 @@
   bool
   hasFaceId(uint64_t faceId) const;
 
-  const RouteList&
-  getRoutes() const;
-
-  size_t
-  getNRoutes() const;
-
   iterator
   findRoute(const Route& route);
 
   const_iterator
   findRoute(const Route& route) const;
 
-  bool
-  hasRoute(const Route& route);
-
   void
   addInheritedRoute(const Route& route);
 
@@ -122,7 +119,10 @@
    * The inherited routes returned represent inherited routes this namespace has in the FIB.
    */
   const RouteList&
-  getInheritedRoutes() const;
+  getInheritedRoutes() const noexcept
+  {
+    return m_inheritedRoutes;
+  }
 
   /**
    * \brief Finds an inherited route with a matching face ID.
@@ -140,7 +140,10 @@
   hasInheritedRoute(const Route& route) const;
 
   bool
-  hasCapture() const;
+  hasCapture() const noexcept
+  {
+    return m_nRoutesWithCaptureSet > 0;
+  }
 
   /** \brief Determines if the entry has an inherited route with the passed
    *         face ID and its child inherit flag set.
@@ -180,21 +183,41 @@
   getPrefixAnnouncement(time::milliseconds minExpiration = 15_s,
                         time::milliseconds maxExpiration = 1_h) const;
 
-  const_iterator
-  begin() const;
+  const RouteList&
+  getRoutes() const noexcept
+  {
+    return m_routes;
+  }
+
+  bool
+  empty() const noexcept
+  {
+    return m_routes.empty();
+  }
 
   const_iterator
-  end() const;
+  begin() const noexcept
+  {
+    return m_routes.begin();
+  }
+
+  const_iterator
+  end() const noexcept
+  {
+    return m_routes.end();
+  }
 
   iterator
-  begin();
+  begin() noexcept
+  {
+    return m_routes.begin();
+  }
 
   iterator
-  end();
-
-private:
-  void
-  setParent(shared_ptr<RibEntry> parent);
+  end() noexcept
+  {
+    return m_routes.end();
+  }
 
 private:
   Name m_name;
@@ -212,72 +235,6 @@
   uint64_t m_nRoutesWithCaptureSet = 0;
 };
 
-inline void
-RibEntry::setName(const Name& prefix)
-{
-  m_name = prefix;
-}
-
-inline const Name&
-RibEntry::getName() const
-{
-  return m_name;
-}
-
-inline void
-RibEntry::setParent(shared_ptr<RibEntry> parent)
-{
-  m_parent = std::move(parent);
-}
-
-inline shared_ptr<RibEntry>
-RibEntry::getParent() const
-{
-  return m_parent;
-}
-
-inline const std::list<shared_ptr<RibEntry>>&
-RibEntry::getChildren() const
-{
-  return m_children;
-}
-
-inline const RibEntry::RouteList&
-RibEntry::getRoutes() const
-{
-  return m_routes;
-}
-
-inline const RibEntry::RouteList&
-RibEntry::getInheritedRoutes() const
-{
-  return m_inheritedRoutes;
-}
-
-inline RibEntry::const_iterator
-RibEntry::begin() const
-{
-  return m_routes.begin();
-}
-
-inline RibEntry::const_iterator
-RibEntry::end() const
-{
-  return m_routes.end();
-}
-
-inline RibEntry::iterator
-RibEntry::begin()
-{
-  return m_routes.begin();
-}
-
-inline RibEntry::iterator
-RibEntry::end()
-{
-  return m_routes.end();
-}
-
 std::ostream&
 operator<<(std::ostream& os, const RibEntry& entry);
 
diff --git a/daemon/rib/rib-update-batch.cpp b/daemon/rib/rib-update-batch.cpp
index 12284f7..0444d8e 100644
--- a/daemon/rib/rib-update-batch.cpp
+++ b/daemon/rib/rib-update-batch.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -27,6 +27,26 @@
 
 namespace nfd::rib {
 
+std::ostream&
+operator<<(std::ostream& os, RibUpdate::Action action)
+{
+  switch (action) {
+  case RibUpdate::REGISTER:
+    return os << "REGISTER";
+  case RibUpdate::UNREGISTER:
+    return os << "UNREGISTER";
+  case RibUpdate::REMOVE_FACE:
+    return os << "REMOVE_FACE";
+  }
+  return os;
+}
+
+std::ostream&
+operator<<(std::ostream& os, const RibUpdate& update)
+{
+  return os << "RibUpdate{" << update.action << ", " << update.name << ", " << update.route << "}";
+}
+
 RibUpdateBatch::RibUpdateBatch(uint64_t faceId)
   : m_faceId(faceId)
 {
@@ -35,27 +55,8 @@
 void
 RibUpdateBatch::add(const RibUpdate& update)
 {
-  BOOST_ASSERT(m_faceId == update.getRoute().faceId);
-
+  BOOST_ASSERT(m_faceId == update.route.faceId);
   m_updates.push_back(update);
 }
 
-RibUpdateBatch::const_iterator
-RibUpdateBatch::begin() const
-{
-  return m_updates.begin();
-}
-
-RibUpdateBatch::const_iterator
-RibUpdateBatch::end() const
-{
-  return m_updates.end();
-}
-
-size_t
-RibUpdateBatch::size() const
-{
-  return m_updates.size();
-}
-
 } // namespace nfd::rib
diff --git a/daemon/rib/rib-update-batch.hpp b/daemon/rib/rib-update-batch.hpp
index a91cad3..4906387 100644
--- a/daemon/rib/rib-update-batch.hpp
+++ b/daemon/rib/rib-update-batch.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-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -26,12 +26,38 @@
 #ifndef NFD_DAEMON_RIB_RIB_UPDATE_BATCH_HPP
 #define NFD_DAEMON_RIB_RIB_UPDATE_BATCH_HPP
 
-#include "rib-update.hpp"
+#include "route.hpp"
 
 #include <list>
 
 namespace nfd::rib {
 
+/**
+ * \brief Represents a route that will be added to or removed from a namespace.
+ */
+struct RibUpdate
+{
+  enum Action {
+    REGISTER    = 0,
+    UNREGISTER  = 1,
+    /**
+     * \brief An update triggered by a face destruction notification
+     * \note indicates a Route needs to be removed after a face is destroyed
+     */
+    REMOVE_FACE = 2,
+  };
+
+  Action action;
+  Name name;
+  Route route;
+};
+
+std::ostream&
+operator<<(std::ostream& os, RibUpdate::Action action);
+
+std::ostream&
+operator<<(std::ostream& os, const RibUpdate& update);
+
 using RibUpdateList = std::list<RibUpdate>;
 
 /**
@@ -46,7 +72,7 @@
   RibUpdateBatch(uint64_t faceId);
 
   uint64_t
-  getFaceId() const
+  getFaceId() const noexcept
   {
     return m_faceId;
   }
@@ -55,13 +81,22 @@
   add(const RibUpdate& update);
 
   const_iterator
-  begin() const;
+  begin() const noexcept
+  {
+    return m_updates.begin();
+  }
 
   const_iterator
-  end() const;
+  end() const noexcept
+  {
+    return m_updates.end();
+  }
 
   size_t
-  size() const;
+  size() const noexcept
+  {
+    return m_updates.size();
+  }
 
 private:
   uint64_t m_faceId;
diff --git a/daemon/rib/rib-update.cpp b/daemon/rib/rib-update.cpp
deleted file mode 100644
index 8fc5000..0000000
--- a/daemon/rib/rib-update.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2014-2025,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib-update.hpp"
-
-namespace nfd::rib {
-
-std::ostream&
-operator<<(std::ostream& os, RibUpdate::Action action)
-{
-  switch (action) {
-  case RibUpdate::REGISTER:
-    return os << "REGISTER";
-  case RibUpdate::UNREGISTER:
-    return os << "UNREGISTER";
-  case RibUpdate::REMOVE_FACE:
-    return os << "REMOVE_FACE";
-  }
-  return os;
-}
-
-std::ostream&
-operator<<(std::ostream& os, const RibUpdate& update)
-{
-  return os << "RibUpdate{" << update.getAction()
-            << ", " << update.getName()
-            << ", " << update.getRoute()
-            << "}";
-}
-
-} // namespace nfd::rib
diff --git a/daemon/rib/rib-update.hpp b/daemon/rib/rib-update.hpp
deleted file mode 100644
index 70bbe1e..0000000
--- a/daemon/rib/rib-update.hpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2014-2022,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_RIB_RIB_UPDATE_HPP
-#define NFD_DAEMON_RIB_RIB_UPDATE_HPP
-
-#include "core/common.hpp"
-#include "route.hpp"
-
-namespace nfd::rib {
-
-/**
- * \brief Represents a route that will be added to or removed from a namespace
- * \note This type is copyable so that it can be stored in STL containers.
- */
-class RibUpdate
-{
-public:
-  enum Action {
-    REGISTER    = 0,
-    UNREGISTER  = 1,
-    /**
-     * \brief An update triggered by a face destruction notification
-     * \note indicates a Route needs to be removed after a face is destroyed
-     */
-    REMOVE_FACE = 2,
-  };
-
-  RibUpdate&
-  setAction(Action action);
-
-  Action
-  getAction() const;
-
-  RibUpdate&
-  setName(const Name& name);
-
-  const Name&
-  getName() const;
-
-  RibUpdate&
-  setRoute(const Route& route);
-
-  const Route&
-  getRoute() const;
-
-private:
-  Action m_action;
-  Name m_name;
-  Route m_route;
-};
-
-inline RibUpdate&
-RibUpdate::setAction(Action action)
-{
-  m_action = action;
-  return *this;
-}
-
-inline RibUpdate::Action
-RibUpdate::getAction() const
-{
-  return m_action;
-}
-
-inline RibUpdate&
-RibUpdate::setName(const Name& name)
-{
-  m_name = name;
-  return *this;
-}
-
-inline const Name&
-RibUpdate::getName() const
-{
-  return m_name;
-}
-
-inline RibUpdate&
-RibUpdate::setRoute(const Route& route)
-{
-  m_route = route;
-  return *this;
-}
-
-inline const Route&
-RibUpdate::getRoute() const
-{
-  return m_route;
-}
-
-std::ostream&
-operator<<(std::ostream& os, RibUpdate::Action action);
-
-std::ostream&
-operator<<(std::ostream& os, const RibUpdate& update);
-
-} // namespace nfd::rib
-
-#endif // NFD_DAEMON_RIB_RIB_UPDATE_HPP
diff --git a/daemon/rib/rib.cpp b/daemon/rib/rib.cpp
index 7288c9a..c67d172 100644
--- a/daemon/rib/rib.cpp
+++ b/daemon/rib/rib.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2023,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -179,7 +179,7 @@
     }
 
     // If a RibEntry's route list is empty, remove it from the tree
-    if (entry->getRoutes().empty()) {
+    if (entry->empty()) {
       eraseEntry(ribIt);
     }
   }
@@ -189,13 +189,7 @@
 Rib::onRouteExpiration(const Name& prefix, const Route& route)
 {
   NFD_LOG_DEBUG(route << " for " << prefix << " has expired");
-
-  RibUpdate update;
-  update.setAction(RibUpdate::UNREGISTER)
-        .setName(prefix)
-        .setRoute(route);
-
-  beginApplyUpdate(update, nullptr, nullptr);
+  beginApplyUpdate({RibUpdate::UNREGISTER, prefix, route}, nullptr, nullptr);
 }
 
 shared_ptr<RibEntry>
@@ -370,12 +364,7 @@
     if (route.faceId != faceId) {
       continue;
     }
-
-    RibUpdate update;
-    update.setAction(RibUpdate::REMOVE_FACE)
-          .setName(entry.getName())
-          .setRoute(route);
-    addUpdateToQueue(update, nullptr, nullptr);
+    addUpdateToQueue({RibUpdate::REMOVE_FACE, entry.getName(), route}, nullptr, nullptr);
   }
 }
 
@@ -384,7 +373,7 @@
                       const Rib::UpdateSuccessCallback& onSuccess,
                       const Rib::UpdateFailureCallback& onFailure)
 {
-  RibUpdateBatch batch(update.getRoute().faceId);
+  RibUpdateBatch batch(update.route.faceId);
   batch.add(update);
 
   UpdateQueueItem item{batch, onSuccess, onFailure};
@@ -421,13 +410,13 @@
                         const Rib::UpdateSuccessCallback& onSuccess)
 {
   for (const RibUpdate& update : batch) {
-    switch (update.getAction()) {
+    switch (update.action) {
     case RibUpdate::REGISTER:
-      insert(update.getName(), update.getRoute());
+      insert(update.name, update.route);
       break;
     case RibUpdate::UNREGISTER:
     case RibUpdate::REMOVE_FACE:
-      erase(update.getName(), update.getRoute());
+      erase(update.name, update.route);
       break;
     }
   }
@@ -463,16 +452,16 @@
 Rib::modifyInheritedRoutes(const RibUpdateList& inheritedRoutes)
 {
   for (const RibUpdate& update : inheritedRoutes) {
-    auto ribIt = m_rib.find(update.getName());
+    auto ribIt = m_rib.find(update.name);
     BOOST_ASSERT(ribIt != m_rib.end());
     shared_ptr<RibEntry> entry(ribIt->second);
 
-    switch (update.getAction()) {
+    switch (update.action) {
     case RibUpdate::REGISTER:
-      entry->addInheritedRoute(update.getRoute());
+      entry->addInheritedRoute(update.route);
       break;
     case RibUpdate::UNREGISTER:
-      entry->removeInheritedRoute(update.getRoute());
+      entry->removeInheritedRoute(update.route);
       break;
     case RibUpdate::REMOVE_FACE:
       break;
@@ -486,7 +475,6 @@
   for (const auto& item : rib) {
     os << *item.second << "\n";
   }
-
   return os;
 }
 
