~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session/cache.h

  • Committer: Brian Aker
  • Date: 2011-01-12 06:45:23 UTC
  • mto: (2073.1.4 catalogs)
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: brian@tangent.org-20110112064523-rqhptaqbph22qmj1
RemoveĀ customĀ error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_SESSION_CACHE_H
21
21
#define DRIZZLED_SESSION_CACHE_H
22
22
 
 
23
#include "drizzled/session.h"
23
24
#include <list>
24
25
 
25
 
#include <drizzled/visibility.h>
26
 
 
27
26
namespace drizzled
28
27
{
29
28
 
32
31
namespace session
33
32
{
34
33
 
35
 
class DRIZZLED_API Cache 
 
34
class Cache 
36
35
{
37
 
  typedef boost::shared_ptr<drizzled::Session> session_shared_ptr;
38
36
public:
39
 
  typedef std::list<session_shared_ptr> list;
40
 
 
41
 
  Cache() :
42
 
    _ready_to_exit(false)
43
 
  {
44
 
  }
 
37
  typedef std::list<Session::shared_ptr> list;
45
38
 
46
39
  static inline Cache &singleton()
47
40
  {
60
53
    return _mutex;
61
54
  }
62
55
 
63
 
  boost::condition_variable &cond()
64
 
  {
65
 
    return _end;
66
 
  }
67
 
 
68
 
  void shutdownFirst();
69
 
  void shutdownSecond();
70
 
 
71
 
  void erase(session_shared_ptr&);
 
56
  void erase(Session::shared_ptr&);
72
57
  size_t count();
73
 
  void insert(session_shared_ptr &arg);
 
58
  void insert(Session::shared_ptr &arg);
74
59
 
75
 
  session_shared_ptr find(const session_id_t &id);
 
60
  Session::shared_ptr find(const session_id_t &id);
76
61
 
77
62
private:
78
 
  bool volatile _ready_to_exit;
79
63
  list cache;
80
64
  boost::mutex _mutex;
81
 
  boost::condition_variable _end;
82
65
};
83
66
 
84
67
} /* namespace session */