rib: turn RibUpdate into an aggregate
And move it together with RibUpdateList and RibUpdateBatch.
Also remove a few unused functions from RibEntry.
Change-Id: Id4f79fda27d3bffb8411e2a95c24154e2cb80c4f
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) {