qswiki/database/database.h

33 líneas
904 B
C
Original Vista normal Histórico

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"
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 ~Database() { }
};
#endif