19template <
typename Factory,
typename Product,
typename Argument>
27 std::unique_ptr<Product>
create(
const Argument &argument)
const {
28 if (this->canInterpret(argument)) {
29 return std::unique_ptr<Product>(this->createRaw(argument));
31 if (this->hasSuccessor()) {
34 throw std::invalid_argument(
"No successor MDUnitFactory");
41 virtual Product *
createRaw(
const Argument &argument)
const = 0;
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
ChainableFactory : Chain of Responsiblity generic factory.
virtual bool canInterpret(const Argument &unitString) const =0
Indicate an ability to intepret the string.
virtual Product * createRaw(const Argument &argument) const =0
Create the product.
std::unique_ptr< Product > create(const Argument &argument) const
Factory method wrapper.
Helper class which provides the Collimation Length for SANS instruments.