~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session_list.h

merge update-innobase-1.1.1 branch (incl fixes for trunk)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_SESSION_LIST_H
21
21
#define DRIZZLED_SESSION_LIST_H
22
22
 
 
23
#include "drizzled/session.h"
23
24
#include <list>
24
25
 
25
26
namespace drizzled
26
27
{
27
28
 
28
29
class Session;
29
 
typedef Session* SessionPtr;
30
 
typedef std::list<SessionPtr> SessionList;
31
 
SessionList &getSessionList();
32
 
 
33
 
}
 
30
 
 
31
namespace session
 
32
{
 
33
 
 
34
class Cache 
 
35
{
 
36
public:
 
37
  typedef std::list<Session::shared_ptr> List;
 
38
 
 
39
  static inline Cache &singleton()
 
40
  {
 
41
    static Cache open_cache;
 
42
 
 
43
    return open_cache;
 
44
  }
 
45
 
 
46
  List &getCache()
 
47
  {
 
48
    return cache;
 
49
  }
 
50
 
 
51
  boost::mutex &mutex()
 
52
  {
 
53
    return _mutex;
 
54
  }
 
55
 
 
56
  void erase(Session::Ptr);
 
57
  void erase(Session::shared_ptr&);
 
58
  size_t count();
 
59
  void insert(Session::shared_ptr &arg);
 
60
 
 
61
  Session::shared_ptr find(const session_id_t &id);
 
62
 
 
63
private:
 
64
  List cache;
 
65
  boost::mutex _mutex;
 
66
};
 
67
 
 
68
} /* namespace session */
 
69
} /* namespace drizzled */
34
70
 
35
71
#endif /* DRIZZLED_SESSION_LIST_H */