Interface IScyllaReadOnlyGraph<TNodeData>
Generic read-only graph interface that attaches typed user data to every node. Extends IScyllaReadOnlyGraph with per-node data retrieval.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public interface IScyllaReadOnlyGraph<TNodeData> : IScyllaReadOnlyGraph, IScyllaGraph, IScyllaCollection
Type Parameters
| Name | Description |
|---|---|
| TNodeData | The type of user data stored alongside each node. May be any managed or value type.
Reference types default to |
Remarks
Position in the hierarchy. This interface extends IScyllaReadOnlyGraph (which extends IScyllaGraph). The corresponding mutable variant is IScyllaMutableGraph<TNodeData>. For graphs that also require per-edge typed data, use IScyllaReadOnlyGraph<TNodeData, TEdgeData>.
Typed bulk operations. No typed bulk copy method (e.g.
CopyAllNodesWithData) is provided on this interface because doing so would
require introducing a generic node-with-data struct, adding complexity and type
proliferation to the interface hierarchy. To perform typed bulk operations, call
CopyAllNodes(Span<ScyllaGraphNode>) to retrieve the base descriptors,
then call TryGetNodeData(int, out TNodeData) per node to fetch the associated data.
Methods
TryGetNodeData(int, out TNodeData)
Attempts to retrieve the user data associated with the specified node.
Declaration
bool TryGetNodeData(int nodeID, out TNodeData data)
Parameters
| Type | Name | Description |
|---|---|---|
| int | nodeID | The ID of the node whose user data to retrieve. |
| TNodeData | data | When this method returns |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Nodes added through the untyped
TryAddNode(int, ScyllaGraphNodeFlags) overload
will have default(TNodeData) as their data value until explicitly set via
TrySetNodeData(int, TNodeData). A return value of
true with data equal to default(TNodeData) therefore does not
necessarily indicate that data was intentionally set to the default value.