nfd::name_tree::Entry Class Reference

An entry in the name tree. More...

#include <daemon/table/name-tree-entry.hpp>

+ Inheritance diagram for nfd::name_tree::Entry:
+ Collaboration diagram for nfd::name_tree::Entry:

Public Member Functions

 Entry (const Name &prefix, Node *node)
 
void erasePitEntry (pit::Entry *pitEntry)
 
const std::vector< Entry * > & getChildren () const noexcept
 Returns the children of this entry. More...
 
fib::EntrygetFibEntry () const
 
measurements::EntrygetMeasurementsEntry () const
 
const Name & getName () const noexcept
 
EntrygetParent () const noexcept
 
const std::vector< shared_ptr< pit::Entry > > & getPitEntries () const
 
strategy_choice::EntrygetStrategyChoiceEntry () const
 
bool hasChildren () const
 Check whether this entry has any children. More...
 
bool hasPitEntries () const
 
bool hasTableEntries () const
 
void insertPitEntry (shared_ptr< pit::Entry > pitEntry)
 
bool isEmpty () const
 
void setFibEntry (unique_ptr< fib::Entry > fibEntry)
 
void setMeasurementsEntry (unique_ptr< measurements::Entry > measurementsEntry)
 
void setParent (Entry &entry)
 Set parent of this entry. More...
 
void setStrategyChoiceEntry (unique_ptr< strategy_choice::Entry > strategyChoiceEntry)
 
void unsetParent ()
 Unset parent of this entry. More...
 

Static Public Member Functions

template<typename ENTRY >
static Entryget (const ENTRY &tableEntry)
 

Friends

NodegetNode (const Entry &entry)
 

Detailed Description

An entry in the name tree.

Definition at line 41 of file name-tree-entry.hpp.

Constructor & Destructor Documentation

◆ Entry()

nfd::name_tree::Entry::Entry ( const Name &  prefix,
Node node 
)

Definition at line 31 of file name-tree-entry.cpp.

Member Function Documentation

◆ erasePitEntry()

void nfd::name_tree::Entry::erasePitEntry ( pit::Entry pitEntry)

Definition at line 97 of file name-tree-entry.cpp.

◆ get()

template<typename ENTRY >
static Entry* nfd::name_tree::Entry::get ( const ENTRY &  tableEntry)
inlinestatic
Returns
name tree entry on which a table entry is attached, or nullptr if the table entry is detached
Note
This function is for NameTree internal use. Other components should use NameTree::getEntry(tableEntry) instead.

Definition at line 163 of file name-tree-entry.hpp.

◆ getChildren()

const std::vector<Entry*>& nfd::name_tree::Entry::getChildren ( ) const
inlinenoexcept

Returns the children of this entry.

Definition at line 90 of file name-tree-entry.hpp.

◆ getFibEntry()

fib::Entry* nfd::name_tree::Entry::getFibEntry ( ) const
inline

Definition at line 112 of file name-tree-entry.hpp.

◆ getMeasurementsEntry()

measurements::Entry* nfd::name_tree::Entry::getMeasurementsEntry ( ) const
inline

Definition at line 139 of file name-tree-entry.hpp.

◆ getName()

const Name& nfd::name_tree::Entry::getName ( ) const
inlinenoexcept

Definition at line 47 of file name-tree-entry.hpp.

◆ getParent()

Entry* nfd::name_tree::Entry::getParent ( ) const
inlinenoexcept
Returns
entry of getName().getPrefix(-1)
Return values
nullptrthis entry is the root entry, i.e. getName() == Name()

Definition at line 56 of file name-tree-entry.hpp.

◆ getPitEntries()

const std::vector<shared_ptr<pit::Entry> >& nfd::name_tree::Entry::getPitEntries ( ) const
inline

Definition at line 127 of file name-tree-entry.hpp.

◆ getStrategyChoiceEntry()

strategy_choice::Entry* nfd::name_tree::Entry::getStrategyChoiceEntry ( ) const
inline

Definition at line 148 of file name-tree-entry.hpp.

◆ hasChildren()

bool nfd::name_tree::Entry::hasChildren ( ) const
inline

Check whether this entry has any children.

Definition at line 81 of file name-tree-entry.hpp.

◆ hasPitEntries()

bool nfd::name_tree::Entry::hasPitEntries ( ) const
inline

Definition at line 121 of file name-tree-entry.hpp.

◆ hasTableEntries()

bool nfd::name_tree::Entry::hasTableEntries ( ) const
Return values
trueat least one table entries is attached
falseno table entry is attached

Definition at line 63 of file name-tree-entry.cpp.

◆ insertPitEntry()

void nfd::name_tree::Entry::insertPitEntry ( shared_ptr< pit::Entry pitEntry)

Definition at line 87 of file name-tree-entry.cpp.

◆ isEmpty()

bool nfd::name_tree::Entry::isEmpty ( ) const
inline
Return values
truethis entry has no children and no table entries
falsethis entry has child or attached table entry

Definition at line 99 of file name-tree-entry.hpp.

◆ setFibEntry()

void nfd::name_tree::Entry::setFibEntry ( unique_ptr< fib::Entry fibEntry)

Definition at line 72 of file name-tree-entry.cpp.

◆ setMeasurementsEntry()

void nfd::name_tree::Entry::setMeasurementsEntry ( unique_ptr< measurements::Entry measurementsEntry)

Definition at line 112 of file name-tree-entry.cpp.

◆ setParent()

void nfd::name_tree::Entry::setParent ( Entry entry)

Set parent of this entry.

Parameters
entryentry of getName().getPrefix(-1)
Precondition
getParent() == nullptr
Postcondition
getParent() == &entry
entry.getChildren() contains this

Definition at line 40 of file name-tree-entry.cpp.

◆ setStrategyChoiceEntry()

void nfd::name_tree::Entry::setStrategyChoiceEntry ( unique_ptr< strategy_choice::Entry strategyChoiceEntry)

Definition at line 127 of file name-tree-entry.cpp.

◆ unsetParent()

void nfd::name_tree::Entry::unsetParent ( )

Unset parent of this entry.

Postcondition
getParent() == nullptr
parent.getChildren() does not contain this

Definition at line 51 of file name-tree-entry.cpp.

Friends And Related Function Documentation

◆ getNode

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

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