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

an Interest table entry More...

#include <pit-entry.hpp>

Inheritance diagram for nfd::pit::Entry:
Collaboration diagram for nfd::pit::Entry:

Public Member Functions

 Entry (const Interest &interest)
 
const InterestgetInterest () const
 
const NamegetName () const
 
bool canMatch (const Interest &interest, size_t nEqualNameComps=0) const
 
const InRecordCollectiongetInRecords () const
 
bool hasInRecords () const
 
InRecordCollection::iterator in_begin ()
 
InRecordCollection::const_iterator in_begin () const
 
InRecordCollection::iterator in_end ()
 
InRecordCollection::const_iterator in_end () const
 
InRecordCollection::iterator getInRecord (const Face &face)
 get the in-record for face More...
 
InRecordCollection::iterator insertOrUpdateInRecord (Face &face, const Interest &interest)
 insert or update an in-record More...
 
void deleteInRecord (const Face &face)
 delete the in-record for face if it exists More...
 
void clearInRecords ()
 delete all in-records More...
 
const OutRecordCollectiongetOutRecords () const
 
bool hasOutRecords () const
 
OutRecordCollection::iterator out_begin ()
 
OutRecordCollection::const_iterator out_begin () const
 
OutRecordCollection::iterator out_end ()
 
OutRecordCollection::const_iterator out_end () const
 
OutRecordCollection::iterator getOutRecord (const Face &face)
 get the out-record for face More...
 
OutRecordCollection::iterator insertOrUpdateOutRecord (Face &face, const Interest &interest)
 insert or update an out-record More...
 
void deleteOutRecord (const Face &face)
 delete the out-record for face if it exists More...
 
- Public Member Functions inherited from nfd::StrategyInfoHost
template<typename T >
T * getStrategyInfo () const
 get a StrategyInfo item More...
 
template<typename T , typename ... A>
std::pair< T *, bool > insertStrategyInfo (A &&... args)
 insert a StrategyInfo item More...
 
template<typename T >
size_t eraseStrategyInfo ()
 erase a StrategyInfo item More...
 
void clearStrategyInfo ()
 clear all StrategyInfo items More...
 

Public Attributes

scheduler::EventId expiryTimer
 expiry timer More...
 
bool isSatisfied
 indicate if PIT entry is satisfied More...
 
time::milliseconds dataFreshnessPeriod
 Data freshness period. More...
 

Friends

class name_tree::Entry
 

Detailed Description

an Interest table entry

An Interest table entry represents either a pending Interest or a recently satisfied Interest. Each entry contains a collection of in-records, a collection of out-records, and two timers used in forwarding pipelines. In addition, the entry, in-records, and out-records are subclasses of StrategyInfoHost, which allows forwarding strategy to store arbitrary information on them.

Definition at line 59 of file pit-entry.hpp.

Constructor & Destructor Documentation

◆ Entry()

nfd::pit::Entry::Entry ( const Interest interest)
explicit

Definition at line 32 of file pit-entry.cpp.

Member Function Documentation

◆ getInterest()

const Interest& nfd::pit::Entry::getInterest ( ) const
inline
Returns
the representative Interest of the PIT entry
Note
Every Interest in in-records and out-records should have same Name and Selectors as the representative Interest.
Todo:
#3162 require Link field to match the representative Interest

Definition at line 71 of file pit-entry.hpp.

Referenced by nfd::fw::Strategy::lookupFib().

◆ getName()

const Name& nfd::pit::Entry::getName ( ) const
inline

◆ canMatch()

bool nfd::pit::Entry::canMatch ( const Interest interest,
size_t  nEqualNameComps = 0 
) const
Returns
whether interest matches this entry
Parameters
interestthe Interest
nEqualNameCompsnumber of initial name components guaranteed to be equal

Definition at line 41 of file pit-entry.cpp.

References ndn::Interest::getName(), ndn::Interest::getSelectors(), and ndn::Name::npos.

Referenced by insertOrUpdateInRecord(), and insertOrUpdateOutRecord().

◆ getInRecords()

const InRecordCollection& nfd::pit::Entry::getInRecords ( ) const
inline

◆ hasInRecords()

bool nfd::pit::Entry::hasInRecords ( ) const
inline
Return values
trueThere is at least one in-record. This implies some downstream is waiting for Data or Nack.
falseThere is no in-record. This implies the entry is new or has been satisfied or Nacked.

Definition at line 106 of file pit-entry.hpp.

◆ in_begin() [1/2]

InRecordCollection::iterator nfd::pit::Entry::in_begin ( )
inline

Definition at line 112 of file pit-entry.hpp.

Referenced by nfd::fw::canForwardToLegacy().

◆ in_begin() [2/2]

InRecordCollection::const_iterator nfd::pit::Entry::in_begin ( ) const
inline

Definition at line 118 of file pit-entry.hpp.

◆ in_end() [1/2]

InRecordCollection::iterator nfd::pit::Entry::in_end ( )
inline

Definition at line 124 of file pit-entry.hpp.

Referenced by nfd::fw::canForwardToLegacy().

◆ in_end() [2/2]

InRecordCollection::const_iterator nfd::pit::Entry::in_end ( ) const
inline

Definition at line 130 of file pit-entry.hpp.

◆ getInRecord()

InRecordCollection::iterator nfd::pit::Entry::getInRecord ( const Face face)

get the in-record for face

Returns
an iterator to the in-record, or .in_end() if it does not exist

Definition at line 53 of file pit-entry.cpp.

◆ insertOrUpdateInRecord()

InRecordCollection::iterator nfd::pit::Entry::insertOrUpdateInRecord ( Face face,
const Interest interest 
)

insert or update an in-record

Returns
an iterator to the new or updated in-record

Definition at line 60 of file pit-entry.cpp.

References canMatch().

◆ deleteInRecord()

void nfd::pit::Entry::deleteInRecord ( const Face face)

delete the in-record for face if it exists

Definition at line 76 of file pit-entry.cpp.

Referenced by nfd::pit::Pit::deleteInOutRecords().

◆ clearInRecords()

void nfd::pit::Entry::clearInRecords ( )

delete all in-records

Definition at line 86 of file pit-entry.cpp.

◆ getOutRecords()

const OutRecordCollection& nfd::pit::Entry::getOutRecords ( ) const
inline

◆ hasOutRecords()

bool nfd::pit::Entry::hasOutRecords ( ) const
inline
Return values
trueThere is at least one out-record. This implies the Interest has been forwarded to some upstream, and they haven't returned Data, but may have returned Nacks.
falseThere is no out-record. This implies the Interest has not been forwarded.

Definition at line 173 of file pit-entry.hpp.

◆ out_begin() [1/2]

OutRecordCollection::iterator nfd::pit::Entry::out_begin ( )
inline

◆ out_begin() [2/2]

OutRecordCollection::const_iterator nfd::pit::Entry::out_begin ( ) const
inline

Definition at line 185 of file pit-entry.hpp.

◆ out_end() [1/2]

OutRecordCollection::iterator nfd::pit::Entry::out_end ( )
inline

◆ out_end() [2/2]

OutRecordCollection::const_iterator nfd::pit::Entry::out_end ( ) const
inline

Definition at line 197 of file pit-entry.hpp.

◆ getOutRecord()

OutRecordCollection::iterator nfd::pit::Entry::getOutRecord ( const Face face)

get the out-record for face

Returns
an iterator to the out-record, or .out_end() if it does not exist

Definition at line 92 of file pit-entry.cpp.

Referenced by nfd::fw::RetxSuppressionExponential::decidePerUpstream().

◆ insertOrUpdateOutRecord()

OutRecordCollection::iterator nfd::pit::Entry::insertOrUpdateOutRecord ( Face face,
const Interest interest 
)

insert or update an out-record

Returns
an iterator to the new or updated out-record

Definition at line 99 of file pit-entry.cpp.

References canMatch().

◆ deleteOutRecord()

void nfd::pit::Entry::deleteOutRecord ( const Face face)

delete the out-record for face if it exists

Definition at line 115 of file pit-entry.cpp.

Referenced by nfd::pit::Pit::deleteInOutRecords().

Friends And Related Function Documentation

◆ name_tree::Entry

friend class name_tree::Entry
friend

Definition at line 242 of file pit-entry.hpp.

Member Data Documentation

◆ expiryTimer

scheduler::EventId nfd::pit::Entry::expiryTimer

expiry timer

This timer is used in forwarding pipelines to delete the entry

Definition at line 224 of file pit-entry.hpp.

◆ isSatisfied

bool nfd::pit::Entry::isSatisfied

indicate if PIT entry is satisfied

Definition at line 228 of file pit-entry.hpp.

◆ dataFreshnessPeriod

time::milliseconds nfd::pit::Entry::dataFreshnessPeriod

Data freshness period.

Note
This field is meaningful only if isSatisfied is true

Definition at line 233 of file pit-entry.hpp.


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