26 #ifndef NFD_DAEMON_TABLE_NAME_TREE_ITERATOR_HPP
27 #define NFD_DAEMON_TABLE_NAME_TREE_ITERATOR_HPP
31 #include <boost/operators.hpp>
32 #include <boost/range/iterator_range_core.hpp>
68 constexpr std::pair<bool, bool>
75 class EnumerationImpl;
80 class Iterator :
public boost::forward_iterator_helper<Iterator, const Entry>
90 BOOST_ASSERT(m_impl !=
nullptr);
100 return lhs.m_entry == rhs.m_entry;
106 shared_ptr<EnumerationImpl> m_impl;
110 const Entry* m_entry =
nullptr;
114 const Entry* m_ref =
nullptr;
206 using Range = boost::iterator_range<Iterator>;
An entry in the name tree.
Enumeration operation implementation.
~EnumerationImpl()=default
EnumerationImpl(const NameTree &nt)
virtual void advance(Iterator &i)=0
Full enumeration implementation.
FullEnumerationImpl(const NameTree &nt, const EntrySelector &pred)
void advance(Iterator &i) final
A hashtable for fast exact name lookup.
const Entry & operator*() const noexcept
friend bool operator==(const Iterator &lhs, const Iterator &rhs) noexcept
friend std::ostream & operator<<(std::ostream &, const Iterator &)
A common index structure for FIB, PIT, StrategyChoice, and Measurements.
Partial enumeration implementation.
PartialEnumerationImpl(const NameTree &nt, const EntrySubTreeSelector &pred)
void advance(Iterator &i) final
Partial enumeration implementation.
PrefixMatchImpl(const NameTree &nt, const EntrySelector &pred)
std::ostream & operator<<(std::ostream &os, const Iterator &i)
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.
constexpr bool operator()(const Entry &) const noexcept
An EntrySubTreeSelector that accepts every Entry and its children.
constexpr std::pair< bool, bool > operator()(const Entry &) const noexcept