17#define DECLARE_UNIT(classname) \
19 Mantid::Kernel::RegistrationHelper \
20 register_unit_##classname(((Mantid::Kernel::UnitFactory::Instance().subscribe<classname>(#classname)), 0)); \
22 const std::string Mantid::Kernel::Units::classname::unitID() const { return #classname; }
27#include "MantidKernel/DllConfig.h"
54 const std::vector<std::string> getConvertibleUnits()
const {
55 std::vector<std::string> convertibleUnits;
57 for (
const auto &unitKey : getKeys()) {
58 const auto unit_sptr =
create(unitKey);
59 if (unit_sptr->isConvertible()) {
60 convertibleUnits.emplace_back(unitKey);
64 return convertibleUnits;
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.
Creates instances of concrete units.
UnitFactoryImpl()=default
Private Constructor for singleton class.
UnitFactoryImpl & operator=(const UnitFactoryImpl &)=delete
~UnitFactoryImpl() override=default
Private Destructor.
UnitFactoryImpl(const UnitFactoryImpl &)=delete
std::unique_ptr< T > create(const P &parent, const IndexArg &indexArg, const HistArg &histArg)
This is the create() method that all the other create() methods call.
Helper class which provides the Collimation Length for SANS instruments.
Policy class controlling creation of the singleton Implementation classes should mark their default c...