34 : m_interest(interest.shared_from_this())
41 BOOST_ASSERT(m_interest->getName().compare(0, nEqualNameComps,
42 interest.
getName(), 0, nEqualNameComps) == 0);
44 return m_interest->getName().compare(nEqualNameComps,
Name::npos,
45 interest.
getName(), nEqualNameComps) == 0 &&
51 InRecordCollection::iterator
54 return std::find_if(m_inRecords.begin(), m_inRecords.end(),
55 [&face] (
const InRecord& inRecord) {
return &inRecord.getFace() == &face; });
58 InRecordCollection::iterator
61 BOOST_ASSERT(this->
canMatch(interest));
63 auto it = std::find_if(m_inRecords.begin(), m_inRecords.end(),
64 [&face] (
const InRecord& inRecord) {
return &inRecord.getFace() == &face; });
65 if (it == m_inRecords.end()) {
66 m_inRecords.emplace_front(face);
67 it = m_inRecords.begin();
77 auto it = std::find_if(m_inRecords.begin(), m_inRecords.end(),
78 [&face] (
const InRecord& inRecord) {
return &inRecord.getFace() == &face; });
79 if (it != m_inRecords.end()) {
80 m_inRecords.erase(it);
90 OutRecordCollection::iterator
93 return std::find_if(m_outRecords.begin(), m_outRecords.end(),
94 [&face] (
const OutRecord& outRecord) {
return &outRecord.getFace() == &face; });
97 OutRecordCollection::iterator
100 BOOST_ASSERT(this->
canMatch(interest));
102 auto it = std::find_if(m_outRecords.begin(), m_outRecords.end(),
103 [&face] (
const OutRecord& outRecord) {
return &outRecord.getFace() == &face; });
104 if (it == m_outRecords.end()) {
105 m_outRecords.emplace_front(face);
106 it = m_outRecords.begin();
109 it->update(interest);
116 auto it = std::find_if(m_outRecords.begin(), m_outRecords.end(),
117 [&face] (
const OutRecord& outRecord) {
return &outRecord.getFace() == &face; });
118 if (it != m_outRecords.end()) {
119 m_outRecords.erase(it);
bool getMustBeFresh() const noexcept
Check whether the MustBeFresh element is present.
OutRecordCollection::iterator getOutRecord(const Face &face)
get the out-record for face
void clearInRecords()
delete all in-records
Contains information about an Interest from an incoming face.
bool getCanBePrefix() const noexcept
Check whether the CanBePrefix element is present.
InRecordCollection::iterator getInRecord(const Face &face)
get the in-record for face
static const size_t npos
Indicates "until the end" in getSubName() and compare().
Represents an Interest packet.
Copyright (c) 2011-2015 Regents of the University of California.
void deleteOutRecord(const Face &face)
delete the out-record for face if it exists
Entry(const Interest &interest)
void deleteInRecord(const Face &face)
delete the in-record for face if it exists
bool canMatch(const Interest &interest, size_t nEqualNameComps=0) const
InRecordCollection::iterator insertOrUpdateInRecord(Face &face, const Interest &interest)
insert or update an in-record
const Name & getName() const noexcept
OutRecordCollection::iterator insertOrUpdateOutRecord(Face &face, const Interest &interest)
insert or update an out-record
Contains information about an Interest toward an outgoing face.