[ndnSIM] face: Enable metric parameter on a face
diff --git a/daemon/face/face.cpp b/daemon/face/face.cpp
index 7d3c1b7..61cc166 100644
--- a/daemon/face/face.cpp
+++ b/daemon/face/face.cpp
@@ -35,6 +35,7 @@
, m_localUri(localUri)
, m_isOnDemand(false)
, m_isFailed(false)
+ , m_metric(0)
{
onReceiveInterest += [this](const ndn::Interest&) { ++m_counters.getNInInterests(); };
onReceiveData += [this](const ndn::Data&) { ++m_counters.getNInDatas(); };
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index 40a77a1..803d62a 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -123,6 +123,12 @@
virtual const std::string&
getDescription() const;
+ void
+ setMetric(uint64_t metric);
+
+ uint64_t
+ getMetric() const;
+
/** \brief Get whether face is connected to a local app
*/
bool
@@ -200,6 +206,7 @@
FaceUri m_localUri;
bool m_isOnDemand;
bool m_isFailed;
+ uint64_t m_metric;
// allow setting FaceId
friend class FaceTable;
@@ -247,6 +254,18 @@
return m_isOnDemand;
}
+inline void
+Face::setMetric(uint64_t metric)
+{
+ m_metric = metric;
+}
+
+inline uint64_t
+Face::getMetric() const
+{
+ return m_metric;
+}
+
} // namespace nfd
#endif // NFD_DAEMON_FACE_FACE_HPP