31 : m_data(std::move(data))
32 , m_isUnsolicited(isUnsolicited)
40 return m_freshUntil >= time::steady_clock::now();
46 m_freshUntil = time::steady_clock::now() + m_data->getFreshnessPeriod();
52 if (!interest.matchesData(*m_data)) {
56 if (interest.getMustBeFresh() && !this->isFresh()) {
66 bool queryIsFullName = !queryName.empty() && queryName[-1].isImplicitSha256Digest();
68 int cmp = queryIsFullName ?
69 queryName.compare(0, queryName.size() - 1, data.getName()) :
70 queryName.compare(data.getName());
76 if (queryIsFullName) {
77 return queryName[-1].compare(data.getFullName()[-1]);
87 int cmp = lhs.getName().compare(rhs.getName());
92 return lhs.getFullName()[-1].compare(rhs.getFullName()[-1]);
bool isFresh() const
Check if the stored Data is fresh now.
Entry(shared_ptr< const Data > data, bool isUnsolicited)
bool canSatisfy(const Interest &interest) const
Determine whether Interest can be satisified by the stored Data.
void updateFreshUntil()
Recalculate when the entry would become non-fresh, relative to current time.
const Data & getData() const
Return the stored Data.
static int compareQueryWithData(const Name &queryName, const Data &data)
static int compareDataWithData(const Data &lhs, const Data &rhs)
bool operator<(const Entry &entry, const Name &queryName)