36 BOOST_ASSERT(node !=
nullptr);
42 BOOST_ASSERT(this->
getParent() ==
nullptr);
43 BOOST_ASSERT(!this->
getName().empty());
48 m_parent->m_children.push_back(
this);
54 BOOST_ASSERT(this->
getParent() !=
nullptr);
56 auto i = std::find(m_parent->m_children.begin(), m_parent->m_children.end(),
this);
57 BOOST_ASSERT(i != m_parent->m_children.end());
58 m_parent->m_children.erase(i);
66 return m_fibEntry !=
nullptr ||
67 !m_pitEntries.empty() ||
68 m_measurementsEntry !=
nullptr ||
69 m_strategyChoiceEntry !=
nullptr;
75 BOOST_ASSERT(fibEntry ==
nullptr || fibEntry->m_nameTreeEntry ==
nullptr);
77 if (m_fibEntry !=
nullptr) {
78 m_fibEntry->m_nameTreeEntry =
nullptr;
80 m_fibEntry = std::move(fibEntry);
82 if (m_fibEntry !=
nullptr) {
83 m_fibEntry->m_nameTreeEntry =
this;
90 BOOST_ASSERT(pitEntry !=
nullptr);
91 BOOST_ASSERT(pitEntry->m_nameTreeEntry ==
nullptr);
93 m_pitEntries.push_back(pitEntry);
94 pitEntry->m_nameTreeEntry =
this;
100 BOOST_ASSERT(pitEntry !=
nullptr);
101 BOOST_ASSERT(pitEntry->m_nameTreeEntry ==
this);
103 auto it = std::find_if(m_pitEntries.begin(), m_pitEntries.end(),
104 [pitEntry] (
const shared_ptr<pit::Entry>& pitEntry2) {
return pitEntry2.get() == pitEntry; });
105 BOOST_ASSERT(it != m_pitEntries.end());
107 pitEntry->m_nameTreeEntry =
nullptr;
108 *it = m_pitEntries.back();
109 m_pitEntries.pop_back();
115 BOOST_ASSERT(measurementsEntry ==
nullptr || measurementsEntry->m_nameTreeEntry ==
nullptr);
117 if (m_measurementsEntry !=
nullptr) {
118 m_measurementsEntry->m_nameTreeEntry =
nullptr;
120 m_measurementsEntry = std::move(measurementsEntry);
122 if (m_measurementsEntry !=
nullptr) {
123 m_measurementsEntry->m_nameTreeEntry =
this;
130 BOOST_ASSERT(strategyChoiceEntry ==
nullptr || strategyChoiceEntry->m_nameTreeEntry ==
nullptr);
132 if (m_strategyChoiceEntry !=
nullptr) {
133 m_strategyChoiceEntry->m_nameTreeEntry =
nullptr;
135 m_strategyChoiceEntry = std::move(strategyChoiceEntry);
137 if (m_strategyChoiceEntry !=
nullptr) {
138 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