diff options
author | deva <deva> | 2010-06-10 07:03:06 +0000 |
---|---|---|
committer | deva <deva> | 2010-06-10 07:03:06 +0000 |
commit | 198b0d886817f2c5bc97cfd11857d4b314dffae3 (patch) | |
tree | 4fc2d51de46ab69b9e67149abf0ab6a332032f27 /server/src/pracrodao.h | |
parent | 730eb796bbce6f124be9194f1565b7dda1daddf1 (diff) |
Add transaction support on database pr. pracro session. Makes it possible to discard all edited macros.
Diffstat (limited to 'server/src/pracrodao.h')
-rw-r--r-- | server/src/pracrodao.h | 26 |
1 files changed, 21 insertions, 5 deletions
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<Fieldname> 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; |