| 225 | : gens(gens), schema(schema), num_batches(num_batches), batch_size(batch_size) {} |
| 226 | |
| 227 | std::optional<ExecBatch> Next() { |
| 228 | if (batch_index >= num_batches) { |
| 229 | return std::nullopt; |
| 230 | } |
| 231 | Result<ExecBatch> batch_res = MakeIntegerBatch(gens, schema, batch_row, batch_size); |
| 232 | if (!batch_res.ok()) { |
| 233 | return std::nullopt; |
| 234 | } |
| 235 | ++batch_index; |
| 236 | batch_row += batch_size; |
| 237 | return batch_res.ValueOrDie(); |
| 238 | } |
| 239 | |
| 240 | std::vector<std::function<int64_t(int)>> gens; |
| 241 | std::shared_ptr<Schema> schema; |
no test coverage detected