Selectors may need to traverse the tree in different ways to match, and this is abstracted away using C++20 coroutines.
More...
#include "donner/base/element/ElementTraversalGenerators.h"
|
| class | Promise |
| | Defines and controls the behavior of the coroutine itself, by implementing methods that are called by the C++ runtime during execution of the coroutine. More...
|
|
|
using | Handle = std::coroutine_handle<Promise> |
| | The internal handle used to store the coroutine, used to construct ElementTraversalGenerator from a co_yield expression.
|
|
using | promise_type = Promise |
| | The internal object which stores the current value.
|
|
|
| ElementTraversalGenerator (Handle h) |
| | Construct a generator from a coroutine handle.
|
|
| ElementTraversalGenerator (const ElementTraversalGenerator &)=delete |
| | Copying generators is not allowed.
|
|
| ElementTraversalGenerator (ElementTraversalGenerator &&other) noexcept |
| | Move constructor.
|
|
ElementTraversalGenerator & | operator= (const ElementTraversalGenerator &)=delete |
| | Copying generators is not allowed.
|
|
ElementTraversalGenerator & | operator= (ElementTraversalGenerator &&other) noexcept |
| | Move assignment.
|
|
| ~ElementTraversalGenerator () |
| | Destructor.
|
| bool | next () |
| | Advance the generator to the next element, and return whether there is another element.
|
| T | getValue () |
| | Get the current value of the generator.
|
template<typename T>
class donner::ElementTraversalGenerator< T >
Selectors may need to traverse the tree in different ways to match, and this is abstracted away using C++20 coroutines.
Each traversal order is a coroutine that yields elements lazily, so that the tree is traversed only as far as necessary.
- See also
- singleElementGenerator
-
parentsGenerator
-
previousSiblingsGenerator
◆ getValue()
Get the current value of the generator.
- Precondition
- next() must have been called at least once, and returned true.
◆ next()
Advance the generator to the next element, and return whether there is another element.
- Returns
- true if there is another element, false if the generator has finished.
The documentation for this class was generated from the following file: