From 4edae3f518353bb21a02fcda2dfcff83c5a72fc3 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 26 Jan 2012 12:08:39 +0100 Subject: New onCommit scripting system. --- server/src/journal.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'server/src/journal.h') diff --git a/server/src/journal.h b/server/src/journal.h index 573f252..d098756 100644 --- a/server/src/journal.h +++ b/server/src/journal.h @@ -33,22 +33,31 @@ #include "transaction.h" #include "template.h" +#include "luaoncommit.h" class SessionSerialiser; class Journal { friend class SessionSerialiser; public: + class Exception { + public: + Exception(std::string m) : msg(m) {} + std::string msg; + }; + Journal(); virtual ~Journal() {} void addEntry(Transaction &transaction, Commit &commit, - std::string resume, Template *templ); + std::string resume, Template *templ, LUAOnCommit *oncommit); void addEntry(std::string resume, std::string macro, - std::string user, int index); + std::string user, int index, LUAOnCommit *oncommit); + + void runOnCommitScripts() throw(LUAScript::Exception); - virtual void commit() = 0; + virtual void commit() throw(Exception) = 0; std::string getEntry(std::string macro); void removeEntry(std::string macro); @@ -65,6 +74,7 @@ protected: std::string resume; std::string macro; std::string user; + LUAOnCommit *oncommit; bool dirty; }; -- cgit v1.2.3