38 : m_nameTree(nameTree)
43 std::pair<shared_ptr<Entry>,
bool>
44 Pit::findOrInsert(
const Interest& interest,
bool allowInsert)
48 bool hasDigest =
name.size() > 0 &&
name[-1].isImplicitSha256Digest();
49 size_t nteDepth =
name.size() - static_cast<int>(hasDigest);
60 return {
nullptr,
true};
66 auto it = std::find_if(pitEntries.begin(), pitEntries.end(),
67 [&interest, nteDepth] (
const shared_ptr<Entry>& entry) {
69 return entry->canMatch(interest, nteDepth);
71 if (it != pitEntries.end()) {
77 return {
nullptr,
true};
80 auto entry = make_shared<Entry>(interest);
93 for (
const shared_ptr<Entry>& pitEntry : nte.
getPitEntries()) {
94 if (pitEntry->getInterest().matchesData(data))
95 matches.emplace_back(pitEntry);
106 BOOST_ASSERT(nte !=
nullptr);
118 BOOST_ASSERT(entry !=
nullptr);
void insertPitEntry(shared_ptr< pit::Entry > pitEntry)
void erase(Entry *entry)
deletes an entry
const Name & getName() const
Get name.
generalization of a network interface
void deleteInOutRecords(Entry *entry, const Face &face)
deletes in-record and out-record for face
const std::vector< shared_ptr< pit::Entry > > & getPitEntries() const
void erasePitEntry(pit::Entry *pitEntry)
Represents an Interest packet.
DataMatchResult findAllDataMatches(const Data &data) const
performs a Data match
Entry & lookup(const Name &name, size_t prefixLen)
find or insert an entry by name
std::vector< shared_ptr< Entry > > DataMatchResult
Range findAllMatches(const Name &name, const EntrySelector &entrySelector=AnyEntry()) const
all-prefixes match lookup
Copyright (c) 2011-2015 Regents of the University of California.
Entry * getEntry(const EntryT &tableEntry) const
void deleteOutRecord(const Face &face)
delete the out-record for face if it exists
Represents an absolute name.
Range fullEnumerate(const EntrySelector &entrySelector=AnyEntry()) const
enumerate all entries
void deleteInRecord(const Face &face)
delete the in-record for face if it exists
static bool nteHasPitEntries(const name_tree::Entry &nte)
size_t eraseIfEmpty(Entry *entry, bool canEraseAncestors=true)
delete the entry if it is empty
a common index structure for FIB, PIT, StrategyChoice, and Measurements
bool hasPitEntries() const
An unordered iterable of all PIT entries matching Data.
const_iterator begin() const
Entry * findExactMatch(const Name &name, size_t prefixLen=std::numeric_limits< size_t >::max()) const
exact match lookup
Represents a Data packet.
an entry in the name tree
const Name & getName() const
static constexpr size_t getMaxDepth()
maximum depth of the name tree