26
Shared class for correct LOCK operation
27
TODO -> Fix to never remove/etc. We could generate all of these in startup if we wanted to.
28
Tracking count? I'm not sure that is needed at all. We could possibly make this a member of
29
engine as well (should we just hide the share detail?)
32
class InformationCursor;
34
28
class InformationShare
38
drizzled::plugin::InfoSchemaTable *i_s_table;
32
drizzled::plugin::InfoSchemaTable *table;
42
InformationShare(const char *arg) :
38
InformationShare(const std::string &in_name) :
47
41
thr_lock_init(&lock);
42
table= drizzled::plugin::InfoSchemaTable::getTable(in_name.c_str());
50
45
~InformationShare()
52
47
thr_lock_delete(&lock);
55
void inc(void) { count++; }
56
uint32_t dec(void) { return --count; }
58
void setInfoSchemaTable(const std::string &in_name)
60
i_s_table= drizzled::plugin::InfoSchemaTable::getTable(in_name.c_str());
51
* Increment the counter which tracks how many instances of this share are
53
* @return the new counter value
55
uint32_t incUseCount(void)
61
* Decrement the count which tracks how many instances of this share are
63
* @return the new counter value
65
uint32_t decUseCount(void)
71
* @ return the value of the use counter for this share
73
uint32_t getUseCount() const
79
* @return the table name associated with this share.
81
const std::string &getName() const
83
return table->getTableName();
87
* @return the I_S table associated with this share.
63
89
drizzled::plugin::InfoSchemaTable *getInfoSchemaTable()
68
static InformationShare *get(const char *table_name);
69
static void free(InformationShare *share);
70
static void start(void);
71
static void stop(void);
95
* @return the thread lock for this share.
97
THR_LOCK *getThreadLock()
75
103
#endif /* PLUGIN_INFORMATION_ENGINE_INFORMATION_SHARE_H */