NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ns3::ndn::cs::ContentStoreImpl< Policy > Class Template Reference

Base implementation of NDN content store. More...

#include <content-store-impl.h>

Inheritance diagram for ns3::ndn::cs::ContentStoreImpl< Policy >:
Collaboration diagram for ns3::ndn::cs::ContentStoreImpl< Policy >:

Public Types

typedef
ndnSIM::trie_with_policy< Name,
ndnSIM::smart_pointer_payload_traits
< EntryImpl< ContentStoreImpl
< Policy > >, Entry >, Policy > 
super
 
typedef EntryImpl
< ContentStoreImpl< Policy > > 
entry
 

Public Member Functions

virtual Ptr< DataLookup (Ptr< const Interest > interest)
 Find corresponding CS entry for the given interest. More...
 
virtual bool Add (Ptr< const Data > data)
 Add a new content to the content store. More...
 
virtual void Print (std::ostream &os) const
 Print out content store entries.
 
virtual uint32_t GetSize () const
 Get number of entries in content store.
 
virtual Ptr< EntryBegin ()
 Return first element of content store (no order guaranteed)
 
virtual Ptr< EntryEnd ()
 Return item next after last (no order guaranteed)
 
virtual Ptr< EntryNext (Ptr< Entry >)
 
const super::policy_container & GetPolicy () const
 
super::policy_container & GetPolicy ()
 
- Public Member Functions inherited from ns3::ndn::ContentStore
virtual ~ContentStore ()
 Virtual destructor.
 
virtual Ptr< cs::EntryNext (Ptr< cs::Entry >)=0
 Advance the iterator.
 

Static Public Member Functions

static TypeId GetTypeId ()
 
- Static Public Member Functions inherited from ns3::ndn::ContentStore
static TypeId GetTypeId ()
 Interface ID. More...
 
static Ptr< ContentStoreGetContentStore (Ptr< Object > node)
 Static call to cheat python bindings.
 

Additional Inherited Members

- Protected Types inherited from ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl< ContentStoreImpl< Policy > >, Entry >, Policy >
typedef trie< Name,
ndnSIM::smart_pointer_payload_traits
< EntryImpl< ContentStoreImpl
< Policy > >, Entry >
, typename
Policy::policy_hook_type > 
parent_trie
 
typedef parent_trie::iterator iterator
 
typedef parent_trie::const_iterator const_iterator
 
typedef Policy::template
policy< trie_with_policy< Name,
ndnSIM::smart_pointer_payload_traits
< EntryImpl< ContentStoreImpl
< Policy > >, Entry >, Policy >
, parent_trie, typename
Policy::template
container_hook< parent_trie >
::type >::type 
policy_container
 
- Protected Member Functions inherited from ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl< ContentStoreImpl< Policy > >, Entry >, Policy >
 trie_with_policy (size_t bucketSize=1, size_t bucketIncrement=1)
 
std::pair< iterator, bool > insert (const Name &key, typename ndnSIM::smart_pointer_payload_traits< EntryImpl< ContentStoreImpl< Policy > >, Entry >::insert_type payload)
 
void erase (const Name &key)
 
void erase (iterator node)
 
void clear ()
 
bool modify (iterator position, Modifier mod)
 
iterator find_exact (const Name &key)
 Find a node that has the exact match with the key.
 
iterator longest_prefix_match (const Name &key)
 Find a node that has the longest common prefix with key (FIB/PIT lookup)
 
iterator longest_prefix_match_if (const Name &key, Predicate pred)
 Find a node that has the longest common prefix with key (FIB/PIT lookup)
 
iterator deepest_prefix_match (const Name &key)
 Const version of the longest common prefix match (semi-const, because there could be update of the policy anyways) More...
 
iterator deepest_prefix_match_if (const Name &key, Predicate pred)
 Find a node that has prefix at least as the key.
 
iterator deepest_prefix_match_if_next_level (const Name &key, Predicate pred)
 Find a node that has prefix at least as the key. More...
 
iterator end () const
 
const parent_triegetTrie () const
 
parent_triegetTrie ()
 
const policy_container & getPolicy () const
 
policy_container & getPolicy ()
 
- Static Protected Member Functions inherited from ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl< ContentStoreImpl< Policy > >, Entry >, Policy >
static iterator s_iterator_to (typename parent_trie::iterator item)
 
- Protected Attributes inherited from ns3::ndn::ContentStore
TracedCallback< Ptr< const
Interest >, Ptr< const Data > > 
m_cacheHitsTrace
 trace of cache hits
 
TracedCallback< Ptr< const
Interest > > 
m_cacheMissesTrace
 trace of cache misses
 

Detailed Description

template<class Policy>
class ns3::ndn::cs::ContentStoreImpl< Policy >

Base implementation of NDN content store.

Definition at line 77 of file content-store-impl.h.

Member Function Documentation

template<class Policy >
bool ns3::ndn::cs::ContentStoreImpl< Policy >::Add ( Ptr< const Data data)
inlinevirtual

Add a new content to the content store.

Parameters
headerFully parsed Data
packetFully formed Ndn packet to add to content store (will be copied and stripped down of headers)
Returns
true if an existing entry was updated, false otherwise

Implements ns3::ndn::ContentStore.

Reimplemented in ns3::ndn::cs::ContentStoreWithFreshness< Policy >, ns3::ndn::cs::ContentStoreWithFreshness< fifo_policy_traits >, ns3::ndn::cs::ContentStoreWithFreshness< lfu_policy_traits >, ns3::ndn::cs::ContentStoreWithFreshness< random_policy_traits >, and ns3::ndn::cs::ContentStoreWithFreshness< lru_policy_traits >.

Definition at line 224 of file content-store-impl.h.

template<class Policy >
Ptr< Data > ns3::ndn::cs::ContentStoreImpl< Policy >::Lookup ( Ptr< const Interest interest)
inlinevirtual

Find corresponding CS entry for the given interest.

Parameters
interestInterest for which matching content store entry will be searched

If an entry is found, it is promoted to the top of most recent used entries index,

See also
m_contentStore

Implements ns3::ndn::ContentStore.

Definition at line 192 of file content-store-impl.h.


The documentation for this class was generated from the following file: