represents the ContentStore More...
#include <cs.hpp>
Classes | |
struct | EntryFromEntryImpl |
Public Types | |
typedef std::function< void(const Interest &, const Data &data)> | HitCallback |
typedef std::function< void(const Interest &)> | MissCallback |
typedef boost::transform_iterator< EntryFromEntryImpl, iterator, const Entry & > | const_iterator |
ContentStore iterator (public API) More... | |
Public Member Functions | |
Cs (size_t nMaxPackets=10, unique_ptr< Policy > policy=makeDefaultPolicy()) | |
void | insert (const Data &data, bool isUnsolicited=false) |
inserts a Data packet More... | |
void | find (const Interest &interest, const HitCallback &hitCallback, const MissCallback &missCallback) const |
finds the best matching Data packet More... | |
void | erase (const Name &exactName) |
void | setLimit (size_t nMaxPackets) |
changes capacity (in number of packets) More... | |
size_t | getLimit () const |
void | setPolicy (unique_ptr< Policy > policy) |
changes cs replacement policy More... | |
Policy * | getPolicy () const |
size_t | size () const |
const_iterator | begin () const |
const_iterator | end () const |
typedef std::function<void(const Interest&, const Data& data)> nfd::cs::Cs::HitCallback |
typedef std::function<void(const Interest&)> nfd::cs::Cs::MissCallback |
typedef boost::transform_iterator<EntryFromEntryImpl, iterator, const Entry&> nfd::cs::Cs::const_iterator |
|
explicit |
void nfd::cs::Cs::insert | ( | const Data & | data, |
bool | isUnsolicited = false |
||
) |
inserts a Data packet
Definition at line 82 of file cs.cpp.
References ndn::SimpleTag< T, TypeId >::get(), ndn::Data::getName(), ndn::TagHost::getTag(), nfd::cs::Entry::isUnsolicited(), NFD_LOG_DEBUG, ndn::lp::NO_CACHE, nfd::cs::EntryImpl::unsetUnsolicited(), and nfd::cs::Entry::updateStaleTime().
Referenced by nfd::Forwarder::startProcessNack().
void nfd::cs::Cs::find | ( | const Interest & | interest, |
const HitCallback & | hitCallback, | ||
const MissCallback & | missCallback | ||
) | const |
finds the best matching Data packet
interest | the Interest for lookup |
hitCallback | a callback if a match is found; must not be empty |
missCallback | a callback if there's no match; must not be empty |
Definition at line 122 of file cs.cpp.
References nfd::cs::Entry::canSatisfy(), nfd::find_last_if(), ndn::Interest::getChildSelector(), ndn::Interest::getName(), ndn::Name::getPrefix(), ndn::Name::getSuccessor(), NFD_LOG_DEBUG, NFD_LOG_TRACE, and ndn::Name::size().
Referenced by nfd::Forwarder::startProcessNack().
|
inline |
Definition at line 92 of file cs.hpp.
References getLimit(), setLimit(), and setPolicy().
void nfd::cs::Cs::setLimit | ( | size_t | nMaxPackets | ) |
changes capacity (in number of packets)
Definition at line 60 of file cs.cpp.
Referenced by nfd::TablesConfigSection::ensureTablesAreConfigured(), and erase().
size_t nfd::cs::Cs::getLimit | ( | ) | const |
void nfd::cs::Cs::setPolicy | ( | unique_ptr< Policy > | policy | ) |
|
inline |
|
inline |
Definition at line 124 of file cs.hpp.
References PUBLIC_WITH_TESTS_ELSE_PRIVATE.
Referenced by nfd::ForwarderStatusManager::ForwarderStatusManager().
|
inline |
|
inline |