qswiki/database/database.h

43 lignes
1016 B
C
Brut Vue normale Historique

2018-11-03 17:12:20 +01:00
#ifndef DATABASE_H
#define DATABASE_H
#include <memory>
#include <string>
#include "../user.h"
#include "../request.h"
#include "../response.h"
#include "pagedao.h"
#include "revisiondao.h"
#include "sessiondao.h"
#include "userdao.h"
#include "categorydao.h"
#include "permissionsdao.h"
2018-11-03 17:12:20 +01:00
class Database
{
private:
std::string connnectionstring;
public:
Database()
{
}
Database(std::string connstring)
{
this->connnectionstring = connstring;
}
virtual void beginTransaction() = 0;
virtual void rollbackTransaction() = 0;
virtual void commitTransaction() = 0;
virtual std::unique_ptr<PageDao> createPageDao() const = 0;
virtual std::unique_ptr<RevisionDao> createRevisionDao() const = 0;
virtual std::unique_ptr<SessionDao> createSessionDao() const = 0;
virtual std::unique_ptr<UserDao> createUserDao() const = 0;
virtual std::unique_ptr<CategoryDao> createCategoryDao() const = 0;
virtual std::unique_ptr<PermissionsDao> createPermissionsDao() const = 0;
2018-11-03 17:12:20 +01:00
virtual ~Database()
{
}
};
#endif