18#include <QSetIterator>
20#include <boost/optional.hpp>
45 UserSubWindow *createUnwrapped(
const std::string &name)
const override;
47 QSet<QString> categories(
const QString &interfaceName)
const;
48 QStringList keys()
const;
51 BaseDecoder *findDecoder(
const std::string &decodeString);
53 template <
typename TYPE>
void subscribe();
54 template <
typename WindowType,
typename EncoderType,
typename DecoderType>
55 void subscribe(
const std::string &decoderTag);
69 UserSubWindow *createFromAlias(
const std::string &name)
const;
72 template <
typename TYPE>
void saveAliasNames(
const std::string &realName);
84 std::map<std::string, std::shared_ptr<Mantid::Kernel::AbstractInstantiator<BaseEncoder>>>
m_encoders;
85 std::map<std::string, std::shared_ptr<Mantid::Kernel::AbstractInstantiator<BaseDecoder>>>
m_decoders;
89 std::string realName = TYPE::name();
91 saveAliasNames<TYPE>(realName);
94 const QStringList
categories = TYPE::categoryInfo().split(
";", Qt::SkipEmptyParts);
96 foreach (
const QString category,
categories) { result.insert(category.trimmed()); }
100template <
typename WindowType,
typename EncoderType,
typename DecoderType>
102 subscribe<WindowType>();
103 m_encoders.insert({WindowType::name(), std::make_shared<Mantid::Kernel::Instantiator<EncoderType, BaseEncoder>>()});
104 m_decoders.insert({decoderTag, std::make_shared<Mantid::Kernel::Instantiator<DecoderType, BaseDecoder>>()});
112 std::set<std::string> aliases = TYPE::aliases();
113 for (
const auto &alias_std_str : aliases) {
114 QString alias = QString::fromStdString(alias_std_str);
118 names.append(realName);
123 names.append(realName);
#define EXPORT_OPT_MANTIDQT_COMMON
#define EXTERN_MANTIDQT_COMMON
The UserSubWindowFactory is responsible for creating concrete instances of user interface classes.
std::map< std::string, std::shared_ptr< Mantid::Kernel::AbstractInstantiator< BaseEncoder > > > m_encoders
UserSubWindowFactoryImpl(const UserSubWindowFactoryImpl &)=delete
QHash< QString, QSet< QString > > m_categoryLookup
A map of interfaces to their categories.
~UserSubWindowFactoryImpl() override=default
Private Destructor.
QHash< QString, std::string > m_aliasLookup
A map of alias names to "real" names.
std::map< std::string, std::shared_ptr< Mantid::Kernel::AbstractInstantiator< BaseDecoder > > > m_decoders
UserSubWindowFactoryImpl & operator=(const UserSubWindowFactoryImpl &)=delete
void saveAliasNames(const std::string &realName)
Save the list of aliases.
QSet< QString > categories(const QString &interfaceName) const
Return the set of categories that the interface with the given name belongs to.
QHash< QString, QList< std::string > > m_badAliases
An index of multiply defined aliases.
This is the base class all customised user interfaces that do not wish to be tied to a specific Manti...
The dynamic factory is a base dynamic factory for serving up objects in response to requests from oth...
Manage the lifetime of a class intended to be a singleton.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
Helper class which provides the Collimation Length for SANS instruments.
Policy class controlling creation of the singleton Implementation classes should mark their default c...