Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
ElementTraversalGenerators.h File Reference
#include <coroutine>
#include "donner/base/Utils.h"
#include "donner/base/element/ElementLike.h"
Include dependency graph for ElementTraversalGenerators.h:
This graph shows which files directly or indirectly include this file:

Classes

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. More...
 
class  donner::ElementTraversalGenerator< T >::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...
 

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
 

Functions

template<ElementLike T>
ElementTraversalGenerator< T > donner::singleElementGenerator (T element)
 A generator that yields a single element, if it exists.
 
template<ElementLike T>
ElementTraversalGenerator< T > donner::parentsGenerator (T element)
 A generator that yields all parents of an element, repeatedly following parentElement() until reaching the root.
 
template<ElementLike T>
ElementTraversalGenerator< T > donner::previousSiblingsGenerator (T element)
 A generator that yields all siblings of an element, in reverse order.
 
template<ElementLike T>
ElementTraversalGenerator< T > donner::allChildrenRecursiveGenerator (T element)
 A generator that yields all children of an element recursively with pre-order traversal.