| 25 | |
| 26 | |
| 27 | class GenerateGNode : public GNode { |
| 28 | public: |
| 29 | CStatus init() override { |
| 30 | auto status = CGRAPH_CREATE_GPARAM(NumsGParam, PARAM_KEY); |
| 31 | return status; |
| 32 | } |
| 33 | |
| 34 | CStatus run() override { |
| 35 | std::mt19937 generator; |
| 36 | auto param = CGRAPH_GET_GPARAM_WITH_NO_EMPTY(NumsGParam, PARAM_KEY); |
| 37 | |
| 38 | std::uniform_int_distribution<int> distribution(0, MAX_NUM - 1); |
| 39 | for (int i = 0; i < MAP_SIZE * NUMS_PER_MAP; i++) { |
| 40 | int num = distribution(generator); |
| 41 | param->random_nums_.push_back(num); |
| 42 | } |
| 43 | |
| 44 | return CStatus(); |
| 45 | } |
| 46 | }; |
| 47 | |
| 48 | |
| 49 | template<int MAP_TAG> |
nothing calls this directly
no outgoing calls
no test coverage detected