~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/cache.h

  • Committer: Brian Aker
  • Date: 2011-02-27 19:43:52 UTC
  • mfrom: (2192.4.9 iter)
  • Revision ID: brian@tangent.org-20110227194352-w48j3ey8nhonecsd
MergeĀ inĀ find_ptr

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
namespace drizzled {
31
31
namespace message {
32
32
 
33
 
typedef boost::unordered_map< drizzled::identifier::Table::Key, drizzled::message::table::shared_ptr> Map;
34
 
 
35
33
class Cache
36
34
{
37
 
  boost::mutex _access;
38
 
  Map cache;
39
 
 
40
35
public:
41
 
  static inline Cache &singleton()
 
36
  static Cache &singleton()
42
37
  {
43
38
    static Cache open_cache;
44
 
 
45
39
    return open_cache;
46
40
  }
47
41
 
55
49
    cache.rehash(arg);
56
50
  }
57
51
 
58
 
  drizzled::message::table::shared_ptr find(const identifier::Table &identifier);
 
52
  table::shared_ptr find(const identifier::Table &identifier);
59
53
  void erase(const identifier::Table &identifier);
60
 
  bool insert(const identifier::Table &identifier, drizzled::message::table::shared_ptr share);
61
 
  bool insert(const identifier::Table &identifier, message::Table &share);
 
54
  bool insert(const identifier::Table &identifier, table::shared_ptr share);
 
55
  bool insert(const identifier::Table &identifier, Table &share);
 
56
private:
 
57
  typedef boost::unordered_map<identifier::Table::Key, table::shared_ptr> Map;
 
58
 
 
59
  boost::mutex _access;
 
60
  Map cache;
62
61
};
63
62
 
64
63
} /* namespace message */