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;
93 return m_table.size();
102 return m_policy->getLimit();
110 return m_policy->setLimit(nMaxPackets);
118 return m_policy.get();
133 return m_shouldAdmit;
148 return m_shouldServe;
171 typedef boost::transform_iterator<EntryFromEntryImpl, iterator, const Entry&>
const_iterator;
205 setPolicyImpl(unique_ptr<Policy> policy);
213 unique_ptr<Policy> m_policy;
226 #endif // NFD_DAEMON_TABLE_CS_HPP #define PUBLIC_WITH_TESTS_ELSE_PRIVATE
std::set< EntryImpl > Table
size_t getLimit() const
get capacity (in number of packets)
const Entry & operator()(const EntryImpl &entry) const
bool shouldAdmit() const
get CS_ENABLE_ADMIT flag
represents an Interest packet
bool shouldServe() const
get CS_ENABLE_SERVE flag
const_iterator begin() const
const Entry & result_type
void enableAdmit(bool shouldAdmit)
set CS_ENABLE_ADMIT flag
declares ContentStore internal types
an Entry in ContentStore implementation
Table::const_iterator iterator
represents a CS replacement policy
size_t size() const
get number of stored packets
void insert(const Data &data, bool isUnsolicited=false)
inserts a Data packet
Copyright (c) 2011-2015 Regents of the University of California.
boost::transform_iterator< EntryFromEntryImpl, iterator, const Entry & > const_iterator
ContentStore iterator (public API)
void setPolicy(unique_ptr< Policy > policy)
change replacement policy
Cs(size_t nMaxPackets=10)
represents a base class for CS entry
disconnects a Connection automatically upon destruction
void setLimit(size_t nMaxPackets)
change capacity (in number of packets)
void find(const Interest &interest, const HitCallback &hitCallback, const MissCallback &missCallback) const
finds the best matching Data packet
std::function< void(const Interest &, const Data &data)> HitCallback
std::function< void(const Interest &)> MissCallback
represents the ContentStore
const_iterator end() const
Represents a Data packet.
void enableServe(bool shouldServe)
set CS_ENABLE_SERVE flag
Policy * getPolicy() const
get replacement policy