26 #ifndef NFD_DAEMON_TABLE_NAME_TREE_HPP
27 #define NFD_DAEMON_TABLE_NAME_TREE_HPP
50 static constexpr
size_t
75 template<
typename EntryT>
93 lookup(
const Name& name,
size_t prefixLen);
100 return this->
lookup(name, name.size());
149 findExactMatch(
const Name& name,
size_t prefixLen = std::numeric_limits<size_t>::max())
const;
174 template<
typename EntryT>
180 BOOST_ASSERT(nte !=
nullptr);
Represents an entry in the FIB.
Represents an entry in the Measurements table.
An entry in the name tree.
static Entry * get(const ENTRY &tableEntry)
Enumeration operation implementation.
A hashtable for fast exact name lookup.
size_t getNBuckets() const
A common index structure for FIB, PIT, StrategyChoice, and Measurements.
NameTree(size_t nBuckets=1024)
Range partialEnumerate(const Name &prefix, const EntrySubTreeSelector &entrySubTreeSelector=AnyEntrySubTree()) const
Enumerate all entries under a prefix.
Entry * findLongestPrefixMatch(const EntryT &tableEntry, const EntrySelector &entrySelector=AnyEntry()) const
Equivalent to findLongestPrefixMatch(getEntry(tableEntry)->getName(), entrySelector)
Range findAllMatches(const Name &name, const EntrySelector &entrySelector=AnyEntry()) const
All-prefixes match lookup.
size_t getNBuckets() const
const_iterator end() const
size_t eraseIfEmpty(Entry *entry, bool canEraseAncestors=true)
Delete the entry if it is empty.
Range fullEnumerate(const EntrySelector &entrySelector=AnyEntry()) const
Enumerate all entries.
static constexpr size_t getMaxDepth()
Maximum depth of the name tree.
Entry & lookup(const Name &name, size_t prefixLen)
Find or insert an entry by name.
Entry * getEntry(const EntryT &tableEntry) const
Entry * findExactMatch(const Name &name, size_t prefixLen=std::numeric_limits< size_t >::max()) const
Exact match lookup.
Entry * findLongestPrefixMatch(const Name &name, const EntrySelector &entrySelector=AnyEntry()) const
Longest prefix matching.
Entry & lookup(const Name &name)
Equivalent to lookup(name, name.size())
const_iterator begin() const
Represents an entry in the Interest table (PIT).
Represents an entry in the Strategy Choice table.
boost::iterator_range< Iterator > Range
A forward range of name tree entries.
std::function< bool(const Entry &)> EntrySelector
A predicate to accept or reject an Entry in find operations.
std::function< std::pair< bool, bool >(const Entry &)> EntrySubTreeSelector
A predicate to accept or reject an Entry and its children.
An EntrySelector that accepts every Entry.
An EntrySubTreeSelector that accepts every Entry and its children.