~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table/temporary.h

  • Committer: Mark Atwood
  • Date: 2011-10-27 05:08:12 UTC
  • mfrom: (2445.1.11 rf)
  • Revision ID: me@mark.atwood.name-20111027050812-1icvs72lb0u4xdc4
mergeĀ lp:~olafvdspek/drizzle/refactor8

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_TABLE_TEMPORARY_H
22
 
#define DRIZZLED_TABLE_TEMPORARY_H
23
 
 
24
 
namespace drizzled
25
 
{
26
 
 
27
 
namespace table
28
 
{
 
21
#pragma once
 
22
 
 
23
namespace drizzled {
 
24
namespace table {
29
25
 
30
26
class Temporary : public Table
31
27
{
32
 
  TableShare *_share; /**< Pointer to the shared metadata about the table */
 
28
  instance::Singular *_share; /**< Pointer to the shared metadata about the table */
33
29
 
34
30
public:
35
 
  Temporary(const TableIdentifier::Type type_arg,
36
 
            const TableIdentifier &identifier,
37
 
             char *path_arg, uint32_t path_length_arg) :
38
 
    Table()
39
 
  {
40
 
    _share= new TableShare(type_arg, identifier, path_arg, path_length_arg);
41
 
  }
42
 
 
43
 
  ~Temporary()
44
 
  {
 
31
  Temporary(const identifier::Table::Type type_arg,
 
32
            const identifier::Table &identifier,
 
33
            const char *path_arg, uint32_t path_length_arg)
 
34
  {
 
35
    _share= new instance::Singular(type_arg, identifier, path_arg, path_length_arg);
45
36
  }
46
37
 
47
38
  virtual const TableShare *getShare() const { assert(_share); return _share; } /* Get rid of this long term */
48
39
  virtual TableShare *getMutableShare() { assert(_share); return _share; } /* Get rid of this long term */
49
40
  virtual bool hasShare() const { return _share ? true : false ; } /* Get rid of this long term */
50
 
  virtual void setShare(TableShare *new_share) { _share= new_share; } /* Get rid of this long term */
 
41
  virtual void setShare(TableShare *new_share)
 
42
  {
 
43
    _share= static_cast<instance::Singular *>(new_share);
 
44
  }
51
45
 
52
 
  void release(void)
 
46
  void release()
53
47
  {
54
48
    delete _share;
55
49
    _share= NULL;
60
54
} /* namespace table */
61
55
} /* namespace drizzled */
62
56
 
63
 
#endif /* DRIZZLED_TABLE_TEMPORARY_H */