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

Class MyNode2

tutorial/MyGNode/MyNode2.h:14–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#include "CGraph.h"
13
14class MyNode2 : public CGraph::GNode {
15public:
16 // 执行过程中,init 和 destroy 方法,单次执行,可选择性实现
17 // run 方法可以多次执行,且必须实现
18 CStatus init() override {
19 CStatus status;
20 CGraph::CGRAPH_ECHO("[INIT] [%s], enter MyNode2 init function.", this->getName().c_str());
21 return status;
22 }
23
24 CStatus run() override {
25 CStatus status;
26 CGraph::CGRAPH_ECHO("[%s], enter MyNode2 run function. Sleep for 2 second ... ", this->getName().c_str());
27 CGRAPH_SLEEP_SECOND(2)
28 return status;
29 }
30
31 CStatus destroy() override {
32 CStatus status;
33 CGraph::CGRAPH_ECHO("[DESTROY] [%s], enter MyNode2 destroy function.", this->getName().c_str());
34 return status;
35 }
36};
37
38#endif //CGRAPH_MYNODE2_H

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected