MCPcopy Create free account
hub / github.com/OSGeo/gdal / InstantiateDeclaredSubAlgorithm

Method InstantiateDeclaredSubAlgorithm

gcore/gdalalgorithmregistry.cpp:310–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308/************************************************************************/
309
310std::unique_ptr<GDALAlgorithm>
311GDALGlobalAlgorithmRegistry::InstantiateDeclaredSubAlgorithm(
312 const std::vector<std::string> &path) const
313{
314 const GDALGlobalAlgorithmRegistry::Node *node = GetNodeFromPath(path);
315 if (node && node->instantiateFunc)
316 {
317 auto alg = node->instantiateFunc();
318 if (alg)
319 {
320 auto callPath = path;
321 if (path[0] != GDALGlobalAlgorithmRegistry::ROOT_ALG_NAME)
322 callPath.insert(callPath.begin(),
323 GDALGlobalAlgorithmRegistry::ROOT_ALG_NAME);
324 alg->SetCallPath(callPath);
325 }
326 return alg;
327 }
328 return nullptr;
329}
330
331/************************************************************************/
332/* struct GDALAlgorithmRegistryHS */

Callers 2

TEST_FFunction · 0.80

Calls 2

insertMethod · 0.45
beginMethod · 0.45

Tested by 1

TEST_FFunction · 0.64