| 219 | } |
| 220 | |
| 221 | IProcessor::Status SortingTransform::prepareConsume() |
| 222 | { |
| 223 | auto & input = inputs.front(); |
| 224 | auto & output = outputs.front(); |
| 225 | |
| 226 | /// Check can output. |
| 227 | |
| 228 | if (output.isFinished()) |
| 229 | { |
| 230 | input.close(); |
| 231 | return Status::Finished; |
| 232 | } |
| 233 | |
| 234 | if (!output.canPush()) |
| 235 | { |
| 236 | input.setNotNeeded(); |
| 237 | return Status::PortFull; |
| 238 | } |
| 239 | |
| 240 | if (generated_chunk) |
| 241 | output.push(std::move(generated_chunk)); |
| 242 | |
| 243 | /// Check can input. |
| 244 | if (!current_chunk) |
| 245 | { |
| 246 | if (input.isFinished()) |
| 247 | return Status::Finished; |
| 248 | |
| 249 | if (!input.hasData()) |
| 250 | { |
| 251 | input.setNeeded(); |
| 252 | return Status::NeedData; |
| 253 | } |
| 254 | |
| 255 | current_chunk = input.pull(true); |
| 256 | } |
| 257 | |
| 258 | /// Now consume. |
| 259 | return Status::Ready; |
| 260 | } |
| 261 | |
| 262 | IProcessor::Status SortingTransform::prepareSerialize() |
| 263 | { |
nothing calls this directly
no test coverage detected