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 Nexus loader but it does not "
97 "API::IFileLoader<Kernel::NexusDescriptor>");
102 throw std::runtime_error(std::string(
"FileLoaderRegistryImpl::subscribe - Class '") +
typeid(T).name() +
103 "' registered as NexusHDF5 loader but it does not "
105 "API::IFileLoader<Kernel::NexusHDF5Descriptor>");
110 throw std::runtime_error(std::string(
"FileLoaderRegistryImpl::subscribe - Class '") +
typeid(T).name() +
111 "' registered as Generic loader but it does "
113 "API::IFileLoader<Kernel::FileDescriptor>");
117 throw std::runtime_error(
"Invalid LoaderFormat given");
123 void removeAlgorithm(
const std::string &name,
const int version, std::multimap<std::string, int> &typedLoaders);
127 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.
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...