| 308 | /************************************************************************/ |
| 309 | |
| 310 | std::unique_ptr<GDALAlgorithm> |
| 311 | GDALGlobalAlgorithmRegistry::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 */ |