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/mgmt/rib-manager.cpp b/daemon/mgmt/rib-manager.cpp
index d9331e5..41f9925 100644
--- a/daemon/mgmt/rib-manager.cpp
+++ b/daemon/mgmt/rib-manager.cpp
@@ -40,7 +40,6 @@
namespace nfd {
-using rib::RibUpdate;
using rib::Route;
NFD_LOG_INIT(RibManager);
@@ -156,11 +155,7 @@
NFD_LOG_TRACE("Scheduled unregistration at: " << *route.expires);
}
- RibUpdate update;
- update.setAction(RibUpdate::REGISTER)
- .setName(name)
- .setRoute(route);
- beginRibUpdate(update, done);
+ beginRibUpdate({rib::RibUpdate::REGISTER, name, route}, done);
}
void
@@ -170,15 +165,11 @@
NFD_LOG_INFO("Removing route " << name << " nexthop=" << route.faceId <<
" origin=" << route.origin);
- RibUpdate update;
- update.setAction(RibUpdate::UNREGISTER)
- .setName(name)
- .setRoute(route);
- beginRibUpdate(update, done);
+ beginRibUpdate({rib::RibUpdate::UNREGISTER, name, route}, done);
}
void
-RibManager::beginRibUpdate(const RibUpdate& update,
+RibManager::beginRibUpdate(const rib::RibUpdate& update,
const std::function<void(RibUpdateResult)>& done)
{
m_rib.beginApplyUpdate(update,
diff --git a/daemon/mgmt/rib-manager.hpp b/daemon/mgmt/rib-manager.hpp
index 87de627..d6b6ebe 100644
--- a/daemon/mgmt/rib-manager.hpp
+++ b/daemon/mgmt/rib-manager.hpp
@@ -27,7 +27,6 @@
#define NFD_DAEMON_MGMT_RIB_MANAGER_HPP
#include "manager-base.hpp"
-#include "rib/route.hpp"
#include <ndn-cxx/mgmt/nfd/controller.hpp>
#include <ndn-cxx/mgmt/nfd/face-event-notification.hpp>
@@ -39,8 +38,9 @@
namespace nfd {
namespace rib {
+class Route;
class Rib;
-class RibUpdate;
+struct RibUpdate;
} // namespace rib
/**