diff options
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 | 
