nfd::name_tree Namespace Reference

Classes

struct  AnyEntry
 an EntrySelector that accepts every Entry More...
 
struct  AnyEntrySubTree
 an EntrySubTreeSelector that accepts every Entry and its children More...
 
class  Entry
 An entry in the name tree. More...
 
class  EnumerationImpl
 enumeration operation implementation More...
 
class  FullEnumerationImpl
 full enumeration implementation More...
 
class  GetTableEntry
 a functor to get a table entry from a name tree entry More...
 
class  Hashtable
 a hashtable for fast exact name lookup More...
 
class  HashtableOptions
 provides options for Hashtable More...
 
class  Iterator
 NameTree iterator. More...
 
class  NameTree
 A common index structure for FIB, PIT, StrategyChoice, and Measurements. More...
 
class  Node
 a hashtable node More...
 
class  PartialEnumerationImpl
 partial enumeration implementation More...
 
class  PrefixMatchImpl
 partial enumeration implementation More...
 

Typedefs

using EntrySelector = std::function< bool(const Entry &)>
 a predicate to accept or reject an Entry in find operations More...
 
using EntrySubTreeSelector = std::function< std::pair< bool, bool >(const Entry &)>
 a predicate to accept or reject an Entry and its children More...
 
using HashFunc = std::conditional<(sizeof(HashValue) > 4), Hash64, Hash32 >::type
 a type with compute static method to compute hash value from a raw buffer More...
 
using HashSequence = std::vector< HashValue >
 a sequence of hash values More...
 
using HashValue = size_t
 a single hash value More...
 
using Range = boost::iterator_range< Iterator >
 a Forward Range of name tree entries More...
 

Functions

HashValue computeHash (const Name &name, size_t prefixLen=std::numeric_limits< size_t >::max())
 computes hash value of name.getPrefix(prefixLen) More...
 
HashSequence computeHashes (const Name &name, size_t prefixLen=std::numeric_limits< size_t >::max())
 computes hash values for each prefix of name.getPrefix(prefixLen) More...
 
template<typename N , typename F >
void foreachNode (N *head, const F &func)
 invoke a function for each node in a doubly linked list More...
 
NodegetNode (const Entry &entry)
 
 NDN_CXX_ASSERT_FORWARD_ITERATOR (Iterator)
 
std::ostream & operator<< (std::ostream &os, const Iterator &i)
 

Typedef Documentation

◆ EntrySelector

using nfd::name_tree::EntrySelector = typedef std::function<bool(const Entry&)>

a predicate to accept or reject an Entry in find operations

Definition at line 38 of file name-tree-iterator.hpp.

◆ EntrySubTreeSelector

using nfd::name_tree::EntrySubTreeSelector = typedef std::function<std::pair<bool, bool>(const Entry&)>

a predicate to accept or reject an Entry and its children

Returns
.first indicates whether entry should be accepted; .second indicates whether entry's children should be visited

Definition at line 55 of file name-tree-iterator.hpp.

◆ HashFunc

using nfd::name_tree::HashFunc = typedef std::conditional<(sizeof(HashValue) > 4), Hash64, Hash32>::type

a type with compute static method to compute hash value from a raw buffer

Definition at line 57 of file name-tree-hashtable.cpp.

◆ HashSequence

using nfd::name_tree::HashSequence = typedef std::vector<HashValue>

a sequence of hash values

See also
computeHashes

Definition at line 43 of file name-tree-hashtable.hpp.

◆ HashValue

using nfd::name_tree::HashValue = typedef size_t

a single hash value

Definition at line 38 of file name-tree-hashtable.hpp.

◆ Range

using nfd::name_tree::Range = typedef boost::iterator_range<Iterator>

a Forward Range of name tree entries

This type has .begin() and .end() methods which return Iterator. This type is usable with range-based for.

Definition at line 212 of file name-tree-iterator.hpp.

Function Documentation

◆ computeHash()

HashValue nfd::name_tree::computeHash ( const Name &  name,
size_t  prefixLen 
)

computes hash value of name.getPrefix(prefixLen)

Definition at line 60 of file name-tree-hashtable.cpp.

◆ computeHashes()

HashSequence nfd::name_tree::computeHashes ( const Name &  name,
size_t  prefixLen = std::numeric_limits< size_t >::max() 
)

computes hash values for each prefix of name.getPrefix(prefixLen)

Returns
a hash sequence, where the i-th hash value equals computeHash(name, i)

Definition at line 73 of file name-tree-hashtable.cpp.

◆ foreachNode()

template<typename N , typename F >
void nfd::name_tree::foreachNode ( N *  head,
const F &  func 
)

invoke a function for each node in a doubly linked list

Template Parameters
Neither Node or const Node
Fa functor with signature void F(N*)
Note
It's safe to delete the node in the function.

Definition at line 94 of file name-tree-hashtable.hpp.

◆ getNode()

Node * nfd::name_tree::getNode ( const Entry entry)
Returns
node associated with entry
Note
This function is for NameTree internal use.

Definition at line 107 of file name-tree-hashtable.cpp.

◆ NDN_CXX_ASSERT_FORWARD_ITERATOR()

nfd::name_tree::NDN_CXX_ASSERT_FORWARD_ITERATOR ( Iterator  )

◆ operator<<()

std::ostream & nfd::name_tree::operator<< ( std::ostream &  os,
const Iterator i 
)

Definition at line 82 of file name-tree-iterator.cpp.