diff options
author | deva <deva> | 2011-02-04 07:43:00 +0000 |
---|---|---|
committer | deva <deva> | 2011-02-04 07:43:00 +0000 |
commit | bfe5d3000182cb10db583fe42ffa7b48f84d8b5b (patch) | |
tree | 8b4228e258716267e854975df7f8a01294c89562 /server/src/session.h | |
parent | f825cb9f6f5a01f2029c79a363a89047b482c788 (diff) |
Session locking mechanism gone crazy. This needs a rewamp at some point.
Diffstat (limited to 'server/src/session.h')
-rw-r--r-- | server/src/session.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/server/src/session.h b/server/src/session.h index 5b9b0bb..31dee3f 100644 --- a/server/src/session.h +++ b/server/src/session.h @@ -30,6 +30,7 @@ #include <string> #include <map> +#include <exception> #include "mutex.h" @@ -56,6 +57,10 @@ public: std::string patientid; std::string templ; + bool active(); + + bool isreadonly; + private: Journal *_journal; Database *_database; @@ -64,13 +69,21 @@ private: class Sessions { public: + class SessionAlreadyActive : public std::exception { + public: + SessionAlreadyActive(const std::string sid) : sessionid(sid) {} + ~SessionAlreadyActive() throw() {} + const std::string sessionid; + }; + Sessions(); /** * Create a new session, with a unique id. Insert it into the session list, * and return its pointer. */ - Session *newSession(std::string patientid, std::string templ); + Session *newSession(std::string patientid, std::string templ) + throw(SessionAlreadyActive); /** * Lookup session in session list. Returns the session or NULL if no session |