qswiki/database/database.h

43 строки
1018 B
C
Исходник Обычный вид История

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
{
2023-07-29 10:00:22 +02:00
protected:
2018-11-03 17:12:20 +01:00
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