inputProcessingDone
| 685 | } |
| 686 | // inputProcessingDone |
| 687 | void run() { |
| 688 | using namespace std::chrono_literals; |
| 689 | // CompletionGuard sets isDone to true in its destructor that is called at the end of this operator() method |
| 690 | std::list<CompletionGuard> guards; |
| 691 | for (auto &stage : stages) { |
| 692 | guards.emplace_back(stage->isDone); |
| 693 | } |
| 694 | |
| 695 | // Consume queued items as long as the previous processing step has not finished |
| 696 | while (anyNotDone()) { |
| 697 | doAll(); |
| 698 | prevWaitCount++; |
| 699 | std::this_thread::sleep_for(5ms); |
| 700 | } |
| 701 | |
| 702 | // Last call to consume queued items to catch last items |
| 703 | doAll(); |
| 704 | for (auto &stage : stages) { |
| 705 | stage->complete(); |
| 706 | } |
| 707 | } |
| 708 | }; |
| 709 | |
| 710 | ProcessStep makeStandardProcessStep(std::unique_ptr<ProcessorStep> && func, const DiscardCheckFunc &advanceFuncFirst, const DiscardCheckFunc &advanceFuncSecond, bool discardIfFullFirst = false, bool discardIfFullSecond = false) { |