29 template <
class Product>
42 static std::string msg =
"Key not registered.";
57 template <
class K,
class P>
60 typedef std::map<K,Creator<P>
const*> Map;
74 return makeProduct(begin(map()),
"no key registered",arg);
94 static std::unique_ptr<Product> makeProduct(
typename Map::const_iterator i,
101 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 &)