~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session_list.h

  • Committer: Lee Bieber
  • Date: 2010-11-20 22:04:04 UTC
  • mfrom: (1942.1.4 b)
  • Revision ID: kalebral@gmail.com-20101120220404-2qpb4xuik9wv9u1q
Merge Lee -  Run bzr ignore for leftover files
Merge Shrews - Add a --replicate-query option to the server which controls whether or not the SQL query string is included in the GPB Statement messages.
Merge Andrew - fix bug 665119: drizzleslap has -i mapped to two options
Merge Andrew fix bug 674145: Table Names Not Case Matched

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_SESSION_CACHE_H
21
 
#define DRIZZLED_SESSION_CACHE_H
 
20
#ifndef DRIZZLED_SESSION_LIST_H
 
21
#define DRIZZLED_SESSION_LIST_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
  {
50
43
    return open_cache;
51
44
  }
52
45
 
53
 
  list &getCache()
 
46
  List &getCache()
54
47
  {
55
48
    return cache;
56
49
  }
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::Ptr);
 
57
  void erase(Session::shared_ptr&);
72
58
  size_t count();
73
 
  void insert(session_shared_ptr &arg);
 
59
  void insert(Session::shared_ptr &arg);
74
60
 
75
 
  session_shared_ptr find(const session_id_t &id);
 
61
  Session::shared_ptr find(const session_id_t &id);
76
62
 
77
63
private:
78
 
  bool volatile _ready_to_exit;
79
 
  list cache;
 
64
  List cache;
80
65
  boost::mutex _mutex;
81
 
  boost::condition_variable _end;
82
66
};
83
67
 
84
68
} /* namespace session */
85
69
} /* namespace drizzled */
86
70
 
87
 
#endif /* DRIZZLED_SESSION_CACHE_H */
 
71
#endif /* DRIZZLED_SESSION_LIST_H */