~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table/cache.h

[patch 003/129] Merge patch for revision 1788 from InnoDB SVN:
revno: 1788
revision-id: svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:5670
parent: svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:5663
committer: marko
timestamp: Wed 2009-08-12 12:16:37 +0000
message:
  branches/zip: trx_undo_rec_copy(): Add const qualifier to undo_rec.
  This is a non-functional change.
modified:
  include/trx0rec.h              2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Ftrx0rec.h
  include/trx0rec.ic             2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Ftrx0rec.ic
  trx/trx0rec.c                  2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Ftrx%2Ftrx0rec.c
diff:
=== modified file 'include/trx0rec.h'

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2010 Brian Aker
5
 
 *  Copyright (C) 2010 Sun Microsystems
6
 
 *
7
 
 *  This program is free software; you can redistribute it and/or modify
8
 
 *  it under the terms of the GNU General Public License as published by
9
 
 *  the Free Software Foundation; either version 2 of the License, or
10
 
 *  (at your option) any later version.
11
 
 *
12
 
 *  This program is distributed in the hope that it will be useful,
13
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 *  GNU General Public License for more details.
16
 
 *
17
 
 *  You should have received a copy of the GNU General Public License
18
 
 *  along with this program; if not, write to the Free Software
19
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
 
 */
21
 
 
22
 
#ifndef DRIZZLED_TABLE_CACHE_H
23
 
#define DRIZZLED_TABLE_CACHE_H
24
 
 
25
 
#include <boost/unordered_map.hpp>
26
 
 
27
 
namespace drizzled {
28
 
namespace table {
29
 
 
30
 
class Concurrent;
31
 
 
32
 
typedef boost::unordered_multimap< TableIdentifier::Key, Concurrent *> CacheMap;
33
 
typedef std::pair< CacheMap::const_iterator, CacheMap::const_iterator > CacheRange;
34
 
 
35
 
class Cache 
36
 
{
37
 
  CacheMap cache;
38
 
 
39
 
public:
40
 
  static inline Cache &singleton()
41
 
  {
42
 
    static Cache open_cache;
43
 
 
44
 
    return open_cache;
45
 
  }
46
 
 
47
 
  CacheMap &getCache()
48
 
  {
49
 
    return cache;
50
 
  }
51
 
 
52
 
  void rehash(size_t arg)
53
 
  {
54
 
    cache.rehash(arg);
55
 
  }
56
 
 
57
 
  bool areTablesUsed(Table *table, bool wait_for_name_lock);
58
 
  void removeSchema(const SchemaIdentifier &schema_identifier);
59
 
  bool removeTable(Session *session, TableIdentifier &identifier, uint32_t flags);
60
 
  void release(TableShare *share);
61
 
  bool insert(table::Concurrent *arg);
62
 
 
63
 
  boost::mutex &mutex()
64
 
  {
65
 
    return _mutex;
66
 
  }
67
 
 
68
 
private:
69
 
  boost::mutex _mutex;
70
 
};
71
 
 
72
 
CacheMap &getCache(void);
73
 
void remove_table(table::Concurrent *arg);
74
 
 
75
 
} /* namepsace table */
76
 
} /* namepsace drizzled */
77
 
 
78
 
#endif /* DRIZZLED_TABLE_CACHE_H */