qswiki/dynamic/dynamiccontentfactory.h

31 rader
650 B
C
Normal vy Historik

2022-08-20 10:24:23 +02:00
#ifndef DYNAMICCONTENTFACTORY_H
#define DYNAMICCONTENTFACTORY_H
#include "dynamiccontent.h"
class DynamicContentFactory
{
private:
Template *templ;
Database *db;
UrlProvider *urlProvider;
Session *session;
2022-08-20 10:24:23 +02:00
public:
DynamicContentFactory(Template &templ, Database &db, UrlProvider &urlProvider, Session &session)
2022-08-20 10:24:23 +02:00
{
this->templ = &templ;
this->db = &db;
this->urlProvider = &urlProvider;
this->session = &session;
2022-08-20 10:24:23 +02:00
}
template <class T> inline std::shared_ptr<T> createDynamicContent()
{
return std::make_shared<T>(*this->templ, *this->db, *this->urlProvider, *this->session);
2022-08-20 10:24:23 +02:00
}
};
#endif // DYNAMICCONTENTFACTORY_H_INCLUDED