table: FIB on NameTree
Change-Id:Ie949ad2209ed841af498f45e2d0f365ac905c45d
Refs: #1190
diff --git a/daemon/table/fib.hpp b/daemon/table/fib.hpp
index 2661911..166eb1b 100644
--- a/daemon/table/fib.hpp
+++ b/daemon/table/fib.hpp
@@ -8,18 +8,25 @@
#define NFD_TABLE_FIB_HPP
#include "fib-entry.hpp"
-#include "pit-entry.hpp"
-#include "measurements-entry.hpp"
+#include "name-tree.hpp"
namespace nfd {
+namespace measurements {
+class Entry;
+}
+namespace pit {
+class Entry;
+}
+
/** \class Fib
* \brief represents the FIB
*/
class Fib : noncopyable
{
public:
- Fib();
+ explicit
+ Fib(NameTree& nameTree);
~Fib();
@@ -46,7 +53,7 @@
findExactMatch(const Name& prefix) const;
void
- remove(const Name& prefix);
+ erase(const Name& prefix);
/** \brief removes the NextHop record for face in all entrites
* This is usually invoked when face goes away.
@@ -55,11 +62,21 @@
void
removeNextHopFromAllEntries(shared_ptr<Face> face);
+ size_t
+ size() const;
+
private:
shared_ptr<fib::Entry> m_rootEntry;
- std::list<shared_ptr<fib::Entry> > m_table;
+ NameTree& m_nameTree;
+ size_t m_nItems; // Number of items being stored
};
+inline size_t
+Fib::size() const
+{
+ return m_nItems;
+}
+
} // namespace nfd
#endif // NFD_TABLE_FIB_HPP