table: NameTree::findLongestPrefixMatch predicate
refs #1313
Change-Id: I759c8ddf9bc0fe5b970c979f69131a98b1ef32e4
diff --git a/daemon/table/name-tree-entry.hpp b/daemon/table/name-tree-entry.hpp
index b6f53db..cef42ff 100644
--- a/daemon/table/name-tree-entry.hpp
+++ b/daemon/table/name-tree-entry.hpp
@@ -71,6 +71,9 @@
std::vector<shared_ptr<Entry> >&
getChildren();
+
+ bool
+ isEmpty() const;
void
setFibEntry(shared_ptr<fib::Entry> fib);
@@ -140,6 +143,15 @@
return m_children;
}
+inline bool
+Entry::isEmpty() const
+{
+ return m_children.empty() &&
+ !static_cast<bool>(m_fibEntry) &&
+ m_pitEntries.empty() &&
+ !static_cast<bool>(m_measurementsEntry);
+}
+
inline shared_ptr<fib::Entry>
Entry::getFibEntry() const
{