49 inline size_t size()
const {
return m_totalSize; }
64 const auto nameVersion = AlgorithmFactory::Instance().subscribe<Type>();
66 m_names[format].insert(nameVersion);
68 m_log.debug() <<
"Registered '" << nameVersion.first <<
"' version '" << nameVersion.second <<
"' as file loader\n";
72 void unsubscribe(
const std::string &
name,
const int version = -1);
75 const std::shared_ptr<IAlgorithm> chooseLoader(
const std::string &filename)
const;
77 bool canLoad(
const std::string &algorithmName,
const std::string &filename)
const;
94 throw std::runtime_error(std::string(
"FileLoaderRegistryImpl::subscribe - Class '") +
typeid(T).
name() +
95 "' registered as LegacyNexus loader but it does not inherit from "
96 "API::IFileLoader<Kernel::LegacyNexusDescriptor>");
101 throw std::runtime_error(
102 std::string(
"FileLoaderRegistryImpl::subscribe - Class '") +
typeid(T).
name() +
103 "' registered as Nexus loader but it does not inherit from API::IFileLoader<Kernel::NexusDescriptor>");
108 throw std::runtime_error(
109 std::string(
"FileLoaderRegistryImpl::subscribe - Class '") +
typeid(T).
name() +
110 "' registered as Generic loader but it does not inherit from API::IFileLoader<Kernel::FileDescriptor>");
114 throw std::runtime_error(
"Invalid LoaderFormat given");
120 void removeAlgorithm(
const std::string &
name,
const int version, std::multimap<std::string, int> &typedLoaders);
124 std::array<std::multimap<std::string, int>, 3>
m_names;
double value
The value of the point.
Keeps a registry of algorithm's that are file loading algorithms to allow them to be searched to find...
std::array< std::multimap< std::string, int >, 3 > m_names
The list of names.
void subscribe(LoaderFormat format)
Registers a loader whose format is one of the known formats given in LoaderFormat.
LoaderFormat
Defines types of possible file.
size_t m_totalSize
Total number of names registered.
Kernel::Logger m_log
Reference to a logger.
~FileLoaderRegistryImpl()
Destructor.
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
The Logger class is in charge of the publishing messages from the framework through various channels.
Manage the lifetime of a class intended to be a singleton.
Mantid::Kernel::SingletonHolder< FileLoaderRegistryImpl > FileLoaderRegistry
Type for the actual singleton instance.
Helper class which provides the Collimation Length for SANS instruments.
Helper for subscribe to check base class.
static void check(LoaderFormat format)
Policy class controlling creation of the singleton Implementation classes should mark their default c...