summaryrefslogtreecommitdiff
path: root/server/src/journal.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-01-26 12:08:39 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2012-01-26 12:08:39 +0100
commit4edae3f518353bb21a02fcda2dfcff83c5a72fc3 (patch)
tree7902e2b6af1dabdb5c49b906b8592874bfce407d /server/src/journal.h
parente9ff9842e9a8c178f5e17c0cf5dde16db1a0d8fc (diff)
New onCommit scripting system.
Diffstat (limited to 'server/src/journal.h')
-rw-r--r--server/src/journal.h16
1 files changed, 13 insertions, 3 deletions
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;
};