MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / beginLayer

Method beginLayer

common/script/scriptconsole.cpp:137–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137void ScriptConsole::beginLayer(size_t layer, std::string label, long long total)
138{
139 if (layer >= MAX_LAYERS) {
140 return;
141 }
142 std::lock_guard<std::mutex> lock(mMutex);
143 mLayers[layer] = Layer{};
144 mLayers[layer].label = std::move(label);
145 mLayers[layer].total = total;
146 mLayers[layer].active = true;
147 mLayerSlots = std::max(mLayerSlots, layer + 1);
148 // Moving on to a new item at this depth invalidates everything under it:
149 // those labels name work that has stopped, so they are dropped rather than
150 // left to sit under a bar as if they were still current.
151 for (size_t deeper = layer + 1; deeper < MAX_LAYERS; deeper++) {
152 mLayers[deeper] = Layer{};
153 }
154 idleIo();
155}
156
157void ScriptConsole::setLayer(size_t layer, long long done)
158{

Callers 1

ckpt_progress_beginFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected