diff options
Diffstat (limited to 'libadhocutil/factory.impl.h')
-rw-r--r-- | libadhocutil/factory.impl.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libadhocutil/factory.impl.h b/libadhocutil/factory.impl.h new file mode 100644 index 0000000..4e34310 --- /dev/null +++ b/libadhocutil/factory.impl.h @@ -0,0 +1,25 @@ +#ifndef ADHOCUTIL_FACTORY_IMPL_H +#define ADHOCUTIL_FACTORY_IMPL_H + +#include "factory.h" + +namespace AdHoc { + template <typename Base, typename ... Params> + Factory<Base, Params ...>::~Factory() = default; + + template <typename Base, typename ... Params> + const Factory<Base, Params...> * + Factory<Base, Params...>::get(const std::string & name) + { + return PluginManager::getDefault()->get<Factory>(name)->implementation(); + } + + template <typename Base, typename ... Params> + Base * + Factory<Base, Params...>::create(const std::string & name, const Params & ... p) + { + return get(name)->create(p...); + } +} +#endif + |