Document-local hooks for tree mutations.
More...
#include "donner/base/xml/components/TreeMutationContext.h"
|
|
| TreeMutationContext () |
| | Default ctor installs the basic XML callbacks. Higher-level models (SVGDocument) overwrite the individual function fields after construction.
|
|
|
std::function< void(EntityHandle parent, EntityHandle newNode, EntityHandle referenceNode)> | insertBefore |
| | Callback for insertBefore(parent, newNode, referenceNode).
|
|
std::function< void(EntityHandle parent, EntityHandle child)> | appendChild |
| | Callback for appendChild(parent, child).
|
|
std::function< void(EntityHandle parent, EntityHandle newChild, EntityHandle oldChild)> | replaceChild |
| | Callback for replaceChild(parent, newChild, oldChild).
|
|
std::function< void(EntityHandle parent, EntityHandle child)> | removeChild |
| | Callback for removeChild(parent, child).
|
|
std::function< void(EntityHandle entity)> | remove |
| | Callback for remove(entity).
|
|
std::function< void(EntityHandle node, const RcStringOrRef &value)> | setValue |
| | Callback for a node value assignment, allowing document-specific style invalidation.
|
Document-local hooks for tree mutations.
Always installed in Registry::ctx() by the owning document model: donner::xml::XMLDocument installs the Default* callbacks below (which operate on TreeComponent directly), and higher-level models such as SVGDocument overwrite the individual callbacks after construction to layer invalidation and lifetime tracking on top. donner::xml::XMLNode mutation methods always go through the context, so the lookup never needs to fall back to a direct TreeComponent path - Registry::ctx().contains<TreeMutationContext>() is an invariant of any registry exposed through one of the document facades.
◆ DefaultAppendChild()
Append a child through the default ECS tree operation.
- Parameters
-
| parent | Destination parent in the same registry as the child. |
| child | Element to append. |
◆ DefaultRemove()
| void donner::components::TreeMutationContext::DefaultRemove |
( |
EntityHandle | entity | ) |
|
|
inlinestatic |
Detach an entity through the default ECS tree operation.
- Parameters
-
| entity | Entity to remove from its parent. |
◆ DefaultRemoveChild()
Detach a child through the default ECS tree operation.
- Parameters
-
| parent | Parent containing the child. |
| child | Child to detach. |
◆ DefaultReplaceChild()
Replace a child through the default ECS tree operation.
- Parameters
-
| parent | Parent containing the old child. |
| newChild | Replacement child in the same registry. |
| oldChild | Child to replace. |
◆ DefaultSetValue()
Assign a value in the basic XML model.
- Parameters
-
| node | Node receiving the new value. |
| value | New text or node value. |
The documentation for this struct was generated from the following file: