summaryrefslogtreecommitdiff
path: root/server/src/session.h
diff options
context:
space:
mode:
authordeva <deva>2010-01-06 07:47:58 +0000
committerdeva <deva>2010-01-06 07:47:58 +0000
commit0e819eb42b4d680a99ae7b04702bfc9510495aee (patch)
treea425aeb98c679a0891a974b6f93090343d51a4e8 /server/src/session.h
parent582913fc18937c87afe7d351e66095dccb435a9e (diff)
New artefact connection class (to later wrap libartefact). New environment class to hold all global resources. Made ConnectionPool a template class. Split journal code up into two files (class from commit code).
Diffstat (limited to 'server/src/session.h')
-rw-r--r--server/src/session.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/server/src/session.h b/server/src/session.h
index a4d93f4..12c831a 100644
--- a/server/src/session.h
+++ b/server/src/session.h
@@ -31,6 +31,8 @@
#include <string>
#include <map>
+#include "mutex.h"
+
class JournalWriter;
class Session {
@@ -38,10 +40,18 @@ public:
Session(std::string sessionid);
std::string id();
+
+ void lock();
+ void unlock();
+
+ void commit();
+
+ JournalWriter *journal();
private:
- JournalWriter *journal;
+ JournalWriter *_journal;
std::string _id;
+ Mutex mutex;
};
class Sessions {
@@ -71,9 +81,13 @@ public:
*/
void deleteSession(std::string sessionid);
+ /**
+ * Return number of active sessions.
+ */
+ size_t size();
+
private:
std::map<std::string, Session *> sessions;
-
};