mgmt: FaceManager no longer owns FaceSystem
refs #3904
Change-Id: I2ef6fd36a51493eea27d8eb0e1c7dc022766f948
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index a2bfc3c..4d1929d 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -35,10 +35,11 @@
NFD_LOG_INIT("FaceManager");
-FaceManager::FaceManager(FaceTable& faceTable, Dispatcher& dispatcher, CommandAuthenticator& authenticator)
+FaceManager::FaceManager(FaceSystem& faceSystem,
+ Dispatcher& dispatcher, CommandAuthenticator& authenticator)
: NfdManagerBase(dispatcher, authenticator, "faces")
- , m_faceSystem(faceTable)
- , m_faceTable(faceTable)
+ , m_faceSystem(faceSystem)
+ , m_faceTable(faceSystem.getFaceTable())
{
registerCommandHandler<ndn::nfd::FaceCreateCommand>("create",
bind(&FaceManager::createFace, this, _2, _3, _4, _5));
diff --git a/daemon/mgmt/face-manager.hpp b/daemon/mgmt/face-manager.hpp
index 3c92e93..9a8c503 100644
--- a/daemon/mgmt/face-manager.hpp
+++ b/daemon/mgmt/face-manager.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+ * Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -41,9 +41,8 @@
class FaceManager : public NfdManagerBase
{
public:
- FaceManager(FaceTable& faceTable,
- Dispatcher& dispatcher,
- CommandAuthenticator& authenticator);
+ FaceManager(FaceSystem& faceSystem,
+ Dispatcher& dispatcher, CommandAuthenticator& authenticator);
/**
* @brief Subscribe to face_system section for the config file
@@ -141,7 +140,7 @@
connectFaceStateChangeSignal(const Face& face);
PUBLIC_WITH_TESTS_ELSE_PRIVATE:
- FaceSystem m_faceSystem; ///\todo #3904 accept FaceSystem& in constructor; don't own FaceSystem
+ FaceSystem& m_faceSystem;
FaceTable& m_faceTable;
std::map<FaceId, signal::ScopedConnection> m_faceStateChangeConn;