Common base for every node participating in the reactive graph.
More...
#include <node.hpp>
|
| static Graph & | graph () noexcept |
| | Returns the process-wide singleton Graph this node belongs to.
|
Common base for every node participating in the reactive graph.
Concrete nodes implement recompute() (Derivation / Reaction) or drive notify_changed() externally after mutating their value (Source).
◆ Node() [1/3]
| aria::reactive::Node::Node |
( |
NodeKind | kind | ) |
|
|
inlineexplicitnoexcept |
◆ ~Node()
| aria::reactive::Node::~Node |
( |
| ) |
|
|
inlinevirtualnoexcept |
◆ Node() [2/3]
| aria::reactive::Node::Node |
( |
const Node & | | ) |
|
|
delete |
◆ Node() [3/3]
| aria::reactive::Node::Node |
( |
Node && | | ) |
|
|
delete |
◆ operator=() [1/2]
| Node & aria::reactive::Node::operator= |
( |
const Node & | | ) |
|
|
delete |
◆ operator=() [2/2]
| Node & aria::reactive::Node::operator= |
( |
Node && | | ) |
|
|
delete |
◆ kind()
| NodeKind aria::reactive::Node::kind |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ state()
| NodeState aria::reactive::Node::state |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ version()
| std::uint64_t aria::reactive::Node::version |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ debug_name()
| const std::string & aria::reactive::Node::debug_name |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ set_debug_name()
| void aria::reactive::Node::set_debug_name |
( |
std::string | name | ) |
|
|
inline |
◆ effective_debug_name()
| const std::string & aria::reactive::Node::effective_debug_name |
( |
| ) |
const |
|
inlinenodiscard |
A non-empty debug label for diagnostic output.
If the user explicitly set a debug_name(), that is returned verbatim. Otherwise a deterministic per-node fallback of the form "<Kind>#<id>" (e.g. "Derivation#42") is lazily cached and returned — so stderr dumps and GraphInspector labels are always meaningful even when the host type forgot to name its nodes.
The fallback id is a process-wide monotonic counter, not the node's address, so diagnostic output stays stable across runs and ASLR shuffles.
◆ graph()
| Graph & aria::reactive::Node::graph |
( |
| ) |
|
|
inlinestaticnoexcept |
Returns the process-wide singleton Graph this node belongs to.
◆ notify_changed()
| void aria::reactive::Node::notify_changed |
( |
| ) |
|
|
inline |
Called by a Source after its value has actually changed: bumps the version and colors all downstream nodes MaybeDirty.
If no batch is active, the Graph will immediately flush afterwards.
◆ mark_downstream_maybe_dirty()
| void aria::reactive::Node::mark_downstream_maybe_dirty |
( |
| ) |
|
|
inline |
Mark self and all reachable descendants as MaybeDirty.
Nodes already in a non-Clean state are skipped, bounding the walk to O(|affected|).
◆ mark_dirty()
| void aria::reactive::Node::mark_dirty |
( |
| ) |
|
|
inlinenoexcept |
Escalate state to Dirty (used by Graph::pull after confirming an upstream has truly moved).
◆ depth()
| std::uint32_t aria::reactive::Node::depth |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Topological depth used by flush ordering.
Source nodes are depth 0; Derivations are (max upstream depth + 1). Updated on edge insertion.
◆ set_depth()
| void aria::reactive::Node::set_depth |
( |
std::uint32_t | d | ) |
|
|
inlinenoexcept |
◆ recompute()
| virtual bool aria::reactive::Node::recompute |
( |
| ) |
|
|
inlinevirtual |
Recompute hook for Derivation / Reaction nodes.
Source nodes keep the default empty implementation (never invoked). Return true iff the cached value actually changed (version already bumped inside the override); this tells the Graph to propagate to downstream nodes.
Reimplemented in aria::Computed< T >, and aria::reactive::Computed< T >.
◆ retain_for_recompute()
| virtual std::shared_ptr< Node > aria::reactive::Node::retain_for_recompute |
( |
| ) |
|
|
inlinenodiscardvirtualnoexcept |
Reactions are shared-owned and may cancel themselves while running.
Value nodes keep caller-owned lifetimes and return an empty handle.
◆ attach_as_observer_of()
| void aria::reactive::Node::attach_as_observer_of |
( |
Node & | source, |
|
|
Edge & | edge ) |
|
inlinenoexcept |
◆ detach_edge()
| void aria::reactive::Node::detach_edge |
( |
Edge & | edge | ) |
|
|
inlinenoexcept |
◆ clear_sources()
| void aria::reactive::Node::clear_sources |
( |
| ) |
|
|
inlinenoexcept |
Drop every upstream edge.
Typical use: a Derivation calls this just before recomputing so it can gather a fresh dependency set.
◆ for_each_observer()
template<class F>
| void aria::reactive::Node::for_each_observer |
( |
F && | f | ) |
|
|
inline |
Iterate the observer list (used by Graph to color downstream nodes).
◆ for_each_source()
template<class F>
| void aria::reactive::Node::for_each_source |
( |
F && | f | ) |
const |
|
inline |
Iterate the source list (used by a Derivation in pull() to compare each upstream's current version against observed_version).
◆ has_observers()
| bool aria::reactive::Node::has_observers |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ has_sources()
| bool aria::reactive::Node::has_sources |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ retire_()
| void aria::reactive::Node::retire_ |
( |
| ) |
|
|
inlineprotectednoexcept |
Retire before derived members (including user captures) are destroyed.
The base destructor repeats this safely for custom Node subclasses.
◆ bump_version_()
| void aria::reactive::Node::bump_version_ |
( |
| ) |
|
|
inlineprotectednoexcept |
◆ set_state_()
| void aria::reactive::Node::set_state_ |
( |
NodeState | s | ) |
|
|
inlineprotectednoexcept |
◆ Graph
◆ detail::NodeHandle
| friend class detail::NodeHandle |
|
friend |
The documentation for this class was generated from the following files:
- modules/core/include/aria/reactive/node.hpp
- modules/core/include/aria/reactive/graph.inl