Table of Contents

Class CeresGraph

Namespace
Ceres.Graph
Assembly
cs.temp.dll.dll
public class CeresGraph : IDisposable, IDisposableUnregister
Inheritance
object
CeresGraph
Implements
IDisposableUnregister
Derived

Constructors

CeresGraph()

public CeresGraph()

CeresGraph(CeresGraphData)

public CeresGraph(CeresGraphData graphData)

Parameters

graphData CeresGraphData

Fields

nodes

public List<CeresNode> nodes

Field Value

List<CeresNode>

SubGraphSlots

public CeresSubGraphSlot[] SubGraphSlots

Field Value

CeresSubGraphSlot[]

variables

public List<SharedVariable> variables

Field Value

List<SharedVariable>

Properties

Blackboard

Exposed blackboard for data exchange

public Blackboard Blackboard { get; }

Property Value

Blackboard

Methods

AddSubGraphSlot<TGraph>(CeresSubGraphSlot)

Try to add a subGraph slot with specific type validation

public bool AddSubGraphSlot<TGraph>(CeresSubGraphSlot slot) where TGraph : CeresGraph

Parameters

slot CeresSubGraphSlot

Returns

bool

Type Parameters

TGraph

CollectDependencyPath(CeresGraph)

protected static void CollectDependencyPath(CeresGraph graph)

Parameters

graph CeresGraph

Compile(CeresGraphCompiler)

Compile graph just in time

public virtual void Compile(CeresGraphCompiler compiler)

Parameters

compiler CeresGraphCompiler

Runtime compiler

CompileNodes(CeresGraphCompiler)

protected static void CompileNodes(CeresGraphCompiler compiler)

Parameters

compiler CeresGraphCompiler

CreateBlackboard(List<SharedVariable>)

Create a blackboard from provided variables

protected virtual Blackboard CreateBlackboard(List<SharedVariable> inVariables)

Parameters

inVariables List<SharedVariable>

Returns

Blackboard

Dispose()

public virtual void Dispose()

FindNode(string)

Find node by guid

public CeresNode FindNode(string guid)

Parameters

guid string

Returns

CeresNode

Null if not exist

FindNode<TNode>(string)

Find node with specific type by guid

public TNode FindNode<TNode>(string guid) where TNode : CeresNode

Parameters

guid string

Returns

TNode

Null if not exist

Type Parameters

TNode

FindSubGraph<TGraph>(string)

Find subGraph with specific type by name

public TGraph FindSubGraph<TGraph>(string name) where TGraph : CeresGraph

Parameters

name string

Returns

TGraph

Null if not exist

Type Parameters

TGraph

GetDependencyPaths()

Get graph node current dependency path if existed

public int[][] GetDependencyPaths()

Returns

int[][]

GetFirstNodeOfType<TNode>()

Get first node with specific type

public TNode GetFirstNodeOfType<TNode>() where TNode : CeresNode

Returns

TNode

Null if not exist

Type Parameters

TNode

GetNodeDependencyPath(CeresNode)

Get dependency execution path for destination node

public int[] GetNodeDependencyPath(CeresNode node)

Parameters

node CeresNode

Returns

int[]

GetNodeDependencyPath(string)

Get dependency execution path for destination node with guid

public int[] GetNodeDependencyPath(string guid)

Parameters

guid string

Returns

int[]

InitPorts(CeresGraph)

Traverse the graph and init all ports automatically

protected static void InitPorts(CeresGraph graph)

Parameters

graph CeresGraph

InitVariables(CeresGraph)

Traverse the graph and init all shared variables automatically

protected static void InitVariables(CeresGraph graph)

Parameters

graph CeresGraph

IsUberGraph()

Is graph on top level which means it can have subGraphs

public virtual bool IsUberGraph()

Returns

bool

LinkPort(CeresPort, CeresNode, CeresPortData)

protected virtual void LinkPort(CeresPort port, CeresNode ownerNode, CeresPortData portData)

Parameters

port CeresPort
ownerNode CeresNode
portData CeresPortData

SetCompilerTarget(CeresGraphCompiler)

protected void SetCompilerTarget(CeresGraphCompiler compiler)

Parameters

compiler CeresGraphCompiler

SetDependencyPath(int[][])

Set graph node pre-cached dependency path

public void SetDependencyPath(int[][] dependencyPath)

Parameters

dependencyPath int[][]

TopologicalSort(CeresGraph, List<CeresNode>)

protected static int[][] TopologicalSort(CeresGraph graph, List<CeresNode> nodes)

Parameters

graph CeresGraph
nodes List<CeresNode>

Returns

int[][]