MCPcopy Create free account
hub / github.com/ChunelFeng/CGraph / tutorial_mutable

Function tutorial_mutable

tutorial/T26-Mutable.cpp:16–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14using namespace CGraph;
15
16void tutorial_mutable() {
17 GPipelinePtr pipeline = GPipelineFactory::create();
18 GElementPtr a, b_mutable, c, d = nullptr;
19
20 // 创建一个 mutable(异变),在其中注入三个node
21 // ps:这里设定的依赖信息关系,是无效的
22 b_mutable = pipeline->createGGroup<MyMutable>({
23 pipeline->createGNode<MyNode1>(GNodeInfo("nodeB1")),
24 pipeline->createGNode<MyNode2>(GNodeInfo("nodeB2")),
25 pipeline->createGNode<MyNode1>(GNodeInfo("nodeB3"))
26 });
27
28 pipeline->registerGElement<MyNode1>(&a, {}, "nodeA", 1);
29 pipeline->registerGGroup(&b_mutable, {a}, "mutableB", 1);
30 pipeline->registerGElement<MyNode2>(&c, {a}, "nodeC", 1);
31 pipeline->registerGElement<MyWriteParamNode>(&d, {b_mutable, c}, "nodeD", 1);
32
33 // 执行多次,查看 b_mutable 中的执行结果。每次都是不同的
34 pipeline->process(6);
35 GPipelineFactory::remove(pipeline);
36}
37
38
39int main () {

Callers 1

mainFunction · 0.70

Calls 5

createFunction · 0.85
GNodeInfoClass · 0.85
removeFunction · 0.85
registerGGroupMethod · 0.80
processMethod · 0.45

Tested by

no test coverage detected