1 /* $Id: session.hpp,v 1.7 2005-10-15 14:09:09 adam Exp $
2 Copyright (c) 2005, Index Data.
10 //#include <stdexcept>
12 #include <boost/thread/mutex.hpp>
18 //typedef unsigned long type;
21 /// create new session with new unique id
23 boost::mutex::scoped_lock scoped_lock(m_mutex);
29 /// copy session including old id
30 Session(const Session &s) : m_id(s.m_id), m_close(s.m_close) {};
32 Session& operator=(const Session &s) {
41 unsigned long id() const {
45 bool is_closed() const {
49 /// mark session closed, can not be unset
56 unsigned long int m_id;
59 /// static mutex to lock static m_id
60 static boost::mutex m_mutex;
62 /// static m_id to make sure that there is only one id counter
63 static unsigned long int m_global_id;
73 * indent-tabs-mode: nil
74 * c-file-style: "stroustrup"
76 * vim: shiftwidth=4 tabstop=8 expandtab