NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
nfd::measurements::Measurements Class Reference

The Measurements table. More...

#include <measurements.hpp>

Inheritance diagram for nfd::measurements::Measurements:
Collaboration diagram for nfd::measurements::Measurements:

Public Member Functions

 Measurements (NameTree &nameTree)
 
Entryget (const Name &name)
 Find or insert an entry by name. More...
 
Entryget (const fib::Entry &fibEntry)
 Equivalent to get(fibEntry.getPrefix()) More...
 
Entryget (const pit::Entry &pitEntry)
 Equivalent to get(pitEntry.getName(), std::min(pitEntry.getName().size(), getMaxDepth())) More...
 
EntrygetParent (const Entry &child)
 Find or insert a parent entry. More...
 
EntryfindLongestPrefixMatch (const Name &name, const EntryPredicate &pred=AnyEntry()) const
 Perform a longest prefix match for name. More...
 
EntryfindLongestPrefixMatch (const pit::Entry &pitEntry, const EntryPredicate &pred=AnyEntry()) const
 Perform a longest prefix match for pitEntry.getName() More...
 
EntryfindExactMatch (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 ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Measurements()

nfd::measurements::Measurements::Measurements ( NameTree nameTree)
explicit

Definition at line 35 of file measurements.cpp.

Member Function Documentation

◆ getMaxDepth()

static constexpr size_t nfd::measurements::Measurements::getMaxDepth ( )
inlinestaticconstexpr

maximum depth of a Measurements entry

Definition at line 88 of file measurements.hpp.

References nfd::name_tree::NameTree::getMaxDepth().

Referenced by get().

◆ get() [1/3]

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 59 of file measurements.cpp.

References getMaxDepth(), and nfd::name_tree::NameTree::lookup().

Referenced by nfd::measurements::MeasurementsAccessor::get(), get(), and getParent().

◆ get() [2/3]

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().

◆ get() [3/3]

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().

◆ getParent()

Entry * nfd::measurements::Measurements::getParent ( const Entry child)

Find or insert a parent entry.

Return values
nullptrchild is the root entry
Returns
get(child.getName().getPrefix(-1))

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().

◆ findLongestPrefixMatch() [1/2]

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().

◆ findLongestPrefixMatch() [2/2]

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().

◆ findExactMatch()

Entry * nfd::measurements::Measurements::findExactMatch ( const Name name) const

◆ getInitialLifetime()

static time::nanoseconds nfd::measurements::Measurements::getInitialLifetime ( )
inlinestatic

Definition at line 136 of file measurements.hpp.

◆ extendLifetime()

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 ndn::detail::CancelHandle::cancel(), nfd::name_tree::NameTree::getEntry(), nfd::getScheduler(), and ndn::time::steady_clock::now().

Referenced by nfd::measurements::MeasurementsAccessor::extendLifetime().

◆ size()

size_t nfd::measurements::Measurements::size ( ) const
inline

Definition at line 149 of file measurements.hpp.


The documentation for this class was generated from the following files: