Table of Contents

Interface IResource

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

A node in Typhon's runtime resource graph: a named, typed element of the engine tree that owns child resources and participates in lifecycle (disposal) and diagnostic snapshotting. Nodes with measurable state additionally implement IMetricSource.

public interface IResource : IDisposable
Inherited Members
Extension Methods

Properties

Children

Direct child resources, in no particular order.

IEnumerable<IResource> Children { get; }

Property Value

IEnumerable<IResource>

Count

Optional scalar count exposed to UIs (Workbench tree badges, diagnostics). For ComponentTable this is the entity count; for a segments folder it could be the segment count. Structural nodes with no meaningful count return null.

int? Count { get; }

Property Value

int?

CreatedAt

UTC timestamp captured when this node was constructed.

DateTime CreatedAt { get; }

Property Value

DateTime

Id

Stable identifier, unique among siblings. Forms one segment of the node's tree path (e.g. "PageCache" in "Storage/PageCache").

string Id { get; }

Property Value

string

Name

Human-readable display label. May equal Id for structural nodes whose id is already self-describing (e.g. "Storage"), but for resources with synthetic ids (GUIDs, hex suffixes) this is the user-facing name the Workbench and diagnostics should surface.

string Name { get; }

Property Value

string

Owner

Registry that owns the tree this node belongs to.

IResourceRegistry Owner { get; }

Property Value

IResourceRegistry

Parent

Parent node in the tree, or null for the root.

IResource Parent { get; }

Property Value

IResource

Type

Classification of this resource, used for filtering and display.

ResourceType Type { get; }

Property Value

ResourceType

Methods

RegisterChild(IResource)

Attaches child under this node and raises NodeMutated with Added.

bool RegisterChild(IResource child)

Parameters

child IResource

The resource to attach.

Returns

bool

true if attached; false if a child with the same Id is already registered.

RemoveChild(IResource)

Detaches resource from this node and raises NodeMutated with Removed.

bool RemoveChild(IResource resource)

Parameters

resource IResource

The child resource to detach.

Returns

bool

true if detached; false if it was not a child of this node.