MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / newTask

Method newTask

source/MRMesh/MRParallelProgressReporter.cpp:13–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11{}
12
13ParallelProgressReporter::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
24bool ParallelProgressReporter::operator()()
25{

Callers 1

makeObjectTreeFromFolderFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected