31 template <
class Product>
44 static std::string msg =
"Key not registered.";
59 template <
class K,
class P>
62 typedef std::map<K,Creator<P>
const*> Map;
76 return makeProduct(begin(map()),
"no key registered",arg);
98 static std::unique_ptr<Product> makeProduct(
typename Map::const_iterator i,
105 return i->second->create(arg);
static std::unique_ptr< Product > create(Key key, typename Creator< Product >::Argument arg)
static std::unique_ptr< Product > createAny(typename Creator< Product >::Argument arg)
static void plugin(Key key, Creator< Product > const *creator)
Registers a creator for creation of Product objects with the given.
An exception that can be thrown whenever a key lookup fails.
Abstract base class of creators that can be registered at the pluggable factory.
std::unique_ptr< Product > operator()(Argument) const
static std::string const & lookupFailureHint(Key const &)