nfd::pit::Pit Class Reference

Represents the Interest Table. More...

#include <daemon/table/pit.hpp>

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

Public Types

typedef Iterator const_iterator
 

Public Member Functions

 Pit (NameTree &nameTree)
 
const_iterator begin () const
 
void deleteInOutRecords (Entry *entry, const Face &face)
 Deletes in-records and out-records for face. More...
 
const_iterator end () const
 
void erase (Entry *entry)
 Deletes an entry. More...
 
shared_ptr< Entryfind (const Interest &interest) const
 Finds a PIT entry for interest. More...
 
DataMatchResult findAllDataMatches (const Data &data) const
 Performs a Data match. More...
 
std::pair< shared_ptr< Entry >, bool > insert (const Interest &interest)
 Inserts a PIT entry for interest. More...
 
size_t size () const
 

Detailed Description

Represents the Interest Table.

Definition at line 47 of file pit.hpp.

Member Typedef Documentation

Definition at line 102 of file pit.hpp.

Constructor & Destructor Documentation

nfd::pit::Pit::Pit ( NameTree &  nameTree)
explicit

Definition at line 37 of file pit.cpp.

Member Function Documentation

Pit::const_iterator nfd::pit::Pit::begin ( ) const
Returns
an iterator to the beginning
Note
Iteration order is implementation-defined.
Warning
Undefined behavior may occur if a FIB/PIT/Measurements/StrategyChoice entry is inserted or erased during iteration.

Definition at line 126 of file pit.cpp.

void nfd::pit::Pit::deleteInOutRecords ( Entry entry,
const Face &  face 
)

Deletes in-records and out-records for face.

Todo:
decide whether to delete PIT entry if there's no more in/out-record left

Definition at line 115 of file pit.cpp.

const_iterator nfd::pit::Pit::end ( ) const
inline
Returns
an iterator to the end
See also
begin()

Definition at line 116 of file pit.hpp.

void nfd::pit::Pit::erase ( Entry entry)
inline

Deletes an entry.

Definition at line 91 of file pit.hpp.

shared_ptr<Entry> nfd::pit::Pit::find ( const Interest &  interest) const
inline

Finds a PIT entry for interest.

Parameters
interestthe Interest
Returns
an existing entry with same Name and Selectors; otherwise nullptr

Definition at line 66 of file pit.hpp.

DataMatchResult nfd::pit::Pit::findAllDataMatches ( const Data &  data) const

Performs a Data match.

Returns
an iterable of all PIT entries matching data

Definition at line 86 of file pit.cpp.

std::pair<shared_ptr<Entry>, bool> nfd::pit::Pit::insert ( const Interest &  interest)
inline

Inserts a PIT entry for interest.

Parameters
interestthe Interest; must be created with make_shared
Returns
a new or existing entry with same Name and Selectors, and true for new entry, false for existing entry

Definition at line 77 of file pit.hpp.

size_t nfd::pit::Pit::size ( ) const
inline
Returns
number of entries

Definition at line 56 of file pit.hpp.