| 36 | class InputGNode : public GNode { |
| 37 | public: |
| 38 | CStatus run() override { |
| 39 | for (int i = 0; i < 30; i++) { |
| 40 | std::shared_ptr<InputMParam> input(new InputMParam()); |
| 41 | randomSleep(1, 5); // 间隔1~6ms,发送一次 |
| 42 | input->num_ = std::abs((int)std::random_device{}()) % 5 + 1; |
| 43 | CGRAPH_SEND_MPARAM(InputMParam, INPUT_TOPIC_NAME, input, GMessagePushStrategy::WAIT); |
| 44 | } |
| 45 | |
| 46 | CGRAPH_ECHO(" ----> InputGNode run finished"); |
| 47 | return CStatus(); |
| 48 | } |
| 49 | }; |
| 50 | |
| 51 | class ProcessGNode : public GNode { |
nothing calls this directly
no test coverage detected