37 BOOST_ASSERT(node !=
nullptr);
44 BOOST_ASSERT(this->
getParent() ==
nullptr);
45 BOOST_ASSERT(!this->
getName().empty());
50 m_parent->m_children.push_back(
this);
56 BOOST_ASSERT(this->
getParent() !=
nullptr);
58 auto i = std::find(m_parent->m_children.begin(), m_parent->m_children.end(),
this);
59 BOOST_ASSERT(i != m_parent->m_children.end());
60 m_parent->m_children.erase(i);
68 return m_fibEntry !=
nullptr ||
69 !m_pitEntries.empty() ||
70 m_measurementsEntry !=
nullptr ||
71 m_strategyChoiceEntry !=
nullptr;
77 BOOST_ASSERT(fibEntry ==
nullptr || fibEntry->m_nameTreeEntry ==
nullptr);
79 if (m_fibEntry !=
nullptr) {
80 m_fibEntry->m_nameTreeEntry =
nullptr;
82 m_fibEntry = std::move(fibEntry);
84 if (m_fibEntry !=
nullptr) {
85 m_fibEntry->m_nameTreeEntry =
this;
92 BOOST_ASSERT(pitEntry !=
nullptr);
93 BOOST_ASSERT(pitEntry->m_nameTreeEntry ==
nullptr);
95 m_pitEntries.push_back(pitEntry);
96 pitEntry->m_nameTreeEntry =
this;
102 BOOST_ASSERT(pitEntry !=
nullptr);
103 BOOST_ASSERT(pitEntry->m_nameTreeEntry ==
this);
105 auto it = std::find_if(m_pitEntries.begin(), m_pitEntries.end(),
106 [pitEntry] (
const shared_ptr<pit::Entry>& pitEntry2) {
return pitEntry2.get() == pitEntry; });
107 BOOST_ASSERT(it != m_pitEntries.end());
109 pitEntry->m_nameTreeEntry =
nullptr;
110 *it = m_pitEntries.back();
111 m_pitEntries.pop_back();
117 BOOST_ASSERT(measurementsEntry ==
nullptr || measurementsEntry->m_nameTreeEntry ==
nullptr);
119 if (m_measurementsEntry !=
nullptr) {
120 m_measurementsEntry->m_nameTreeEntry =
nullptr;
122 m_measurementsEntry = std::move(measurementsEntry);
124 if (m_measurementsEntry !=
nullptr) {
125 m_measurementsEntry->m_nameTreeEntry =
this;
132 BOOST_ASSERT(strategyChoiceEntry ==
nullptr || strategyChoiceEntry->m_nameTreeEntry ==
nullptr);
134 if (m_strategyChoiceEntry !=
nullptr) {
135 m_strategyChoiceEntry->m_nameTreeEntry =
nullptr;
137 m_strategyChoiceEntry = std::move(strategyChoiceEntry);
139 if (m_strategyChoiceEntry !=
nullptr) {
140 m_strategyChoiceEntry->m_nameTreeEntry =
this;
void insertPitEntry(shared_ptr< pit::Entry > pitEntry)
PartialName getPrefix(ssize_t nComponents) const
Extract a prefix of the name.
void erasePitEntry(pit::Entry *pitEntry)
Entry(const Name &prefix, Node *node)
void setParent(Entry &entry)
set parent of this entry
void setMeasurementsEntry(unique_ptr< measurements::Entry > measurementsEntry)
bool hasTableEntries() const
Copyright (c) 2011-2015 Regents of the University of California.
Represents an absolute name.
void unsetParent()
unset parent of this entry
Entry * getParent() const
const Name & getName() const
void setFibEntry(unique_ptr< fib::Entry > fibEntry)
void setStrategyChoiceEntry(unique_ptr< strategy_choice::Entry > strategyChoiceEntry)
an entry in the name tree
static constexpr size_t getMaxDepth()
maximum depth of the name tree