From 0e819eb42b4d680a99ae7b04702bfc9510495aee Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 6 Jan 2010 07:47:58 +0000 Subject: 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). --- server/src/session.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'server/src/session.h') 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 #include +#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 sessions; - }; -- cgit v1.2.3