MCPcopy Create free account
hub / github.com/PDAL/PDAL / execute

Method execute

pdal/Stage.cpp:206–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204
205
206PointViewSet Stage::execute(PointTableRef table)
207{
208 if (!table.layout()->finalized())
209 {
210 for (const auto& id : table.layout()->dims())
211 {
212 if (Dimension::isDeprecated(id))
213 {
214 log()->get(LogLevel::Warning) <<
215 "Dimension " << Dimension::name(id) << " is deprecated" <<
216 std::endl;
217 }
218 }
219 }
220
221 table.finalize();
222
223 // We store stage instances instead of stages because a stage may get
224 // executed more than once. A stage instance is created for each
225 // execution of a stage in a pipeline. This properly builds out
226 // diamond-shaped pipelines.
227 int stageInstanceId = 1;
228 struct StageInstance
229 {
230 Stage *m_stage;
231 int m_id;
232
233 StageInstance(Stage *s, int id) : m_stage(s), m_id(id)
234 {}
235 StageInstance() : m_stage(nullptr), m_id(0)
236 {}
237
238 bool operator<(const StageInstance& other) const
239 { return m_id < other.m_id; }
240 };
241
242 std::stack<StageInstance> stages;
243 std::stack<StageInstance> pending;
244 std::map<StageInstance, StageInstance> children;
245
246 m_log->get(LogLevel::Debug) << "Executing pipeline in standard mode." <<
247 std::endl;
248
249 pending.push(StageInstance(this, stageInstanceId++));
250
251 // Linearize stage execution.
252 while (pending.size())
253 {
254 StageInstance si = pending.top();
255 pending.pop();
256 stages.push(si);
257 for (Stage *in : si.m_stage->m_inputs)
258 {
259 StageInstance parent(in, stageInstanceId++);
260 pending.push(parent);
261 children[parent] = si;
262 }
263 }

Callers

nothing calls this directly

Calls 15

StageInstanceClass · 0.85
topMethod · 0.80
addSpatialReferenceMethod · 0.80
keepsMethod · 0.80
waitMethod · 0.80
logFunction · 0.70
nameFunction · 0.70
readyFunction · 0.70
prerunFunction · 0.70
doneFunction · 0.70
getMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected