|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
38 : m_nameTree(nameTree)
42 std::pair<shared_ptr<Entry>,
bool>
43 Pit::findOrInsert(
const Interest& interest,
bool allowInsert)
47 bool hasDigest =
name.size() > 0 &&
name[-1].isImplicitSha256Digest();
48 size_t nteDepth =
name.size() -
static_cast<int>(hasDigest);
59 return {
nullptr,
true};
65 auto it = std::find_if(pitEntries.begin(), pitEntries.end(),
66 [&interest, nteDepth] (
const shared_ptr<Entry>& entry) {
68 return entry->canMatch(interest, nteDepth);
70 if (it != pitEntries.end()) {
76 return {
nullptr,
true};
79 auto entry = make_shared<Entry>(interest);
91 for (
const auto& nte : ntMatches) {
93 if (pitEntry->getInterest().matchesData(data))
94 matches.emplace_back(pitEntry);
105 BOOST_ASSERT(nte !=
nullptr);
117 BOOST_ASSERT(entry !=
nullptr);
const_iterator begin() const
An entry in the name tree.
void deleteOutRecord(const Face &face)
delete the out-record for face if it exists
Entry * getEntry(const EntryT &tableEntry) const
Range fullEnumerate(const EntrySelector &entrySelector=AnyEntry()) const
Enumerate all entries.
A common index structure for FIB, PIT, StrategyChoice, and Measurements.
const std::vector< shared_ptr< pit::Entry > > & getPitEntries() const
void erasePitEntry(pit::Entry *pitEntry)
An unordered iterable of all PIT entries matching Data.
size_t eraseIfEmpty(Entry *entry, bool canEraseAncestors=true)
Delete the entry if it is empty.
const Name & getName() const
Get name.
void deleteInRecord(const Face &face)
delete the in-record for face if it exists
Entry & lookup(const Name &name, size_t prefixLen)
Find or insert an entry by name.
Entry * findExactMatch(const Name &name, size_t prefixLen=std::numeric_limits< size_t >::max()) const
Exact match lookup.
Represents an absolute name.
Copyright (c) 2011-2015 Regents of the University of California.
void deleteInOutRecords(Entry *entry, const Face &face)
Deletes in-records and out-records for face.
generalization of a network interface
void insertPitEntry(shared_ptr< pit::Entry > pitEntry)
Represents an Interest packet.
Represents a Data packet.
DataMatchResult findAllDataMatches(const Data &data) const
Performs a Data match.
static constexpr size_t getMaxDepth()
Maximum depth of the name tree.
std::vector< shared_ptr< Entry > > DataMatchResult
void erase(Entry *entry)
Deletes an entry.
Range findAllMatches(const Name &name, const EntrySelector &entrySelector=AnyEntry()) const
All-prefixes match lookup.
const Name & getName() const noexcept
bool hasPitEntries() const
static bool nteHasPitEntries(const name_tree::Entry &nte)