32 : m_data(
std::move(data))
33 , m_isUnsolicited(isUnsolicited)
41 return m_freshUntil >= time::steady_clock::now();
47 m_freshUntil = time::steady_clock::now() + m_data->getFreshnessPeriod();
53 if (!interest.matchesData(*m_data)) {
57 if (interest.getMustBeFresh() && !this->
isFresh()) {
67 bool queryIsFullName = !queryName.empty() && queryName[-1].isImplicitSha256Digest();
69 int cmp = queryIsFullName ?
70 queryName.compare(0, queryName.size() - 1, data.getName()) :
71 queryName.compare(data.getName());
77 if (queryIsFullName) {
78 return queryName[-1].compare(data.getFullName()[-1]);
88 int cmp = lhs.getName().compare(rhs.getName());
93 return lhs.getFullName()[-1].compare(rhs.getFullName()[-1]);
bool operator<(const Entry &entry, const Name &queryName)
Entry(shared_ptr< const Data > data, bool isUnsolicited)
const Data & getData() const
return the stored Data
void updateFreshUntil()
recalculate when the entry would become non-fresh, relative to current time
static int compareQueryWithData(const Name &queryName, const Data &data)
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
bool isFresh() const
check if the stored Data is fresh now
bool canSatisfy(const Interest &interest) const
determine whether Interest can be satisified by the stored Data
static int compareDataWithData(const Data &lhs, const Data &rhs)