face: Implementing new "isOnDemand" flag
This flags replaces isPermanent flag in datagram faces, but with the
reversed logic (isPermanent = !isOnDemand)
Change-Id: I37ba604e5f105ca95a79a08b8cfc3d640df8b412
Refs: #1376
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index 1efcb35..e1ef2f8 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -106,6 +106,11 @@
virtual bool
isUp() const;
+ /** \brief Get whether face is created on demand or explicitly via FaceManagement protocol
+ */
+ bool
+ isOnDemand() const;
+
const FaceCounters&
getCounters() const;
@@ -120,6 +125,9 @@
FaceCounters&
getMutableCounters();
+ void
+ setOnDemand(bool isOnDemand);
+
private:
void
setId(FaceId faceId);
@@ -130,6 +138,7 @@
bool m_isLocal; // for scoping purposes
FaceCounters m_counters;
FaceUri m_uri;
+ bool m_isOnDemand;
// allow setting FaceId
friend class FaceTable;
@@ -160,6 +169,18 @@
return m_uri;
}
+inline void
+Face::setOnDemand(bool isOnDemand)
+{
+ m_isOnDemand = isOnDemand;
+}
+
+inline bool
+Face::isOnDemand() const
+{
+ return m_isOnDemand;
+}
+
} // namespace nfd
#endif // NFD_FACE_FACE_HPP