|
entttree 0.1.0
Hierarchical entity management for EnTT
|
A lazy description of a rooted graph traversal. More...
#include <traverse.h>
Public Types | |
| using | Node = Node_ |
| using | Successors = Successors_ |
Public Member Functions | |
| Traversal && | enable (bool enable) && |
| Conditionally disable the traversal. | |
| Traversal & | enable (bool enable) & |
| Conditionally disable the traversal. | |
Public Attributes | |
| std::optional< Node > | root |
| The starting point of the traversal, or empty to disable it. | |
| Successors | successors |
| A function returning a generator of the successors of a node. | |
A lazy description of a rooted graph traversal.
By keeping information about the structure of the tree (rather than a flat generator), we can more easily implement transformations and filters on the traversal. See the walk namespace for adaptors and walkers.
| Node_ | The type of each node in the traversal. |
| Successors_ | A callable (Node&) -> Generator<Node> that yields the children of a given node. |
Definition at line 44 of file traverse.h.
| using entttree::Traversal< Node_, Successors_ >::Node = Node_ |
Definition at line 45 of file traverse.h.
| using entttree::Traversal< Node_, Successors_ >::Successors = Successors_ |
Definition at line 46 of file traverse.h.
|
inline |
Conditionally disable the traversal.
If enable is false, the root is cleared, causing the traversal to produce no nodes. An already-disabled traversal remains disabled.
Definition at line 73 of file traverse.h.
References entttree::Traversal< Node_, Successors_ >::enable(), and entttree::Traversal< Node_, Successors_ >::root.
|
inline |
Conditionally disable the traversal.
If enable is false, the root is cleared, causing the traversal to produce no nodes. An already-disabled traversal remains disabled.
Definition at line 67 of file traverse.h.
References entttree::Traversal< Node_, Successors_ >::enable(), and entttree::Traversal< Node_, Successors_ >::root.
Referenced by entttree::Traversal< Node_, Successors_ >::enable(), and entttree::Traversal< Node_, Successors_ >::enable().
| std::optional<Node> entttree::Traversal< Node_, Successors_ >::root |
The starting point of the traversal, or empty to disable it.
Definition at line 49 of file traverse.h.
Referenced by entttree::Traversal< Node_, Successors_ >::enable(), and entttree::Traversal< Node_, Successors_ >::enable().
| Successors entttree::Traversal< Node_, Successors_ >::successors |
A function returning a generator of the successors of a node.
Signature: Successors(Node&) -> GeneratorConcept<Node>
Any references within the values yielded by the generator must remain valid at least until the generator is destroyed.
Definition at line 59 of file traverse.h.