35 BOOST_ASSERT(node !=
nullptr);
42 BOOST_ASSERT(this->
getParent() ==
nullptr);
43 BOOST_ASSERT(!this->
getName().empty());
44 BOOST_ASSERT(entry.
getName() == this->getName().getPrefix(-1));
47 m_parent->m_children.push_back(
this);
53 BOOST_ASSERT(this->
getParent() !=
nullptr);
55 auto i = std::find(m_parent->m_children.begin(), m_parent->m_children.end(),
this);
56 BOOST_ASSERT(i != m_parent->m_children.end());
57 m_parent->m_children.erase(i);
65 return m_fibEntry !=
nullptr ||
66 !m_pitEntries.empty() ||
67 m_measurementsEntry !=
nullptr ||
68 m_strategyChoiceEntry !=
nullptr;
74 BOOST_ASSERT(fibEntry ==
nullptr || fibEntry->m_nameTreeEntry ==
nullptr);
76 if (m_fibEntry !=
nullptr) {
77 m_fibEntry->m_nameTreeEntry =
nullptr;
79 m_fibEntry = std::move(fibEntry);
81 if (m_fibEntry !=
nullptr) {
82 m_fibEntry->m_nameTreeEntry =
this;
89 BOOST_ASSERT(pitEntry !=
nullptr);
90 BOOST_ASSERT(pitEntry->m_nameTreeEntry ==
nullptr);
92 m_pitEntries.push_back(pitEntry);
93 pitEntry->m_nameTreeEntry =
this;
99 BOOST_ASSERT(pitEntry !=
nullptr);
100 BOOST_ASSERT(pitEntry->m_nameTreeEntry ==
this);
102 auto it = std::find_if(m_pitEntries.begin(), m_pitEntries.end(),
103 [pitEntry] (
const auto& pitEntry2) { return pitEntry2.get() == pitEntry; });
104 BOOST_ASSERT(it != m_pitEntries.end());
106 pitEntry->m_nameTreeEntry =
nullptr;
107 *it = m_pitEntries.back();
108 m_pitEntries.pop_back();
114 BOOST_ASSERT(measurementsEntry ==
nullptr || measurementsEntry->m_nameTreeEntry ==
nullptr);
116 if (m_measurementsEntry !=
nullptr) {
117 m_measurementsEntry->m_nameTreeEntry =
nullptr;
119 m_measurementsEntry = std::move(measurementsEntry);
121 if (m_measurementsEntry !=
nullptr) {
122 m_measurementsEntry->m_nameTreeEntry =
this;
129 BOOST_ASSERT(strategyChoiceEntry ==
nullptr || strategyChoiceEntry->m_nameTreeEntry ==
nullptr);
131 if (m_strategyChoiceEntry !=
nullptr) {
132 m_strategyChoiceEntry->m_nameTreeEntry =
nullptr;
134 m_strategyChoiceEntry = std::move(strategyChoiceEntry);
136 if (m_strategyChoiceEntry !=
nullptr) {
137 m_strategyChoiceEntry->m_nameTreeEntry =
this;
An entry in the name tree.
void unsetParent()
Unset parent of this entry.
Entry(const Name &prefix, Node *node)
void insertPitEntry(shared_ptr< pit::Entry > pitEntry)
void setMeasurementsEntry(unique_ptr< measurements::Entry > measurementsEntry)
void erasePitEntry(pit::Entry *pitEntry)
void setParent(Entry &entry)
Set parent of this entry.
Entry * getParent() const noexcept
void setStrategyChoiceEntry(unique_ptr< strategy_choice::Entry > strategyChoiceEntry)
void setFibEntry(unique_ptr< fib::Entry > fibEntry)
const Name & getName() const noexcept
bool hasTableEntries() const
static constexpr size_t getMaxDepth()
Maximum depth of the name tree.
Represents an entry in the Interest table (PIT).