Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::GraphInspector Class Reference

Lightweight diagnostics entry point. More...

#include <inspector.hpp>

Classes

struct  FlushEvent
 A single event emitted by the Graph during flush. More...
class  ScopedTracer
 RAII guard — install a tracer for the lifetime of a scope, then restore the previous tracer (or no tracer) on destruction. More...

Public Types

using FlushTracer = std::function<void(const FlushEvent&)>

Static Public Member Functions

static std::vector< const Node * > reachable_from (const std::vector< const Node * > &seeds)
 Collect every node reachable from seeds through either direction of the dependency graph (upstream sources AND downstream observers).
static std::string to_dot (const std::vector< const Node * > &seeds, std::string_view graph_name="reactive")
 Emit the reachable subgraph as a Graphviz DOT document.
static std::string to_json (const std::vector< const Node * > &seeds)
 Emit the reachable subgraph as a minimal JSON document.
static void install_flush_tracer (FlushTracer tracer)
 Install a tracer.
static void clear_flush_tracer () noexcept
static bool has_flush_tracer () noexcept
static std::string to_text (const std::vector< const Node * > &seeds)
 Human-readable one-line-per-node summary, useful inside gdb or during ad-hoc printf debugging.

Detailed Description

Lightweight diagnostics entry point.

All methods are static; the class is just a namespace with the benefit of being friend-able.

Member Typedef Documentation

◆ FlushTracer

using aria::reactive::GraphInspector::FlushTracer = std::function<void(const FlushEvent&)>

Member Function Documentation

◆ reachable_from()

std::vector< const Node * > aria::reactive::GraphInspector::reachable_from ( const std::vector< const Node * > & seeds)
inlinestatic

Collect every node reachable from seeds through either direction of the dependency graph (upstream sources AND downstream observers).

Used internally by to_dot/to_json; exposed for callers that want to build their own formatter.

◆ to_dot()

std::string aria::reactive::GraphInspector::to_dot ( const std::vector< const Node * > & seeds,
std::string_view graph_name = "reactive" )
inlinestatic

Emit the reachable subgraph as a Graphviz DOT document.

Usage: std::ofstream("g.dot") << GraphInspector::to_dot({&prop, &comp}); dot -Tsvg g.dot -o g.svg

◆ to_json()

std::string aria::reactive::GraphInspector::to_json ( const std::vector< const Node * > & seeds)
inlinestatic

Emit the reachable subgraph as a minimal JSON document.

Schema: { "nodes": [{"id","kind","state","depth","version","name"}...], "edges": [{"from","to","observed_version"}...] }

◆ install_flush_tracer()

Install a tracer.

Replaces any previously installed one. Pass an empty function (or call clear_flush_tracer()) to disable.

Cost when NOT installed: a single pointer load + null check in Graph::flush / Graph::pull. Cost when installed: one virtual call (std::function invocation) per event plus a steady_clock::now() pair around every Pull.

◆ clear_flush_tracer()

◆ has_flush_tracer()

bool aria::reactive::GraphInspector::has_flush_tracer ( )
inlinestaticnodiscardnoexcept

◆ to_text()

std::string aria::reactive::GraphInspector::to_text ( const std::vector< const Node * > & seeds)
inlinestatic

Human-readable one-line-per-node summary, useful inside gdb or during ad-hoc printf debugging.


The documentation for this class was generated from the following file: