face: API to remove all pending Interests
Change-Id: Iac341689270698b66ec6228c27e23ea6cf3e5e59
Refs: #3300
diff --git a/src/detail/face-impl.hpp b/src/detail/face-impl.hpp
index 98fda53..808355f 100644
--- a/src/detail/face-impl.hpp
+++ b/src/detail/face-impl.hpp
@@ -167,6 +167,12 @@
}
void
+ asyncRemoveAllPendingInterests()
+ {
+ m_pendingInterestTable.clear();
+ }
+
+ void
asyncPutData(const shared_ptr<const Data>& data)
{
this->ensureConnected(true);
diff --git a/src/face.cpp b/src/face.cpp
index 336e85e..9d6b0dd 100644
--- a/src/face.cpp
+++ b/src/face.cpp
@@ -218,6 +218,12 @@
m_ioService.post([=] { m_impl->asyncRemovePendingInterest(pendingInterestId); });
}
+void
+Face::removeAllPendingInterests()
+{
+ m_ioService.post([=] { m_impl->asyncRemoveAllPendingInterests(); });
+}
+
size_t
Face::getNPendingInterests() const
{
diff --git a/src/face.hpp b/src/face.hpp
index a07e293..e07f541 100644
--- a/src/face.hpp
+++ b/src/face.hpp
@@ -273,6 +273,12 @@
removePendingInterest(const PendingInterestId* pendingInterestId);
/**
+ * @brief Cancel all previously expressed Interests
+ */
+ void
+ removeAllPendingInterests();
+
+ /**
* @brief Get number of pending Interests
*/
size_t