From 198b0d886817f2c5bc97cfd11857d4b314dffae3 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 10 Jun 2010 07:03:06 +0000 Subject: Add transaction support on database pr. pracro session. Makes it possible to discard all edited macros. --- server/src/pracrodao.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'server/src/pracrodao.h') diff --git a/server/src/pracrodao.h b/server/src/pracrodao.h index 1ef9686..7825dee 100644 --- a/server/src/pracrodao.h +++ b/server/src/pracrodao.h @@ -38,17 +38,33 @@ class PracroDAO { public: - PracroDAO(std::string _host, std::string _port, std::string _user, std::string _passwd, std::string _dbname); + PracroDAO(std::string _host, std::string _port, + std::string _user, std::string _passwd, std::string _dbname); virtual ~PracroDAO(); - virtual void commitTransaction(std::string user, std::string patientid, Macro ¯o, Fields &fields, time_t now) = 0; - virtual Values getLatestValues(std::string patientid, Macro *macro, Fieldnames &fieldnames, time_t oldest) = 0; - virtual unsigned nrOfCommits(std::string patientid, std::string macroname, time_t oldest) = 0; + virtual void commitTransaction(std::string user, + std::string patientid, + Macro ¯o, + Fields &fields, + time_t now) = 0; + virtual Values getLatestValues(std::string patientid, + Macro *macro, + Fieldnames &fieldnames, + time_t oldest) = 0; + virtual unsigned nrOfCommits(std::string patientid, + std::string macroname, + time_t oldest) = 0; - virtual void addFieldname(std::string name, std::string description) = 0; + virtual void addFieldname(std::string name, + std::string description) = 0; virtual void delFieldname(std::string name) = 0; virtual std::vector getFieldnames() = 0; + virtual void commit() = 0; + virtual void discard() = 0; + virtual std::string serialise() = 0; + virtual void restore(const std::string &data) = 0; + protected: std::string host; std::string port; -- cgit v1.2.3