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

represents 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 a Measurements entry for name More...
 
Entryget (const fib::Entry &fibEntry)
 find or insert a Measurements entry for fibEntry.getPrefix() More...
 
Entryget (const pit::Entry &pitEntry)
 find or insert a Measurements entry for pitEntry.getName() More...
 
EntrygetParent (const Entry &child)
 find or insert a Measurements entry for child's parent 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 time::nanoseconds getInitialLifetime ()
 

Detailed Description

represents the Measurements table

Definition at line 75 of file measurements.hpp.

Constructor & Destructor Documentation

◆ Measurements()

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

Definition at line 34 of file measurements.cpp.

Member Function Documentation

◆ get() [1/3]

Entry & nfd::measurements::Measurements::get ( const Name name)

find or insert a Measurements entry for name

Definition at line 62 of file measurements.cpp.

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

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

◆ get() [2/3]

Entry & nfd::measurements::Measurements::get ( const fib::Entry fibEntry)

find or insert a Measurements entry for fibEntry.getPrefix()

Definition at line 69 of file measurements.cpp.

References nfd::fib::Entry::getPrefix(), and nfd::name_tree::NameTree::lookup().

◆ get() [3/3]

Entry & nfd::measurements::Measurements::get ( const pit::Entry pitEntry)

find or insert a Measurements entry for pitEntry.getName()

Definition at line 76 of file measurements.cpp.

References nfd::pit::Entry::getName(), and nfd::name_tree::NameTree::lookup().

◆ getParent()

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

find or insert a Measurements entry for child's parent

Return values
nullptrif child is the root entry

Definition at line 83 of file measurements.cpp.

References ndn::Name::empty(), 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 111 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 117 of file measurements.cpp.

References findLongestPrefixMatch(), and nfd::pit::Entry::getName().

◆ findExactMatch()

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

◆ getInitialLifetime()

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

Definition at line 151 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 130 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().

◆ size()

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

Definition at line 157 of file measurements.hpp.


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