1502.1.19
by Brian Aker
Adds concept of table owned TableShare. |
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 |
*
|
|
6 |
* This program is free software; you can redistribute it and/or modify
|
|
7 |
* it under the terms of the GNU General Public License as published by
|
|
8 |
* the Free Software Foundation; either version 2 of the License, or
|
|
9 |
* (at your option) any later version.
|
|
10 |
*
|
|
11 |
* This program is distributed in the hope that it will be useful,
|
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 |
* GNU General Public License for more details.
|
|
15 |
*
|
|
16 |
* You should have received a copy of the GNU General Public License
|
|
17 |
* along with this program; if not, write to the Free Software
|
|
18 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
19 |
*/
|
|
20 |
||
21 |
/* Structs that defines the Table */
|
|
22 |
||
1532.1.1
by Brian Aker
Merge of change to flip table instance to be share instance |
23 |
#ifndef DRIZZLED_TABLE_SHARE_INSTANCE_H
|
24 |
#define DRIZZLED_TABLE_SHARE_INSTANCE_H
|
|
1502.1.19
by Brian Aker
Adds concept of table owned TableShare. |
25 |
|
26 |
namespace drizzled |
|
27 |
{
|
|
28 |
||
1532.1.1
by Brian Aker
Merge of change to flip table instance to be share instance |
29 |
class TableShareInstance : public TableShare |
1502.1.19
by Brian Aker
Adds concept of table owned TableShare. |
30 |
{
|
1532.1.1
by Brian Aker
Merge of change to flip table instance to be share instance |
31 |
Table private_table; |
32 |
||
1502.1.19
by Brian Aker
Adds concept of table owned TableShare. |
33 |
public: |
1618
by Brian Aker
This is a rollup set of patches for modifications to TableIdentifier to have |
34 |
TableShareInstance(TableIdentifier::Type type_arg) : |
35 |
TableShare(type_arg) |
|
1532.1.1
by Brian Aker
Merge of change to flip table instance to be share instance |
36 |
{
|
1532.1.15
by Brian Aker
Partial encapsulation of TableShare from Table. |
37 |
private_table.setShare(this); |
1532.1.1
by Brian Aker
Merge of change to flip table instance to be share instance |
38 |
}
|
39 |
||
40 |
Table *getTable() |
|
41 |
{
|
|
42 |
return &private_table; |
|
43 |
}
|
|
44 |
||
45 |
~TableShareInstance() |
|
46 |
{
|
|
47 |
private_table.free_tmp_table(private_table.in_use); |
|
1502.1.19
by Brian Aker
Adds concept of table owned TableShare. |
48 |
}
|
49 |
};
|
|
50 |
||
51 |
} /* namespace drizzled */ |
|
52 |
||
1532.1.1
by Brian Aker
Merge of change to flip table instance to be share instance |
53 |
#endif /* DRIZZLED_TABLE_SHARE_INSTANCE_H */ |