|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
41 #include <type_traits>
47 struct PCNodeChildrenIterable;
48 struct PCNodeNeighborsIterable;
59 : m_node(
node), m_pred(pred), m_curr(curr) { }
100 unsigned long count() const;
109 , m_first(first != nullptr
111 : (
node->m_child1 != nullptr ?
node->m_child1 :
node->getParent())) {
112 if (this->m_first ==
nullptr) {
116 || this->m_first->isParentOf(this->m_node));
124 unsigned long count() const;
131 template<
bool dfs,
bool reverse = false>
134 typename std::conditional<dfs, std::vector<PCNode*>, std::deque<PCNode*>>
::type;
153 std::function<
bool(
PCNode*)> visit = return_true,
154 std::function<
bool(
PCNode*)> descend_from = return_true)
156 if (!m_pending.empty() && !m_visit(top())) {
172 return m_pending.back();
174 return m_pending.front();
187 OGDF_DEPRECATED(
"Calling FilteringPCTreeWalk++ will copy the array of pending nodes")
200 m_pending.pop_back();
202 m_pending.pop_front();
204 if (m_descend(
node)) {
206 std::back_inserter(m_pending));
211 }
while (!m_pending.empty() && !m_visit(top()));
214 explicit operator bool()
const {
return valid(); }
216 bool valid()
const {
return !m_pending.empty(); }
typename std::conditional< dfs, std::vector< PCNode * >, std::deque< PCNode * > >::type container_type
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
FilteringPCTreeWalk([[maybe_unused]] const PCTree &T, PCNode *start, std::function< bool(PCNode *)> visit=return_true, std::function< bool(PCNode *)> descend_from=return_true)
PCNode * operator*() const
bool isParentOf(const PCNode *other) const
#define OGDF_DEPRECATED(reason)
Mark a class / member / function as deprecated.
HypergraphRegistry< HypernodeElement >::iterator begin(const HypergraphRegistry< HypernodeElement > &self)
std::ptrdiff_t difference_type
A PC-tree represents a set of cyclic orders of its leaves by labeling its inner nodes as either P- or...
std::forward_iterator_tag iterator_category
PCNodeChildrenIterable(PCNode *node)
FilteringPCTreeWalk end() const
PCNode & operator->() const
bool operator!=(const PCNodeIterator &rhs) const
Reverse< T > reverse(T &container)
Provides iterators for container to make it easily iterable in reverse.
std::input_iterator_tag iterator_category
A DFS or BFS through a PCTree.
FilteringPCTreeWalk & begin()
static void copy(const T &from, T &to)
bool operator==(const PCNodeIterator &rhs) const
static bool return_true([[maybe_unused]] PCNode *n)
const T & move(const T &v)
std::function< bool(PCNode *)> m_descend
bool operator==(const FilteringPCTreeWalk &rhs) const
std::function< bool(PCNode *)> m_visit
A node in a PC-tree that is either a P-node, C-node or leaf.
A node in a PC-tree that is either a P-node, C-node or leaf.
Basic declarations, included by all source files.
HypergraphRegistry< HypernodeElement >::iterator end(const HypergraphRegistry< HypernodeElement > &self)
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
std::ptrdiff_t difference_type
PCNodeNeighborsIterable(PCNode *node, PCNode *first=nullptr)
bool operator!=(const FilteringPCTreeWalk &rhs) const
Class for the representation of nodes.
PCNodeIterator(PCNode *node, PCNode *pred, PCNode *curr)
FilteringPCTreeWalk & operator++()
Increment operator (prefix, returns result).