A view containing a list of components::RenderingInstanceComponent which can be iterated over.
More...
#include "donner/svg/renderer/common/RenderingInstanceView.h"
A view containing a list of components::RenderingInstanceComponent which can be iterated over.
The view snapshots the entity IDs it will visit at construction time. This lets the caller safely mutate the underlying components::RenderingInstanceComponent storage during iteration — for example, a filter-graph pre-pass that calls RenderingContext::createFeImageShadowTree, which emplaces new rendering instances and sorts the whole pool. Iterating over live entt iterators across such mutation would be undefined behaviour; iterating a snapshot of entity IDs is stable, and each component access re-reads from storage using storage.get(entity).
◆ donner::svg::RenderingInstanceView::SavedState
| struct donner::svg::RenderingInstanceView::SavedState |
Opaque iterator state returned by save and consumed by restore.
| Class Members |
|
size_t |
current |
Saved index into the snapshot entity list. |
◆ RenderingInstanceView() [1/2]
| donner::svg::RenderingInstanceView::RenderingInstanceView |
( |
Registry & | registry | ) |
|
|
inlineexplicit |
◆ RenderingInstanceView() [2/2]
| donner::svg::RenderingInstanceView::RenderingInstanceView |
( |
Registry & | registry, |
|
|
std::span< const Entity > | entities ) |
|
inline |
Constructor taking an explicit ordered list of entities to iterate.
The view copies the list; subsequent storage mutations do not affect iteration. Entities must all currently have a components::RenderingInstanceComponent — get() will dereference via storage lookup.
- Parameters
-
| registry | The registry to use. |
| entities | Ordered entity list to iterate. |
◆ advance()
| void donner::svg::RenderingInstanceView::advance |
( |
| ) |
|
|
inline |
Advances the view to the next element.
- Precondition
- List has elements remaining done() is false.
The documentation for this struct was generated from the following file: