33 : m_interest(interest.shared_from_this())
40 BOOST_ASSERT(m_interest->getName().compare(0, nEqualNameComps,
41 interest.getName(), 0, nEqualNameComps) == 0);
43 return m_interest->getName().compare(nEqualNameComps, Name::npos,
44 interest.getName(), nEqualNameComps) == 0 &&
45 m_interest->getCanBePrefix() == interest.getCanBePrefix() &&
46 m_interest->getMustBeFresh() == interest.getMustBeFresh();
50 InRecordCollection::iterator
53 return std::find_if(m_inRecords.begin(), m_inRecords.end(),
54 [&face] (
const InRecord& inRecord) { return &inRecord.getFace() == &face; });
57 InRecordCollection::iterator
60 BOOST_ASSERT(this->
canMatch(interest));
62 auto it = std::find_if(m_inRecords.begin(), m_inRecords.end(),
63 [&face] (
const InRecord& inRecord) { return &inRecord.getFace() == &face; });
64 if (it == m_inRecords.end()) {
65 m_inRecords.emplace_front(face);
66 it = m_inRecords.begin();
76 auto it = std::find_if(m_inRecords.begin(), m_inRecords.end(),
77 [&face] (
const InRecord& inRecord) { return &inRecord.getFace() == &face; });
78 if (it != m_inRecords.end()) {
79 m_inRecords.erase(it);
89 OutRecordCollection::iterator
92 return std::find_if(m_outRecords.begin(), m_outRecords.end(),
93 [&face] (
const OutRecord& outRecord) { return &outRecord.getFace() == &face; });
96 OutRecordCollection::iterator
99 BOOST_ASSERT(this->
canMatch(interest));
101 auto it = std::find_if(m_outRecords.begin(), m_outRecords.end(),
102 [&face] (
const OutRecord& outRecord) { return &outRecord.getFace() == &face; });
103 if (it == m_outRecords.end()) {
104 m_outRecords.emplace_front(face);
105 it = m_outRecords.begin();
108 it->update(interest);
115 auto it = std::find_if(m_outRecords.begin(), m_outRecords.end(),
116 [&face] (
const OutRecord& outRecord) { return &outRecord.getFace() == &face; });
117 if (it != m_outRecords.end()) {
118 m_outRecords.erase(it);
Generalization of a network interface.
bool canMatch(const Interest &interest, size_t nEqualNameComps=0) const
InRecordCollection::iterator getInRecord(const Face &face)
Get the in-record for face.
void deleteInRecord(const Face &face)
Delete the in-record for face if it exists.
Entry(const Interest &interest)
OutRecordCollection::iterator insertOrUpdateOutRecord(Face &face, const Interest &interest)
Insert or update an out-record.
void clearInRecords()
Delete all in-records.
InRecordCollection::iterator insertOrUpdateInRecord(Face &face, const Interest &interest)
Insert or update an in-record.
OutRecordCollection::iterator getOutRecord(const Face &face)
Get the out-record for face.
void deleteOutRecord(const Face &face)
Delete the out-record for face if it exists.
Contains information about an Interest from an incoming face.
Contains information about an Interest toward an outgoing face.