the Measurements table More...
#include <measurements.hpp>
Public Member Functions | |
Measurements (NameTree &nameTree) | |
Entry & | get (const Name &name) |
find or insert an entry by name More... | |
Entry & | get (const fib::Entry &fibEntry) |
equivalent to get(fibEntry.getPrefix()) More... | |
Entry & | get (const pit::Entry &pitEntry) |
equivalent to get(pitEntry.getName(), std::min(pitEntry.getName().size(), getMaxDepth())) More... | |
Entry * | getParent (const Entry &child) |
find or insert a parent entry More... | |
Entry * | findLongestPrefixMatch (const Name &name, const EntryPredicate &pred=AnyEntry()) const |
perform a longest prefix match for name More... | |
Entry * | findLongestPrefixMatch (const pit::Entry &pitEntry, const EntryPredicate &pred=AnyEntry()) const |
perform a longest prefix match for pitEntry.getName() More... | |
Entry * | findExactMatch (const Name &name) const |
perform an exact match More... | |
void | extendLifetime (Entry &entry, const time::nanoseconds &lifetime) |
extend lifetime of an entry More... | |
size_t | size () const |
Static Public Member Functions | |
static constexpr size_t | getMaxDepth () |
maximum depth of a Measurements entry More... | |
static time::nanoseconds | getInitialLifetime () |
the Measurements table
The Measurements table is a data structure for forwarding strategies to store per name prefix measurements. A strategy can access this table via Strategy::getMeasurements()
, and then place any object that derive from StrategyInfo
type onto Measurements entries.
Definition at line 79 of file measurements.hpp.
|
explicit |
Definition at line 34 of file measurements.cpp.
|
inlinestatic |
maximum depth of a Measurements entry
Definition at line 88 of file measurements.hpp.
References nfd::name_tree::NameTree::getMaxDepth().
Referenced by get().
find or insert an entry by name
An entry name can have at most getMaxDepth()
components. If name
exceeds this limit, it is truncated to the first getMaxDepth()
components.
Definition at line 59 of file measurements.cpp.
References getMaxDepth(), and nfd::name_tree::NameTree::lookup().
Referenced by nfd::measurements::MeasurementsAccessor::get(), get(), and getParent().
Entry & nfd::measurements::Measurements::get | ( | const fib::Entry & | fibEntry | ) |
equivalent to get(fibEntry.getPrefix())
Definition at line 66 of file measurements.cpp.
References get(), and nfd::name_tree::NameTree::lookup().
Entry & nfd::measurements::Measurements::get | ( | const pit::Entry & | pitEntry | ) |
equivalent to get(pitEntry.getName(), std::min(pitEntry.getName().size(), getMaxDepth()))
Definition at line 73 of file measurements.cpp.
References get(), and nfd::name_tree::NameTree::lookup().
find or insert a parent entry
nullptr | child is the root entry |
Definition at line 80 of file measurements.cpp.
References ndn::Name::empty(), get(), nfd::name_tree::NameTree::getEntry(), nfd::measurements::Entry::getName(), and nfd::name_tree::Entry::getParent().
Referenced by nfd::measurements::MeasurementsAccessor::getParent().
Entry * nfd::measurements::Measurements::findLongestPrefixMatch | ( | const Name & | name, |
const EntryPredicate & | pred = AnyEntry() |
||
) | const |
perform a longest prefix match for name
Definition at line 108 of file measurements.cpp.
References nfd::name_tree::NameTree::getMaxDepth().
Referenced by nfd::measurements::MeasurementsAccessor::findLongestPrefixMatch(), and findLongestPrefixMatch().
Entry * nfd::measurements::Measurements::findLongestPrefixMatch | ( | const pit::Entry & | pitEntry, |
const EntryPredicate & | pred = AnyEntry() |
||
) | const |
perform a longest prefix match for pitEntry.getName()
Definition at line 114 of file measurements.cpp.
References findLongestPrefixMatch(), and nfd::pit::Entry::getName().
perform an exact match
Definition at line 120 of file measurements.cpp.
References nfd::name_tree::NameTree::findExactMatch(), and nfd::name_tree::Entry::getMeasurementsEntry().
Referenced by nfd::measurements::MeasurementsAccessor::findExactMatch().
|
inlinestatic |
Definition at line 168 of file measurements.hpp.
void nfd::measurements::Measurements::extendLifetime | ( | Entry & | entry, |
const time::nanoseconds & | lifetime | ||
) |
extend lifetime of an entry
The entry will be kept until at least now()+lifetime.
Definition at line 127 of file measurements.cpp.
References nfd::scheduler::cancel(), nfd::name_tree::NameTree::getEntry(), ndn::time::steady_clock::now(), and nfd::scheduler::schedule().
Referenced by nfd::measurements::MeasurementsAccessor::extendLifetime().
|
inline |
Definition at line 174 of file measurements.hpp.