rib: change object ownership
rib::Service instead of RibManager now owns Controller,
Rib, FibUpdater, AutoPrefixPropagator, Readvertise objects.
RibManager is only responsible for serving RIB management
commands and datasets.
refs #4650
Change-Id: Idb99cdc6cb97b3e3c1bc56685b3ca121b062c7f5
diff --git a/tests/rib/rib-manager.t.cpp b/tests/rib/rib-manager.t.cpp
index cdf1581..77b1ed3 100644
--- a/tests/rib/rib-manager.t.cpp
+++ b/tests/rib/rib-manager.t.cpp
@@ -53,8 +53,10 @@
bool shouldClearRib)
: m_commands(m_face.sentInterests)
, m_status(status)
- , m_manager(m_dispatcher, m_face, m_keyChain)
- , m_rib(m_manager.m_rib)
+ , m_nfdController(m_face, m_keyChain)
+ , m_fibUpdater(m_rib, m_nfdController)
+ , m_prefixPropagator(m_nfdController, m_keyChain, m_rib)
+ , m_manager(m_rib, m_dispatcher, m_face, m_nfdController, m_prefixPropagator)
{
m_rib.m_onSendBatchFromQueue = bind(&RibManagerFixture::onSendBatchFromQueue, this, _1);
@@ -168,9 +170,8 @@
RibUpdate update = *(batch.begin());
// Simulate a successful response from NFD
- FibUpdater& updater = m_manager.m_fibUpdater;
- m_manager.m_rib.onFibUpdateSuccess(batch, updater.m_inheritedRoutes,
- bind(&RibManager::onRibUpdateSuccess, &m_manager, update));
+ m_rib.onFibUpdateSuccess(batch, m_fibUpdater.m_inheritedRoutes,
+ bind(&RibManager::onRibUpdateSuccess, &m_manager, update));
}
public:
@@ -222,14 +223,16 @@
return CheckCommandResult::OK;
}
-public:
+protected:
static const Name FIB_COMMAND_PREFIX;
std::vector<Interest>& m_commands;
ConfigurationStatus m_status;
-protected:
+ ndn::nfd::Controller m_nfdController;
+ Rib m_rib;
+ FibUpdater m_fibUpdater;
+ AutoPrefixPropagator m_prefixPropagator;
RibManager m_manager;
- Rib& m_rib;
};
const Name RibManagerFixture::FIB_COMMAND_PREFIX("/localhost/nfd/fib");