20 #ifndef NDN_CONTENT_STORE_H 21 #define NDN_CONTENT_STORE_H 23 #include "ns3/ndnSIM/model/ndn-common.hpp" 25 #include "ns3/object.h" 27 #include "ns3/traced-callback.h" 54 class Entry :
public SimpleRefCount<Entry> {
65 Entry(Ptr<ContentStore> cs, shared_ptr<const Data> data);
78 shared_ptr<const Data>
88 Ptr<ContentStore> m_cs;
89 shared_ptr<const Data> m_data;
123 virtual shared_ptr<Data>
124 Lookup(shared_ptr<const Interest> interest) = 0;
131 Add(shared_ptr<const Data> data) = 0;
146 Print(std::ostream& os)
const = 0;
157 virtual Ptr<cs::Entry>
163 virtual Ptr<cs::Entry>
169 virtual Ptr<cs::Entry> Next(Ptr<cs::Entry>) = 0;
178 static inline Ptr<ContentStore>
182 typedef void (*CacheHitsCallback)(shared_ptr<const Interest>, shared_ptr<const Data>);
183 typedef void (*CacheMissesCallback)(shared_ptr<const Interest>);
186 TracedCallback<shared_ptr<const Interest>,
199 inline Ptr<ContentStore>
208 #include <boost/functional/hash.hpp> 213 return boost::hash_range(component.wireEncode().wire(),
214 component.wireEncode().wire() + component.wireEncode().size());
218 #endif // NDN_CONTENT_STORE_H Copyright (c) 2011-2015 Regents of the University of California.
std::size_t hash_value(const ::ndn::name::Component component)
Copyright (c) 2013-2017 Regents of the University of California.
std::ostream & operator<<(std::ostream &os, const ContentStore &cs)
Entry(Ptr< ContentStore > cs, shared_ptr< const Data > data)
Construct content store entry.
TracedCallback< shared_ptr< const Interest > > m_cacheMissesTrace
trace of cache misses
static Ptr< ContentStore > GetContentStore(Ptr< Object > node)
Static call to cheat python bindings.
virtual void Print(std::ostream &os) const =0
Print out content store entries.
Copyright (c) 2011-2015 Regents of the University of California.
TracedCallback< shared_ptr< const Interest >, shared_ptr< const Data > > m_cacheHitsTrace
trace of cache hits
shared_ptr< const Data > GetData() const
Get Data of the stored entry.
ndn cs ContentStore
Copyright (c) 2011-2015 Regents of the University of California.
Ptr< ContentStore > GetContentStore()
Get pointer to access store, to which this entry is added.
const Name & GetName() const
Get prefix of the stored entry.
Base class for NDN content store.