summaryrefslogtreecommitdiff
path: root/server/src/journal_commit.h
diff options
context:
space:
mode:
authordeva <deva>2009-04-24 09:21:53 +0000
committerdeva <deva>2009-04-24 09:21:53 +0000
commitdaace73c76bdd22e8e87408ba7e0eec7d6e19e0e (patch)
tree79d738c7938e7834fa337613cad8542ff30ff181 /server/src/journal_commit.h
parent3e4eb36c5e67045824bc2ca44f9d7efe2c5e4176 (diff)
Delayed journal commit write. This makes sure each macro is only stored once. and also makes sure only one header (date, user, etc) is added pr. session.
Diffstat (limited to 'server/src/journal_commit.h')
-rw-r--r--server/src/journal_commit.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/server/src/journal_commit.h b/server/src/journal_commit.h
index 7462f39..387eab6 100644
--- a/server/src/journal_commit.h
+++ b/server/src/journal_commit.h
@@ -27,10 +27,33 @@
#ifndef __PRACRO_JOURNAL_COMMIT_H__
#define __PRACRO_JOURNAL_COMMIT_H__
-#include <stdlib.h>
+#include <string>
+#include <vector>
-int journal_commit(const char *cpr, const char *user,
- const char *ip, unsigned short int port,
- const char *buf, size_t size);
+#include "transaction.h"
+
+class ResumeEntry {
+public:
+ std::string resume;
+ std::string macro;
+};
+
+class JournalWriter {
+public:
+ JournalWriter(std::string host, unsigned short int port);
+
+ void addEntry(Transaction &transaction, Commit &commit, std::string resume);
+
+ void commit();
+
+private:
+ std::string host;
+ unsigned short int port;
+
+ std::string currentuser;
+ std::string currentcpr;
+
+ std::vector< ResumeEntry > entrylist;
+};
#endif/*__PRACRO_JOURNAL_COMMIT_H__*/