1 /* $Id: session.hpp,v 1.8 2005-10-16 16:05:18 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
54 bool operator == (Session &ses) {
55 return ses.m_id == m_id;
59 unsigned long int m_id;
62 /// static mutex to lock static m_id
63 static boost::mutex m_mutex;
65 /// static m_id to make sure that there is only one id counter
66 static unsigned long int m_global_id;
76 * indent-tabs-mode: nil
77 * c-file-style: "stroustrup"
79 * vim: shiftwidth=4 tabstop=8 expandtab