32 namespace measurements {
35 : m_nameTree(nameTree)
44 if (entry !=
nullptr) {
62 return this->
get(nte);
69 return this->
get(nte);
76 return this->
get(nte);
88 BOOST_ASSERT(nte !=
nullptr);
89 return &this->
get(*nte);
94 Measurements::findLongestPrefixMatchImpl(
const K& key,
const EntryPredicate& pred)
const 99 return entry !=
nullptr && pred(*entry);
101 if (match !=
nullptr) {
129 BOOST_ASSERT(m_nameTree.
getEntry(entry) !=
nullptr);
132 if (entry.m_expiry >= expiry) {
138 entry.m_expiry = expiry;
143 Measurements::cleanup(
Entry& entry)
146 BOOST_ASSERT(nte !=
nullptr);
const Name & getName() const
Entry * findExactMatch(const Name &name) const
perform an exact match
Measurements(NameTree &nameTree)
static time_point now() noexcept
std::function< bool(const Entry &)> EntryPredicate
a predicate that accepts or rejects an entry
Entry * findLongestPrefixMatch(const Name &name, const EntryPredicate &pred=AnyEntry()) const
perform a longest prefix match for name
Entry & lookup(const Name &name, size_t prefixLen)
find or insert an entry by name
Entry * findLongestPrefixMatch(const Name &name, const EntrySelector &entrySelector=AnyEntry()) const
longest prefix matching
void setMeasurementsEntry(unique_ptr< measurements::Entry > measurementsEntry)
represents a Measurements entry
measurements::Entry * getMeasurementsEntry() const
void cancel(EventId eventId)
Cancel a scheduled event.
Entry * getParent(const Entry &child)
find or insert a parent entry
Copyright (c) 2011-2015 Regents of the University of California.
void extendLifetime(Entry &entry, const time::nanoseconds &lifetime)
extend lifetime of an entry
static constexpr size_t getMaxDepth()
maximum depth of a Measurements entry
Entry * getEntry(const EntryT &tableEntry) const
Represents an absolute name.
size_t eraseIfEmpty(Entry *entry, bool canEraseAncestors=true)
delete the entry if it is empty
a common index structure for FIB, PIT, StrategyChoice, and Measurements
const Name & getName() const
EventId schedule(time::nanoseconds after, const EventCallback &event)
Schedule an event.
bool empty() const
Check if name is empty.
Entry * findExactMatch(const Name &name, size_t prefixLen=std::numeric_limits< size_t >::max()) const
exact match lookup
Entry * getParent() const
Entry & get(const Name &name)
find or insert an entry by name
const Name & getName() const
static time::nanoseconds getInitialLifetime()
an entry in the name tree
static constexpr size_t getMaxDepth()
maximum depth of the name tree