Mantid
Loading...
Searching...
No Matches
FileLoaderRegistry.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8#include <boost/python/class.hpp>
9#include <boost/python/reference_existing_object.hpp>
10
13using namespace boost::python;
14
16 class_<FileLoaderRegistryImpl, boost::noncopyable>("FileLoaderRegistryImpl", no_init)
17 .def("canLoad", &FileLoaderRegistryImpl::canLoad, (arg("self"), arg("algorithm_name"), arg("file_name")),
18 "Perform a check that that the given algorithm can load the file")
19 .def("Instance", &FileLoaderRegistry::Instance, return_value_policy<reference_existing_object>(),
20 "Returns a reference to the FileLoaderRegistry singleton instance")
21 .def("chooseLoader", &FileLoaderRegistryImpl::chooseLoader, (arg("self"), arg("file_path")),
22 "Returns the winning algorithm")
23 .staticmethod("Instance");
24}
void export_FileLoaderRegistry()
Keeps a registry of algorithm's that are file loading algorithms to allow them to be searched to find...
const std::shared_ptr< IAlgorithm > chooseLoader(const std::string &filename) const
Returns the name of an Algorithm that can load the given filename.
bool canLoad(const std::string &algorithmName, const std::string &filename) const
Checks whether the given algorithm can load the file.
Manage the lifetime of a class intended to be a singleton.