fw: pull FaceTable construction out of Forwarder class
Refs: #4922, #4973
Change-Id: Ibbd4a8840cb0d01ebbd4cabf9c34fa78a1d23db1
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 4c91fb7..f59963e 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -44,14 +44,15 @@
return fw::BestRouteStrategy2::getStrategyName();
}
-Forwarder::Forwarder()
- : m_unsolicitedDataPolicy(make_unique<fw::DefaultUnsolicitedDataPolicy>())
+Forwarder::Forwarder(FaceTable& faceTable)
+ : m_faceTable(faceTable)
+ , m_unsolicitedDataPolicy(make_unique<fw::DefaultUnsolicitedDataPolicy>())
, m_fib(m_nameTree)
, m_pit(m_nameTree)
, m_measurements(m_nameTree)
, m_strategyChoice(*this)
{
- m_faceTable.afterAdd.connect([this] (Face& face) {
+ m_faceTable.afterAdd.connect([this] (const Face& face) {
face.afterReceiveInterest.connect(
[this, &face] (const Interest& interest, const EndpointId& endpointId) {
this->startProcessInterest(FaceEndpoint(face, endpointId), interest);
@@ -70,7 +71,7 @@
});
});
- m_faceTable.beforeRemove.connect([this] (Face& face) {
+ m_faceTable.beforeRemove.connect([this] (const Face& face) {
cleanupOnFaceRemoval(m_nameTree, m_fib, m_pit, face);
});