The Measurements table. More...
#include <daemon/table/measurements.hpp>
Public Member Functions | |
Measurements (NameTree &nameTree) | |
void | extendLifetime (Entry &entry, const time::nanoseconds &lifetime) |
Extend lifetime of an entry. More... | |
Entry * | findExactMatch (const Name &name) const |
Perform an exact match. 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 & | get (const fib::Entry &fibEntry) |
Equivalent to get(fibEntry.getPrefix()) . More... | |
Entry & | get (const Name &name) |
Find or insert an entry by name. 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... | |
size_t | size () const |
Static Public Member Functions | |
static time::nanoseconds | getInitialLifetime () |
static constexpr size_t | getMaxDepth () |
Maximum depth of a Measurements entry. More... | |
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 fw::Strategy::getMeasurements(), and then place any object that derive from StrategyInfo type onto Measurements entries.
Definition at line 85 of file measurements.hpp.
|
explicit |
Definition at line 34 of file measurements.cpp.
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 126 of file measurements.cpp.
Entry * nfd::measurements::Measurements::findExactMatch | ( | const Name & | name | ) | const |
Perform an exact match.
Definition at line 119 of file measurements.cpp.
Entry * nfd::measurements::Measurements::findLongestPrefixMatch | ( | const Name & | name, |
const EntryPredicate & | pred = AnyEntry() |
||
) | const |
Perform a longest prefix match for name
.
Definition at line 107 of file measurements.cpp.
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 113 of file measurements.cpp.
Entry & nfd::measurements::Measurements::get | ( | const fib::Entry & | fibEntry | ) |
Equivalent to get(fibEntry.getPrefix())
.
Definition at line 65 of file measurements.cpp.
Entry & nfd::measurements::Measurements::get | ( | const Name & | name | ) |
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 58 of file measurements.cpp.
Entry & nfd::measurements::Measurements::get | ( | const pit::Entry & | pitEntry | ) |
Equivalent to get(pitEntry.getName(), std::min(pitEntry.getName().size(), getMaxDepth()))
.
Definition at line 72 of file measurements.cpp.
|
inlinestatic |
Definition at line 142 of file measurements.hpp.
|
inlinestaticconstexpr |
Maximum depth of a Measurements entry.
Definition at line 94 of file measurements.hpp.
Find or insert a parent entry.
nullptr | child is the root entry |
Definition at line 79 of file measurements.cpp.
|
inline |
Definition at line 155 of file measurements.hpp.