table: simplify pit::Entry API
refs #3546
Change-Id: I6a9cb83b9e56ce1d1bb6047049378c51781605af
diff --git a/daemon/table/pit-entry.cpp b/daemon/table/pit-entry.cpp
index 21e4c53..d19369a 100644
--- a/daemon/table/pit-entry.cpp
+++ b/daemon/table/pit-entry.cpp
@@ -34,10 +34,11 @@
{
}
-const Name&
-Entry::getName() const
+InRecordCollection::iterator
+Entry::getInRecord(const Face& face)
{
- return m_interest->getName();
+ return std::find_if(m_inRecords.begin(), m_inRecords.end(),
+ [&face] (const InRecord& inRecord) { return inRecord.getFace().get() == &face; });
}
InRecordCollection::iterator
@@ -54,13 +55,6 @@
return it;
}
-InRecordCollection::const_iterator
-Entry::getInRecord(const Face& face) const
-{
- return std::find_if(m_inRecords.begin(), m_inRecords.end(),
- [&face] (const InRecord& inRecord) { return inRecord.getFace().get() == &face; });
-}
-
void
Entry::deleteInRecord(const Face& face)
{
@@ -72,12 +66,19 @@
}
void
-Entry::deleteInRecords()
+Entry::clearInRecords()
{
m_inRecords.clear();
}
OutRecordCollection::iterator
+Entry::getOutRecord(const Face& face)
+{
+ return std::find_if(m_outRecords.begin(), m_outRecords.end(),
+ [&face] (const OutRecord& outRecord) { return outRecord.getFace().get() == &face; });
+}
+
+OutRecordCollection::iterator
Entry::insertOrUpdateOutRecord(shared_ptr<Face> face, const Interest& interest)
{
auto it = std::find_if(m_outRecords.begin(), m_outRecords.end(),
@@ -91,13 +92,6 @@
return it;
}
-OutRecordCollection::iterator
-Entry::getOutRecord(const Face& face)
-{
- return std::find_if(m_outRecords.begin(), m_outRecords.end(),
- [&face] (const OutRecord& outRecord) { return outRecord.getFace().get() == &face; });
-}
-
void
Entry::deleteOutRecord(const Face& face)
{