qswiki/requestworker.h

37 行
811 B
C

2018-11-03 17:12:20 +01:00
#ifndef REQUESTWORKER_H
#define REQUESTWORKER_H
#include "request.h"
#include "response.h"
#include "session.h"
#include "template.h"
#include "database/database.h"
#include "urlprovider.h"
#include "database/sessiondao.h"
#include "cache/fscache.h"
#include "handlers/handlerfactory.h"
2018-11-03 17:12:20 +01:00
class RequestWorker
{
Template *templ;
UrlProvider *urlProvider;
ICache *cache;
HandlerFactory *handlerFactory;
std::unique_ptr<SessionDao> sessionDao;
2018-11-03 17:12:20 +01:00
private:
Session retrieveSession(std::string token) const;
public:
RequestWorker(HandlerFactory &handlerFactory, std::unique_ptr<SessionDao> sessionDao, Template &templ)
2018-11-03 17:12:20 +01:00
{
this->handlerFactory = &handlerFactory;
2018-11-03 17:12:20 +01:00
this->templ = &templ;
this->sessionDao = std::move(sessionDao);
2018-11-03 17:12:20 +01:00
}
Response processRequest(const Request &r);
};
#endif // REQUESTWORKER_H