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

Function tutorial_event

tutorial/T18-Event.cpp:16–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14using namespace CGraph;
15
16void tutorial_event() {
17 GPipelinePtr pipeline = GPipelineFactory::create();
18 GElementPtr a, b, c, d = nullptr;
19
20 CStatus status = pipeline->registerGElement<MyWriteParamNode>(&a, {}, "nodeA");
21 status += pipeline->registerGElement<MyEventNode>(&b, {a}, "nodeB");
22 status += pipeline->registerGElement<MyNode1>(&c, {b}, "nodeC");
23 status += pipeline->registerGElement<MyEventNode>(&d, {b}, "nodeD");
24
25 // 在pipeline中添加一个事件信息,通过 notify("my-print-event")触发
26 pipeline->addGEvent<MyPrintEvent>("my-print-event");
27 pipeline->process();
28
29 GPipelineFactory::clear();
30}
31
32
33int main() {

Callers 1

mainFunction · 0.70

Calls 3

createFunction · 0.85
clearFunction · 0.50
processMethod · 0.45

Tested by

no test coverage detected