35 : m_nameTree(nameTree)
43 if (entry !=
nullptr) {
61 return this->
get(nte);
68 return this->
get(nte);
75 return this->
get(nte);
87 BOOST_ASSERT(nte !=
nullptr);
88 return &this->
get(*nte);
93 Measurements::findLongestPrefixMatchImpl(
const K& key,
const EntryPredicate& pred)
const
98 return entry !=
nullptr && pred(*entry);
100 if (match !=
nullptr) {
128 BOOST_ASSERT(m_nameTree.
getEntry(entry) !=
nullptr);
130 auto expiry = time::steady_clock::now() + lifetime;
131 if (entry.m_expiry >= expiry) {
136 entry.m_cleanup.cancel();
137 entry.m_expiry = expiry;
138 entry.m_cleanup =
getScheduler().schedule(lifetime, [&] { cleanup(entry); });
142 Measurements::cleanup(
Entry& entry)
145 BOOST_ASSERT(nte !=
nullptr);
Represents an entry in the FIB.
Represents an entry in the Measurements table.
const Name & getName() const noexcept
static constexpr size_t getMaxDepth()
Maximum depth of a Measurements entry.
Measurements(NameTree &nameTree)
void extendLifetime(Entry &entry, const time::nanoseconds &lifetime)
Extend lifetime of an entry.
Entry * getParent(const Entry &child)
Find or insert a parent entry.
Entry & get(const Name &name)
Find or insert an entry by name.
Entry * findExactMatch(const Name &name) const
Perform an exact match.
static time::nanoseconds getInitialLifetime()
Entry * findLongestPrefixMatch(const Name &name, const EntryPredicate &pred=AnyEntry()) const
Perform a longest prefix match for name.
An entry in the name tree.
void setMeasurementsEntry(unique_ptr< measurements::Entry > measurementsEntry)
measurements::Entry * getMeasurementsEntry() const
Entry * getParent() const noexcept
const Name & getName() const noexcept
A common index structure for FIB, PIT, StrategyChoice, and Measurements.
size_t eraseIfEmpty(Entry *entry, bool canEraseAncestors=true)
Delete the entry if it is empty.
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.
Represents an entry in the Interest table (PIT).
const Name & getName() const
std::function< bool(const Entry &)> EntryPredicate
A predicate that accepts or rejects an entry.
ndn::Scheduler & getScheduler()
Returns the global Scheduler instance for the calling thread.