| 48 | |
| 49 | template<int MAP_TAG> |
| 50 | class MapGNode : public GNode { |
| 51 | public: |
| 52 | CStatus run() override { |
| 53 | auto param = CGRAPH_GET_GPARAM_WITH_NO_EMPTY(NumsGParam, PARAM_KEY); |
| 54 | for (int i = 0; i < NUMS_PER_MAP; i++) { |
| 55 | int num = param->random_nums_[MAP_TAG * NUMS_PER_MAP + i]; |
| 56 | param->map_results_[MAP_TAG][num]++; // 实际上是线程安全的 |
| 57 | } |
| 58 | return CStatus(); |
| 59 | } |
| 60 | }; |
| 61 | |
| 62 | |
| 63 | class ReduceGNode : public GNode { |
nothing calls this directly
no outgoing calls
no test coverage detected