Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
uni20::async::NodeInfo Class Reference

Records node information for DAG/debugging visualization. More...

#include <async_node.hpp>

Public Member Functions

void const * address () const
 Returns the raw address of the current constructed value when observable.
 
uint64_t global_index () const
 Returns the unique global index of this node.
 
 NodeInfo ()=delete
 Deleted default constructor. NodeInfo can only be constructed via create.
 
void const * storage_address () const
 Returns the raw address of the shared storage control block.
 
std::string_view type () const
 Returns a human-readable, demangled type name.
 
bool value_constructed () const noexcept
 Reports whether the value is currently constructed when observable.
 
NodeValueState value_state () const noexcept
 Reports the current construction state when observable.
 
std::string_view value_state_label () const noexcept
 Returns a stable label for the current construction state.
 
std::string value_text () const
 Returns type-specific display text for the current value.
 

Static Public Member Functions

template<typename T >
static NodeInfo const * create (shared_storage< T > const &storage)
 Factory method to create a NodeInfo for shared async storage.
 
template<typename T >
static NodeInfo const * create (T const *value)
 Returns the stacktrace of where the node was created.
 

Detailed Description

Records node information for DAG/debugging visualization.

Each NodeInfo represents a single instance of an object participating in the dependency DAG (e.g., an Async<T>). It is assigned a unique global index at construction, and retains diagnostic addresses for the async storage and the constructed value when available.

NodeInfo objects are always heap-allocated and intentionally leaked for process-lifetime diagnostics. Each node is globally unique for the process lifetime.

Constructor & Destructor Documentation

◆ NodeInfo()

uni20::async::NodeInfo::NodeInfo ( )
delete

Deleted default constructor. NodeInfo can only be constructed via create.

Member Function Documentation

◆ address()

void const * uni20::async::NodeInfo::address ( ) const
inline

Returns the raw address of the current constructed value when observable.

Returns
Constructed value address, or nullptr if the value is currently unconstructed.

◆ create() [1/2]

template<typename T >
static NodeInfo const * uni20::async::NodeInfo::create ( shared_storage< T > const &  storage)
inlinestatic

Factory method to create a NodeInfo for shared async storage.

Template Parameters
TThe async storage value type.
Parameters
storageStorage handle represented by this node.
Returns
Pointer to the new NodeInfo (never deallocated).
Postcondition
The returned NodeInfo outlives all references (process lifetime).

◆ create() [2/2]

template<typename T >
static NodeInfo const * uni20::async::NodeInfo::create ( T const *  value)
inlinestatic

Returns the stacktrace of where the node was created.

Factory method to create a NodeInfo for an object pointer.

Template Parameters
TThe type of the object.
Parameters
valuePointer to the value for which a NodeInfo should be created.
Returns
Pointer to the new NodeInfo (never deallocated).
Postcondition
The returned NodeInfo outlives all references (process lifetime).

◆ global_index()

uint64_t uni20::async::NodeInfo::global_index ( ) const
inline

Returns the unique global index of this node.

Returns
Monotonically increasing value, unique across all NodeInfo instances for this process.

◆ storage_address()

void const * uni20::async::NodeInfo::storage_address ( ) const
inline

Returns the raw address of the shared storage control block.

Returns
Control-block address, or nullptr when the node was not storage-backed.

◆ type()

std::string_view uni20::async::NodeInfo::type ( ) const
inline

Returns a human-readable, demangled type name.

The string is obtained from an interned map keyed by the mangled type name. The returned string_view is valid for the process lifetime.

Note
Thread-safe.

◆ value_constructed()

bool uni20::async::NodeInfo::value_constructed ( ) const
inlinenoexcept

Reports whether the value is currently constructed when observable.

Returns
true when address is non-null.

◆ value_state()

NodeValueState uni20::async::NodeInfo::value_state ( ) const
inlinenoexcept

Reports the current construction state when observable.

Returns
Current value state for snapshot rendering.

◆ value_state_label()

std::string_view uni20::async::NodeInfo::value_state_label ( ) const
inlinenoexcept

Returns a stable label for the current construction state.

Returns
State label suitable for Graphviz output.

◆ value_text()

std::string uni20::async::NodeInfo::value_text ( ) const
inline

Returns type-specific display text for the current value.

Returns
One-line value text, such as a scalar value or shape=(...), when available.

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