26 #ifndef NFD_DAEMON_TABLE_NAME_TREE_HPP
27 #define NFD_DAEMON_TABLE_NAME_TREE_HPP
70 return std::make_pair(
true,
true);
108 dump(std::ostream& output)
const;
121 shared_ptr<name_tree::Entry>
137 shared_ptr<name_tree::Entry>
141 shared_ptr<name_tree::Entry>
145 shared_ptr<name_tree::Entry>
149 shared_ptr<name_tree::Entry>
158 shared_ptr<name_tree::Entry>
166 shared_ptr<name_tree::Entry>
171 shared_ptr<name_tree::Entry>
190 boost::iterator_range<const_iterator>
209 boost::iterator_range<const_iterator>
226 boost::iterator_range<const_iterator>
251 class const_iterator :
public std::iterator<std::forward_iterator_tag, const name_tree::Entry>
260 shared_ptr<name_tree::Entry> entry,
269 shared_ptr<name_tree::Entry>
286 shared_ptr<name_tree::Entry> m_entry;
287 shared_ptr<name_tree::Entry> m_subTreeRoot;
288 shared_ptr<name_tree::EntrySelector> m_entrySelector;
289 shared_ptr<name_tree::EntrySubTreeSelector> m_entrySubTreeSelector;
291 bool m_shouldVisitChildren;
303 resize(
size_t newNBuckets);
308 size_t m_minNBuckets;
309 double m_enlargeLoadFactor;
310 size_t m_enlargeThreshold;
312 double m_shrinkLoadFactor;
313 size_t m_shrinkThreshold;
314 double m_shrinkFactor;
316 shared_ptr<name_tree::Entry> m_end;
327 std::pair<shared_ptr<name_tree::Entry>,
bool>
328 insert(
const Name& prefix);
347 inline shared_ptr<name_tree::Entry>
350 return fibEntry.m_nameTreeEntry;
353 inline shared_ptr<name_tree::Entry>
356 return pitEntry.m_nameTreeEntry;
359 inline shared_ptr<name_tree::Entry>
362 return measurementsEntry.m_nameTreeEntry;
365 inline shared_ptr<name_tree::Entry>
368 return strategyChoiceEntry.m_nameTreeEntry;
380 return m_endIterator;
389 inline shared_ptr<name_tree::Entry>
406 return m_entry == other.m_entry;
412 return m_entry != other.m_entry;
417 #endif // NFD_DAEMON_TABLE_NAME_TREE_HPP
bool operator==(const const_iterator &other) const
boost::iterator_range< const_iterator > partialEnumerate(const Name &prefix, const name_tree::EntrySubTreeSelector &entrySubTreeSelector=name_tree::AnyEntrySubTree()) const
Enumerate all entries under a prefix, optionally filtered by an EntrySubTreeSelector.
size_t computeHash(const Name &prefix)
Compute the hash value of the given name prefix's WIRE FORMAT.
NameTree(size_t nBuckets=1024)
const_iterator begin() const
Get an iterator pointing to the first NameTree entry.
bool eraseEntryIfEmpty(shared_ptr< name_tree::Entry > entry)
Delete a Name Tree Entry if this entry is empty.
shared_ptr< name_tree::Entry > get(const fib::Entry &fibEntry) const
get NameTree entry from attached FIB entry
boost::iterator_range< const_iterator > findAllMatches(const Name &prefix, const name_tree::EntrySelector &entrySelector=name_tree::AnyEntry()) const
Enumerate all the name prefixes that satisfy the prefix and entrySelector.
function< std::pair< bool, bool >const Entry &entry)> EntrySubTreeSelector
a predicate to accept or reject an Entry and its children
const_iterator end() const
Get an iterator referring to the past-the-end FIB entry.
const name_tree::Entry & operator*() const
shared_ptr< name_tree::Entry > findLongestPrefixMatch(const Name &prefix, const name_tree::EntrySelector &entrySelector=name_tree::AnyEntry()) const
Longest prefix matching for the given name.
std::vector< size_t > computeHashSet(const Name &prefix)
Incrementally compute hash values.
size_t getNBuckets() const
Get the number of buckets in the Name Tree (NPHT)
represents a Measurements entry
size_t size() const
Get the number of occupied entries in the Name Tree.
std::pair< bool, bool > operator()(const Entry &entry)
bool operator!=(const const_iterator &other) const
void dump(std::ostream &output) const
Dump all the information stored in the Name Tree for debugging.
represents a Strategy Choice entry
shared_ptr< name_tree::Entry > lookup(const Name &prefix)
Look for the Name Tree Entry that contains this name prefix.
const_iterator operator++()
function< bool(const Entry &entry)> EntrySelector
a predicate to accept or reject an Entry in find operations
shared_ptr< name_tree::Entry > findExactMatch(const Name &prefix) const
Exact match lookup for the given name prefix.
shared_ptr< name_tree::Entry > operator->() const
boost::iterator_range< const_iterator > fullEnumerate(const name_tree::EntrySelector &entrySelector=name_tree::AnyEntry()) const
Enumerate all entries, optionally filtered by an EntrySelector.
bool operator()(const Entry &entry)