48 #ifndef NFD_DAEMON_TABLE_CS_HPP 49 #define NFD_DAEMON_TABLE_CS_HPP 54 #include <ndn-cxx/util/signal.hpp> 55 #include <boost/iterator/transform_iterator.hpp> 62 class Cs : noncopyable
66 Cs(
size_t nMaxPackets = 10);
71 insert(
const Data& data,
bool isUnsolicited =
false);
73 typedef std::function<void(const Interest&, const Data& data)>
HitCallback;
84 find(
const Interest& interest,
85 const HitCallback& hitCallback,
86 const MissCallback& missCallback)
const;
91 BOOST_ASSERT_MSG(
false,
"not implemented");
115 return m_policy.get();
123 return m_table.size();
144 typedef boost::transform_iterator<EntryFromEntryImpl, iterator, const Entry&>
const_iterator;
163 findLeftmost(
const Interest& interest,
iterator left,
iterator right)
const;
169 findRightmost(
const Interest& interest,
iterator first,
iterator last)
const;
175 findRightmostAmongExact(
const Interest& interest,
iterator first,
iterator last)
const;
178 setPolicyImpl(unique_ptr<Policy> policy);
182 unique_ptr<Policy> m_policy;
183 ndn::util::signal::ScopedConnection m_beforeEvictConnection;
192 #endif // NFD_DAEMON_TABLE_CS_HPP
const Entry & operator()(const EntryImpl &entry) const
represents a base class for CS entry
std::function< void(const Interest &, const Data &data)> HitCallback
std::set< EntryImpl > Table
declares ContentStore internal types
const_iterator end() const
const_iterator begin() const
represents the ContentStore
Table::const_iterator iterator
void erase(const Name &exactName)
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
void insert(const Data &data, bool isUnsolicited=false)
inserts a Data packet
boost::transform_iterator< EntryFromEntryImpl, iterator, const Entry & > const_iterator
ContentStore iterator (public API)
void setLimit(size_t nMaxPackets)
changes capacity (in number of packets)
void setPolicy(unique_ptr< Policy > policy)
changes cs replacement policy
std::function< void(const Interest &)> MissCallback
Policy * getPolicy() const
an Entry in ContentStore implementation
represents a CS replacement policy
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
const Entry & result_type
void find(const Interest &interest, const HitCallback &hitCallback, const MissCallback &missCallback) const
finds the best matching Data packet
Cs(size_t nMaxPackets=10)