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::ndnSIM::trie< FullKey, PayloadTraits, PolicyHook > Class Template Reference
Inheritance diagram for ns3::ndn::ndnSIM::trie< FullKey, PayloadTraits, PolicyHook >:
Collaboration diagram for ns3::ndn::ndnSIM::trie< FullKey, PayloadTraits, PolicyHook >:

Public Types

typedef FullKey::partial_type Key
 
typedef trieiterator
 
typedef const trieconst_iterator
 
typedef trie_iterator< trie, trierecursive_iterator
 
typedef trie_iterator< const
trie, trie
const_recursive_iterator
 
typedef trie_point_iterator< triepoint_iterator
 
typedef trie_point_iterator
< const trie
const_point_iterator
 
typedef PayloadTraits payload_traits
 

Public Member Functions

 trie (const Key &key, size_t bucketSize=1, size_t bucketIncrement=1)
 
void clear ()
 
template<class Predicate >
void clear_if (Predicate cond)
 
std::pair< iterator, bool > insert (const FullKey &key, typename PayloadTraits::insert_type payload)
 
iterator erase ()
 Removes payload (if it exists) and if there are no children, prunes parents trie.
 
iterator prune ()
 Do exactly as erase, but without erasing the payload.
 
void prune_node ()
 Perform prune of the node, but without attempting to parent of the node.
 
boost::tuple< iterator, bool,
iterator
find (const FullKey &key)
 Perform the longest prefix match. More...
 
template<class Predicate >
boost::tuple< iterator, bool,
iterator
find_if (const FullKey &key, Predicate pred)
 Perform the longest prefix match satisfying preficate. More...
 
iterator find ()
 Find next payload of the sub-trie. More...
 
template<class Predicate >
const iterator find_if (Predicate pred)
 Find next payload of the sub-trie satisfying the predicate. More...
 
template<class Predicate >
const iterator find_if_next_level (Predicate pred)
 Find next payload of the sub-trie satisfying the predicate. More...
 
iterator end ()
 
const_iterator end () const
 
PayloadTraits::const_return_type payload () const
 
PayloadTraits::return_type payload ()
 
void set_payload (typename PayloadTraits::insert_type payload)
 
Key key () const
 
void PrintStat (std::ostream &os) const
 

Public Attributes

PolicyHook policy_hook_
 

Friends

template<class T , class NonConstT >
class trie_iterator
 
template<class T >
class trie_point_iterator
 
bool operator== (const trie< FullKey, PayloadTraits, PolicyHook > &a, const trie< FullKey, PayloadTraits, PolicyHook > &b)
 
std::size_t hash_value (const trie< FullKey, PayloadTraits, PolicyHook > &trie_node)
 
std::ostream & operator (std::ostream &os, const trie &trie_node)
 

Detailed Description

template<typename FullKey, typename PayloadTraits, typename PolicyHook>
class ns3::ndn::ndnSIM::trie< FullKey, PayloadTraits, PolicyHook >

Definition at line 109 of file trie.h.

Member Function Documentation

template<typename FullKey, typename PayloadTraits, typename PolicyHook>
boost::tuple<iterator, bool, iterator> ns3::ndn::ndnSIM::trie< FullKey, PayloadTraits, PolicyHook >::find ( const FullKey &  key)
inline

Perform the longest prefix match.

Parameters
keythe key for which to perform the longest prefix match
Returns
->second is true if prefix in ->first is longer than key

Definition at line 305 of file trie.h.

Referenced by ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl< PitImpl< random_policy_traits > > >, random_policy_traits >::deepest_prefix_match(), ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl< PitImpl< random_policy_traits > > >, random_policy_traits >::deepest_prefix_match_if(), ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl< PitImpl< random_policy_traits > > >, random_policy_traits >::deepest_prefix_match_if_next_level(), ns3::ndn::ndnSIM::trie< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl< PitImpl< lru_policy_traits > > >, typename lru_policy_traits::policy_hook_type >::find(), ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl< PitImpl< random_policy_traits > > >, random_policy_traits >::find_exact(), ns3::ndn::ndnSIM::trie< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl< PitImpl< lru_policy_traits > > >, typename lru_policy_traits::policy_hook_type >::find_if_next_level(), ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl< PitImpl< random_policy_traits > > >, random_policy_traits >::longest_prefix_match(), and ns3::ndn::pit::PitImpl< Policy >::Lookup().

template<typename FullKey, typename PayloadTraits, typename PolicyHook>
iterator ns3::ndn::ndnSIM::trie< FullKey, PayloadTraits, PolicyHook >::find ( )
inline

Find next payload of the sub-trie.

Returns
end() or a valid iterator pointing to the trie leaf (order is not defined, enumeration )

Definition at line 373 of file trie.h.

template<typename FullKey, typename PayloadTraits, typename PolicyHook>
template<class Predicate >
boost::tuple<iterator, bool, iterator> ns3::ndn::ndnSIM::trie< FullKey, PayloadTraits, PolicyHook >::find_if ( const FullKey &  key,
Predicate  pred 
)
inline
template<typename FullKey, typename PayloadTraits, typename PolicyHook>
template<class Predicate >
const iterator ns3::ndn::ndnSIM::trie< FullKey, PayloadTraits, PolicyHook >::find_if ( Predicate  pred)
inline

Find next payload of the sub-trie satisfying the predicate.

Parameters
predpredicate
Returns
end() or a valid iterator pointing to the trie leaf (order is not defined, enumeration )

Definition at line 399 of file trie.h.

template<typename FullKey, typename PayloadTraits, typename PolicyHook>
template<class Predicate >
const iterator ns3::ndn::ndnSIM::trie< FullKey, PayloadTraits, PolicyHook >::find_if_next_level ( Predicate  pred)
inline

Find next payload of the sub-trie satisfying the predicate.

Parameters
predpredicate

This version check predicate only for the next level children

Returns
end() or a valid iterator pointing to the trie leaf (order is not defined, enumeration )

Definition at line 428 of file trie.h.

Referenced by ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl< PitImpl< random_policy_traits > > >, random_policy_traits >::deepest_prefix_match_if_next_level().


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