22 #ifndef NDN_CONTENT_STORE_H
23 #define NDN_CONTENT_STORE_H
25 #include "ns3/object.h"
27 #include "ns3/traced-callback.h"
29 #include <boost/tuple/tuple.hpp>
57 class Entry :
public SimpleRefCount<Entry>
69 Entry (Ptr<ContentStore> cs, Ptr<const Data> data);
92 Ptr<ContentStore> m_cs;
93 Ptr<const Data> m_data;
132 Lookup (Ptr<const Interest> interest) = 0;
143 Add (Ptr<const Data> data) = 0;
158 Print (std::ostream &os)
const = 0;
170 virtual Ptr<cs::Entry>
176 virtual Ptr<cs::Entry>
182 virtual Ptr<cs::Entry>
183 Next (Ptr<cs::Entry>) = 0;
192 static inline Ptr<ContentStore>
196 TracedCallback<Ptr<const Interest>,
209 inline Ptr<ContentStore>
219 #endif // NDN_CONTENT_STORE_H
Base class for NDN content store.
const Name & GetName() const
Get prefix of the stored entry.
virtual Ptr< Data > Lookup(Ptr< const Interest > interest)=0
Find corresponding CS entry for the given interest.
TracedCallback< Ptr< const Interest >, Ptr< const Data > > m_cacheHitsTrace
trace of cache hits
virtual ~ContentStore()
Virtual destructor.
virtual Ptr< cs::Entry > Next(Ptr< cs::Entry >)=0
Advance the iterator.
TracedCallback< Ptr< const Interest > > m_cacheMissesTrace
trace of cache misses
virtual bool Add(Ptr< const Data > data)=0
Add a new content to the content store.
static TypeId GetTypeId()
Interface ID.
static Ptr< ContentStore > GetContentStore(Ptr< Object > node)
Static call to cheat python bindings.
virtual Ptr< cs::Entry > Begin()=0
Return first element of content store (no order guaranteed)
virtual Ptr< cs::Entry > End()=0
Return item next after last (no order guaranteed)
virtual uint32_t GetSize() const =0
Get number of entries in content store.
Ptr< const Data > GetData() const
Get Data of the stored entry.
Ptr< ContentStore > GetContentStore()
Get pointer to access store, to which this entry is added.
virtual void Print(std::ostream &os) const =0
Print out content store entries.
Entry(Ptr< ContentStore > cs, Ptr< const Data > data)
Construct content store entry.