| 11 | {} |
| 12 | |
| 13 | ParallelProgressReporter::PerTaskReporter ParallelProgressReporter::newTask( float weight ) |
| 14 | { |
| 15 | std::lock_guard lock( mutex_ ); |
| 16 | const float totalWeight = totalWeight_; |
| 17 | if ( totalWeight + weight > 0 ) |
| 18 | progress_ = progress_ * totalWeight / ( totalWeight + weight ); |
| 19 | totalWeight_ += weight; |
| 20 | return PerTaskReporter{ .reporter_ = this, |
| 21 | .task_ = &perTaskInfo_.emplace_front( TaskInfo{ .progress = 0.f, .weight = weight } ) }; |
| 22 | } |
| 23 | |
| 24 | bool ParallelProgressReporter::operator()() |
| 25 | { |
no outgoing calls
no test coverage detected