nfd::pit::Entry Class Reference

An Interest table entry. More...

#include <daemon/table/pit-entry.hpp>

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

Public Member Functions

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

Public Attributes

time::milliseconds dataFreshnessPeriod = 0_ms
 Data freshness period. More...
 
scheduler::EventId expiryTimer
 Expiry timer. More...
 
bool isSatisfied = false
 Indicates whether this PIT entry is satisfied. 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 58 of file pit-entry.hpp.

Constructor & Destructor Documentation

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

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

Member Function Documentation

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
Todo:
#3162 match ForwardingHint field

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

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

delete all in-records

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

void nfd::StrategyInfoHost::clearStrategyInfo ( )
inlineinherited

Clear all StrategyInfo items.

Definition at line 93 of file strategy-info-host.hpp.

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

delete the in-record for face if it exists

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

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

delete the out-record for face if it exists

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

template<typename T >
size_t nfd::StrategyInfoHost::eraseStrategyInfo ( )
inlineinherited

Erase a StrategyInfo item.

Template Parameters
Ttype of StrategyInfo, must be a subclass of fw::StrategyInfo
Returns
number of items erased

Definition at line 82 of file strategy-info-host.hpp.

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 52 of file pit-entry.cpp.

const InRecordCollection& nfd::pit::Entry::getInRecords ( ) const
inline
Returns
collection of in-records

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

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 70 of file pit-entry.hpp.

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

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

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 91 of file pit-entry.cpp.

const OutRecordCollection& nfd::pit::Entry::getOutRecords ( ) const
inline
Returns
collection of in-records

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

template<typename T >
T* nfd::StrategyInfoHost::getStrategyInfo ( ) const
inlineinherited

Get a StrategyInfo item.

Template Parameters
Ttype of StrategyInfo, must be a subclass of fw::StrategyInfo
Returns
an existing StrategyInfo item of type T, or nullptr if it does not exist

Definition at line 44 of file strategy-info-host.hpp.

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 105 of file pit-entry.hpp.

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 172 of file pit-entry.hpp.

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

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

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

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

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

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

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

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

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

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 98 of file pit-entry.cpp.

template<typename T , typename... A>
std::pair<T*, bool> nfd::StrategyInfoHost::insertStrategyInfo ( A &&...  args)
inlineinherited

Insert a StrategyInfo item.

Template Parameters
Ttype of StrategyInfo, must be a subclass of fw::StrategyInfo
Returns
a new or existing StrategyInfo item of type T, and true for new item, false for existing item

Definition at line 63 of file strategy-info-host.hpp.

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

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

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

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

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

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

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

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

Friends And Related Function Documentation

friend class name_tree::Entry
friend

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

Member Data Documentation

time::milliseconds nfd::pit::Entry::dataFreshnessPeriod = 0_ms

Data freshness period.

Note
This field is meaningful only if isSatisfied is true

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

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

Expiry timer.

This timer is used in forwarding pipelines to delete the entry

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

bool nfd::pit::Entry::isSatisfied = false

Indicates whether this PIT entry is satisfied.

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