fw: FaceTable signals use Face& instead of shared_ptr
refs #3205
Change-Id: I53ecd0d6a13d379eb1dfb872041bdde8501f05e7
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index 157908c..e3e0cb8 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -52,9 +52,7 @@
NFD_LOG_INIT("FaceManager");
-FaceManager::FaceManager(FaceTable& faceTable,
- Dispatcher& dispatcher,
- CommandValidator& validator)
+FaceManager::FaceManager(FaceTable& faceTable, Dispatcher& dispatcher, CommandValidator& validator)
: NfdManagerBase(dispatcher, validator, "faces")
, m_faceTable(faceTable)
{
@@ -74,11 +72,9 @@
registerStatusDatasetHandler("channels", bind(&FaceManager::listChannels, this, _1, _2, _3));
registerStatusDatasetHandler("query", bind(&FaceManager::queryFaces, this, _1, _2, _3));
- auto postNotification = registerNotificationStream("events");
- m_faceAddConn =
- m_faceTable.afterAdd.connect(bind(&FaceManager::afterFaceAdded, this, _1, postNotification));
- m_faceRemoveConn =
- m_faceTable.beforeRemove.connect(bind(&FaceManager::afterFaceRemoved, this, _1, postNotification));
+ m_postNotification = registerNotificationStream("events");
+ m_faceAddConn = m_faceTable.afterAdd.connect(bind(&FaceManager::notifyAddFace, this, _1));
+ m_faceRemoveConn = m_faceTable.beforeRemove.connect(bind(&FaceManager::notifyRemoveFace, this, _1));
}
void
@@ -386,25 +382,23 @@
}
void
-FaceManager::afterFaceAdded(shared_ptr<Face> face,
- const ndn::mgmt::PostNotification& post)
+FaceManager::notifyAddFace(const Face& face)
{
ndn::nfd::FaceEventNotification notification;
notification.setKind(ndn::nfd::FACE_EVENT_CREATED);
- collectFaceProperties(*face, notification);
+ collectFaceProperties(face, notification);
- post(notification.wireEncode());
+ m_postNotification(notification.wireEncode());
}
void
-FaceManager::afterFaceRemoved(shared_ptr<Face> face,
- const ndn::mgmt::PostNotification& post)
+FaceManager::notifyRemoveFace(const Face& face)
{
ndn::nfd::FaceEventNotification notification;
notification.setKind(ndn::nfd::FACE_EVENT_DESTROYED);
- collectFaceProperties(*face, notification);
+ collectFaceProperties(face, notification);
- post(notification.wireEncode());
+ m_postNotification(notification.wireEncode());
}
void