Interface IScyllaMutableGraph<TNodeData>
Generic mutable graph interface that attaches typed user data to every node. Extends both IScyllaReadOnlyGraph<TNodeData> and IScyllaMutableGraph with node-data-aware mutation operations.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public interface IScyllaMutableGraph<TNodeData> : IScyllaReadOnlyGraph<TNodeData>, IScyllaMutableGraph, IScyllaReadOnlyGraph, IScyllaGraph, IScyllaCollection
Type Parameters
| Name | Description |
|---|---|
| TNodeData | The type of user data stored alongside each node. May be any managed or value type.
Nodes added through the inherited untyped overload
TryAddNode(int, ScyllaGraphNodeFlags) will have
|
Remarks
Position in the hierarchy. This interface sits at the intersection of the typed read-only branch (IScyllaReadOnlyGraph<TNodeData>) and the mutable branch (IScyllaMutableGraph). The two-type-parameter variant IScyllaMutableGraph<TNodeData, TEdgeData> further extends this interface to include per-edge typed data.
Untyped node addition. The untyped
TryAddNode(int, ScyllaGraphNodeFlags) inherited
from IScyllaMutableGraph remains available. Calling it produces a
node whose data is default(TNodeData). This is useful when the node data
will be populated in a separate pass after bulk topology construction.
Methods
TryAddNode(int, TNodeData, ScyllaGraphNodeFlags)
Attempts to add a new node with the specified ID, user data, and flags to the graph.
Declaration
bool TryAddNode(int nodeID, TNodeData data, ScyllaGraphNodeFlags flags = ScyllaGraphNodeFlags.Walkable)
Parameters
| Type | Name | Description |
|---|---|---|
| int | nodeID | A caller-supplied integer ID that must be unique within this graph. No ordering
or contiguity is required; any |
| TNodeData | data | The |
| ScyllaGraphNodeFlags | flags | Initial ScyllaGraphNodeFlags for the node. Defaults to Walkable if not specified. Flags can be changed later via TrySetNodeFlags(int, ScyllaGraphNodeFlags). |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
This overload is the preferred way to add nodes to a typed graph because it
associates the user data atomically at creation time, avoiding a subsequent
TrySetNodeData(int, TNodeData) call. The inherited untyped overload
TryAddNode(int, ScyllaGraphNodeFlags) adds a
node with default(TNodeData) and is available for scenarios where data
population is deferred.
See Also
TrySetNodeData(int, TNodeData)
Attempts to update the user data stored on an existing node.
Declaration
bool TrySetNodeData(int nodeID, TNodeData data)
Parameters
| Type | Name | Description |
|---|---|---|
| int | nodeID | The ID of the node to update. |
| TNodeData | data | The new |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
To retrieve the current data value before updating, use TryGetNodeData(int, out TNodeData).