| 12 | #include "CGraph.h" |
| 13 | |
| 14 | class MyNode2 : public CGraph::GNode { |
| 15 | public: |
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected