From 6dbe8d34dc7dec2957c015add19c2be8c0289fcc Mon Sep 17 00:00:00 2001 From: Albert S Date: Sat, 20 Aug 2022 10:24:23 +0200 Subject: [PATCH] Add DynamicContentFactory --- dynamic/dynamiccontentfactory.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 dynamic/dynamiccontentfactory.h diff --git a/dynamic/dynamiccontentfactory.h b/dynamic/dynamiccontentfactory.h new file mode 100644 index 0000000..5972042 --- /dev/null +++ b/dynamic/dynamiccontentfactory.h @@ -0,0 +1,28 @@ +#ifndef DYNAMICCONTENTFACTORY_H +#define DYNAMICCONTENTFACTORY_H + +#include "dynamiccontent.h" + +class DynamicContentFactory +{ +private: + Template *templ; + Database *db; + UrlProvider *urlProvider; + +public: + DynamicContentFactory(Template &templ, Database &db, UrlProvider &urlProvider) + { + this->templ = &templ; + this->db = &db; + this->urlProvider = &urlProvider; + } + + template inline std::shared_ptr createDynamicContent() + { + return std::make_shared(*this->templ, *this->db, *this->urlProvider); + } + + +}; +#endif // DYNAMICCONTENTFACTORY_H_INCLUDED