|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
26 #ifndef NFD_DAEMON_TABLE_CS_POLICY_HPP
27 #define NFD_DAEMON_TABLE_CS_POLICY_HPP
45 Registry& registry = getRegistry();
46 BOOST_ASSERT(registry.count(policyName) == 0);
47 registry[policyName] = [] {
return make_unique<P>(); };
53 static unique_ptr<Policy>
54 create(
const std::string& policyName);
58 static std::set<std::string>
63 Policy(
const std::string& policyName);
196 using CreateFunc = std::function<unique_ptr<Policy>()>;
197 using Registry = std::map<std::string, CreateFunc>;
203 std::string m_policyName;
214 #define NFD_REGISTER_CS_POLICY(P) \
215 static class NfdAuto ## P ## CsPolicyRegistrationClass \
218 NfdAuto ## P ## CsPolicyRegistrationClass() \
220 ::nfd::cs::Policy::registerPolicy<P>(); \
222 } g_nfdAuto ## P ## CsPolicyRegistrationVariable
224 #endif // NFD_DAEMON_TABLE_CS_POLICY_HPP
static void registerPolicy(const std::string &policyName=P::POLICY_NAME)
void beforeUse(EntryRef i)
invoked by CS before an entry is used to match a lookup
represents a CS replacement policy
implements the Content Store
void setLimit(size_t nMaxEntries)
sets hard limit (in number of entries)
Table::const_iterator EntryRef
a reference to an CS entry
virtual ~Policy()=default
provides a lightweight signal / event system
Copyright (c) 2011-2015 Regents of the University of California.
void afterRefresh(EntryRef i)
invoked by CS after an existing entry is refreshed by same Data
signal::Signal< Policy, EntryRef > beforeEvict
emits when an entry is being evicted
virtual void doBeforeErase(EntryRef i)=0
invoked before an entry is erased due to management command
virtual void doAfterRefresh(EntryRef i)=0
invoked after an existing entry is refreshed by same Data
virtual void evictEntries()=0
evicts zero or more entries
void beforeErase(EntryRef i)
invoked by CS before an entry is erased due to management command
Policy(const std::string &policyName)
static unique_ptr< Policy > create(const std::string &policyName)
void afterInsert(EntryRef i)
invoked by CS after a new entry is inserted
Cs * getCs() const
gets cs
#define DECLARE_SIGNAL_EMIT(signalName)
(implementation detail) declares a 'emit_signalName' method
virtual void doAfterInsert(EntryRef i)=0
invoked after a new entry is created in CS
const std::string & getName() const
size_t getLimit() const
gets hard limit (in number of entries)
static std::set< std::string > getPolicyNames()
void setCs(Cs *cs)
sets cs
virtual void doBeforeUse(EntryRef i)=0
invoked before an entry is used to match a lookup