18#include <QSetIterator>
46 QSet<QString> categories(
const QString &interfaceName)
const;
47 QStringList keys()
const;
50 BaseDecoder *findDecoder(
const std::string &decodeString);
52 template <
typename TYPE>
void subscribe();
53 template <
typename WindowType,
typename EncoderType,
typename DecoderType>
54 void subscribe(
const std::string &decoderTag);
71 template <
typename TYPE>
void saveAliasNames(
const std::string &realName);
83 std::map<std::string, std::shared_ptr<Mantid::Kernel::AbstractInstantiator<BaseEncoder>>>
m_encoders;
84 std::map<std::string, std::shared_ptr<Mantid::Kernel::AbstractInstantiator<BaseDecoder>>>
m_decoders;
88 std::string realName = TYPE::name();
90 saveAliasNames<TYPE>(realName);
93 const QStringList interfaceCategories = TYPE::categoryInfo().split(
";", Qt::SkipEmptyParts);
95 foreach (
const QString &category, interfaceCategories) {
96 result.insert(category.trimmed());
101template <
typename WindowType,
typename EncoderType,
typename DecoderType>
103 subscribe<WindowType>();
104 m_encoders.insert({WindowType::name(), std::make_shared<Mantid::Kernel::Instantiator<EncoderType, BaseEncoder>>()});
105 m_decoders.insert({decoderTag, std::make_shared<Mantid::Kernel::Instantiator<DecoderType, BaseDecoder>>()});
113 std::set<std::string> aliases = TYPE::aliases();
114 for (
const auto &alias_std_str : aliases) {
115 QString alias = QString::fromStdString(alias_std_str);
119 names.append(realName);
124 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.
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.
Mantid::Kernel::SingletonHolder< UserSubWindowFactoryImpl > UserSubWindowFactory
The specific instantiation of the templated type.
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...