19
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
#ifndef DRIZZLED_TABLE_CACHE_H
23
#define DRIZZLED_TABLE_CACHE_H
24
#include <boost/thread/mutex.hpp>
25
25
#include <boost/unordered_map.hpp>
26
26
#include <drizzled/identifier.h>
28
28
namespace drizzled {
31
typedef boost::unordered_multimap<identifier::Table::Key, Concurrent*> CacheMap;
32
typedef std::pair<CacheMap::const_iterator, CacheMap::const_iterator> CacheRange;
40
typedef boost::unordered_multimap< identifier::Table::Key, Concurrent *> CacheMap;
41
typedef std::pair< CacheMap::const_iterator, CacheMap::const_iterator > CacheRange;
37
static CacheMap& getCache()
48
static inline Cache &singleton()
50
static Cache open_cache;
42
static void rehash(size_t arg)
60
void rehash(size_t arg)
47
static boost::mutex& mutex()
65
bool areTablesUsed(Table *table, bool wait_for_name_lock);
66
void removeSchema(const identifier::Schema &schema_identifier);
67
bool removeTable(Session *session, identifier::Table &identifier, uint32_t flags);
68
void release(table::instance::Shared *share);
69
bool insert(table::Concurrent *arg);
52
static bool areTablesUsed(Table*, bool wait_for_name_lock);
53
static void removeSchema(const identifier::Schema&);
54
static bool removeTable(Session&, const identifier::Table&, uint32_t flags);
55
static void release(table::instance::Shared*);
56
static void insert(table::Concurrent*);
58
static CacheMap cache;
59
static boost::mutex _mutex;
63
void remove_table(table::Concurrent*);
80
CacheMap &getCache(void);
81
void remove_table(table::Concurrent *arg);
65
83
} /* namepsace table */
66
84
} /* namepsace drizzled */
86
#endif /* DRIZZLED_TABLE_CACHE_H */