~drizzle-developers/ubuntu/karmic/drizzle/ppa

« back to all changes in this revision

Viewing changes to drizzled/session_list.h

  • Committer: Monty Taylor
  • Date: 2010-11-24 18:44:57 UTC
  • mfrom: (1308.1.31 trunk)
  • Revision ID: mordred@inaugust.com-20101124184457-qd6jvoe2wgnvl3yq
Tags: 2010.11.04-0ubuntu1~karmic1
* New upstream release.
* Turn off -Werror for packaging builds. (Closes: #602662)

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 */