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

Function example_third_flow

example/E03-ThirdFlow.cpp:101–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99};
100
101void example_third_flow() {
102 CGRAPH_CREATE_MESSAGE_TOPIC(InputMParam, INPUT_TOPIC_NAME, 16);
103 CGRAPH_CREATE_MESSAGE_TOPIC(ResultMParam, RESULT_TOPIC_NAME, 16);
104
105 auto pipeline = GPipelineFactory::create();
106 GElementPtr input, process, result = nullptr;
107 pipeline->registerGElement<InputGNode>(&input);
108 pipeline->registerGElement<ProcessGNode>(&process);
109 pipeline->registerGElement<ResultGNode>(&result);
110
111 UThreadPoolConfig config;
112 config.default_thread_size_ = 3;
113 config.secondary_thread_size_ = 0;
114 pipeline->setUniqueThreadPoolConfig(config); // 设置3个线程执行
115
116 pipeline->process();
117 CGRAPH_CLEAR_MESSAGES()
118 GPipelineFactory::clear();
119}
120
121int main() {
122 example_third_flow();

Callers 1

mainFunction · 0.85

Calls 4

createFunction · 0.85
clearFunction · 0.50
processMethod · 0.45

Tested by

no test coverage detected