model: Adding "new" content store with ability to track lifetime of entries
Available options for ndnStackHelper.SetContentStore:
- ns3::ndn::cs::Stats::Lru
- ns3::ndn::cs::Stats::Random
- ns3::ndn::cs::Stats::Fifo
Tracked events include 0-lifetime entries, i.e., when entries are not stored at all.
Config::ConnectWithoutContext ("/NodeList/1/$ns3::ndn::cs::Stats::Random/WillRemoveEntry", MakeCallback (CacheEntryRemoved));
Prototype for the callback is: void (*)(Ptr<const ndn::cs::Entry> entry, Time lifetime)
diff --git a/model/cs/content-store-impl.h b/model/cs/content-store-impl.h
index a168636..6ebd865 100644
--- a/model/cs/content-store-impl.h
+++ b/model/cs/content-store-impl.h
@@ -41,6 +41,9 @@
class EntryImpl : public Entry
{
public:
+ typedef Entry base_type;
+
+public:
EntryImpl (Ptr<const ContentObjectHeader> header, Ptr<const Packet> packet)
: Entry (header, packet)
, item_ (0)
@@ -65,12 +68,12 @@
template<class Policy>
class ContentStoreImpl : public ContentStore,
protected ndnSIM::trie_with_policy< NameComponents,
- ndnSIM::smart_pointer_payload_traits< EntryImpl< ContentStoreImpl< Policy > > >,
+ ndnSIM::smart_pointer_payload_traits< EntryImpl< ContentStoreImpl< Policy > >, Entry >,
Policy >
{
public:
typedef ndnSIM::trie_with_policy< NameComponents,
- ndnSIM::smart_pointer_payload_traits< EntryImpl< ContentStoreImpl< Policy > > >,
+ ndnSIM::smart_pointer_payload_traits< EntryImpl< ContentStoreImpl< Policy > >, Entry >,
Policy > super;
typedef EntryImpl< ContentStoreImpl< Policy > > entry;