represents the Measurements table More...
#include <measurements.hpp>
Public Member Functions | |
Measurements (NameTree &nametree) | |
shared_ptr< measurements::Entry > | get (const Name &name) |
find or insert a Measurements entry for name More... | |
shared_ptr< measurements::Entry > | get (const fib::Entry &fibEntry) |
find or insert a Measurements entry for fibEntry.getPrefix() More... | |
shared_ptr< measurements::Entry > | get (const pit::Entry &pitEntry) |
find or insert a Measurements entry for pitEntry.getName() More... | |
shared_ptr< measurements::Entry > | getParent (const measurements::Entry &child) |
find or insert a Measurements entry for child's parent More... | |
shared_ptr< measurements::Entry > | findLongestPrefixMatch (const Name &name, const measurements::EntryPredicate &pred=measurements::AnyEntry()) const |
perform a longest prefix match for name More... | |
shared_ptr< measurements::Entry > | findLongestPrefixMatch (const pit::Entry &pitEntry, const measurements::EntryPredicate &pred=measurements::AnyEntry()) const |
perform a longest prefix match for pitEntry.getName() More... | |
shared_ptr< measurements::Entry > | findExactMatch (const Name &name) const |
perform an exact match More... | |
void | extendLifetime (measurements::Entry &entry, const time::nanoseconds &lifetime) |
extend lifetime of an entry More... | |
size_t | size () const |
template<typename K > | |
shared_ptr< Entry > | findLongestPrefixMatchImpl (const K &key, const measurements::EntryPredicate &pred) const |
Static Public Member Functions | |
static time::nanoseconds | getInitialLifetime () |
represents the Measurements table
Definition at line 75 of file measurements.hpp.
|
explicit |
Definition at line 35 of file measurements.cpp.
References get(), getInitialLifetime(), nfd::name_tree::Entry::getMeasurementsEntry(), nfd::name_tree::Entry::getPrefix(), ndn::time::steady_clock::now(), nfd::scheduler::schedule(), and nfd::name_tree::Entry::setMeasurementsEntry().
shared_ptr< Entry > nfd::Measurements::get | ( | const Name & | name | ) |
find or insert a Measurements entry for name
Definition at line 60 of file measurements.cpp.
References nfd::NameTree::lookup().
Referenced by Measurements().
shared_ptr< Entry > nfd::Measurements::get | ( | const fib::Entry & | fibEntry | ) |
find or insert a Measurements entry for fibEntry.getPrefix()
Definition at line 67 of file measurements.cpp.
References nfd::NameTree::get().
shared_ptr< Entry > nfd::Measurements::get | ( | const pit::Entry & | pitEntry | ) |
find or insert a Measurements entry for pitEntry.getName()
Definition at line 74 of file measurements.cpp.
References nfd::NameTree::get().
shared_ptr< Entry > nfd::Measurements::getParent | ( | const measurements::Entry & | child | ) |
find or insert a Measurements entry for child's parent
nullptr | if child is the root entry |
Definition at line 81 of file measurements.cpp.
References nfd::NameTree::get(), and nfd::name_tree::Entry::getParent().
shared_ptr< Entry > nfd::Measurements::findLongestPrefixMatch | ( | const Name & | name, |
const measurements::EntryPredicate & | pred = measurements::AnyEntry() |
||
) | const |
perform a longest prefix match for name
Definition at line 110 of file measurements.cpp.
shared_ptr< Entry > nfd::Measurements::findLongestPrefixMatch | ( | const pit::Entry & | pitEntry, |
const measurements::EntryPredicate & | pred = measurements::AnyEntry() |
||
) | const |
perform a longest prefix match for pitEntry.getName()
Definition at line 117 of file measurements.cpp.
References nfd::NameTree::get().
shared_ptr< Entry > nfd::Measurements::findExactMatch | ( | const Name & | name | ) | const |
perform an exact match
Definition at line 125 of file measurements.cpp.
References nfd::NameTree::lookup().
|
inlinestatic |
Definition at line 153 of file measurements.hpp.
Referenced by Measurements().
void nfd::Measurements::extendLifetime | ( | measurements::Entry & | entry, |
const time::nanoseconds & | lifetime | ||
) |
extend lifetime of an entry
The entry will be kept until at least now()+lifetime.
Definition at line 134 of file measurements.cpp.
References nfd::scheduler::cancel(), nfd::NameTree::eraseEntryIfEmpty(), nfd::NameTree::get(), ndn::time::steady_clock::now(), and nfd::scheduler::schedule().
|
inline |
Definition at line 159 of file measurements.hpp.
Referenced by nfd::StatusServer::StatusServer().
shared_ptr<Entry> nfd::Measurements::findLongestPrefixMatchImpl | ( | const K & | key, |
const measurements::EntryPredicate & | pred | ||
) | const |
Definition at line 95 of file measurements.cpp.
References nfd::NameTree::findLongestPrefixMatch(), and nfd::name_tree::Entry::getMeasurementsEntry().