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

represents the Measurements table More...

#include <measurements.hpp>

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

Public Member Functions

 Measurements (NameTree &nametree)
 
shared_ptr< measurements::Entryget (const Name &name)
 find or insert a Measurements entry for name More...
 
shared_ptr< measurements::Entryget (const fib::Entry &fibEntry)
 find or insert a Measurements entry for fibEntry.getPrefix() More...
 
shared_ptr< measurements::Entryget (const pit::Entry &pitEntry)
 find or insert a Measurements entry for pitEntry.getName() More...
 
shared_ptr< measurements::EntrygetParent (const measurements::Entry &child)
 find or insert a Measurements entry for child's parent More...
 
shared_ptr< measurements::EntryfindLongestPrefixMatch (const Name &name, const measurements::EntryPredicate &pred=measurements::AnyEntry()) const
 perform a longest prefix match for name More...
 
shared_ptr< measurements::EntryfindLongestPrefixMatch (const pit::Entry &pitEntry, const measurements::EntryPredicate &pred=measurements::AnyEntry()) const
 perform a longest prefix match for pitEntry.getName() More...
 
shared_ptr< measurements::EntryfindExactMatch (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< EntryfindLongestPrefixMatchImpl (const K &key, const measurements::EntryPredicate &pred) 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()

Member Function Documentation

§ get() [1/3]

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

§ get() [2/3]

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 ndn::Name::empty(), nfd::NameTree::get(), nfd::fib::Entry::getPrefix(), and nfd::NameTree::lookup().

§ get() [3/3]

shared_ptr< Entry > nfd::Measurements::get ( const pit::Entry pitEntry)

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

Definition at line 81 of file measurements.cpp.

References nfd::NameTree::get().

§ getParent()

shared_ptr< Entry > nfd::Measurements::getParent ( const measurements::Entry child)

find or insert a Measurements entry for child's parent

Return values
nullptrif child is the root entry

Definition at line 93 of file measurements.cpp.

References nfd::NameTree::get(), nfd::measurements::Entry::getName(), nfd::name_tree::Entry::getParent(), and ndn::Name::size().

§ findLongestPrefixMatch() [1/2]

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

§ findLongestPrefixMatch() [2/2]

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

References nfd::NameTree::get().

§ findExactMatch()

shared_ptr< Entry > nfd::Measurements::findExactMatch ( const Name name) const

perform an exact match

Definition at line 137 of file measurements.cpp.

References nfd::NameTree::lookup().

§ getInitialLifetime()

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

Definition at line 153 of file measurements.hpp.

Referenced by Measurements().

§ extendLifetime()

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

References nfd::scheduler::cancel(), nfd::NameTree::eraseEntryIfEmpty(), nfd::NameTree::get(), ndn::time::steady_clock::now(), and nfd::scheduler::schedule().

§ size()

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

§ findLongestPrefixMatchImpl()

template<typename K >
shared_ptr<Entry> nfd::Measurements::findLongestPrefixMatchImpl ( const K &  key,
const measurements::EntryPredicate pred 
) const

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