Drizzled Public API Documentation

singular.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2010 Brian Aker
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 /* Structs that defines the Table */
00022 
00023 #pragma once
00024 
00025 namespace drizzled
00026 {
00027 
00028 namespace table
00029 {
00030 
00031 class Singular : public Table
00032 {
00033   TableShare _share;
00034   bool _has_variable_width;
00035 
00036 public:
00037   Singular() :
00038     _share(message::Table::INTERNAL),
00039     _has_variable_width(false)
00040   {
00041   }
00042 
00043   Singular(Session *session, List<CreateField> &field_list);
00044 
00045   TableShare *getMutableShare(void)
00046   {
00047     return &_share;
00048   }
00049 
00050   void setShare(TableShare *)
00051   {
00052     assert(0);
00053   }
00054 
00055   const TableShare *getShare(void) const
00056   {
00057     return &_share;
00058   }
00059 
00060   bool hasShare() const { return true; }
00061 
00062   void release() {};
00063 
00064   bool hasVariableWidth() const
00065   {
00066     return _has_variable_width;
00067   }
00068 
00069   bool create_myisam_tmp_table(KeyInfo *keyinfo,
00070                                MI_COLUMNDEF *start_recinfo,
00071                                MI_COLUMNDEF **recinfo,
00072                                uint64_t options);
00073   void setup_tmp_table_column_bitmaps();
00074   bool open_tmp_table();
00075 
00076   void setVariableWidth()
00077   {
00078     _has_variable_width= true;
00079   }
00080 
00081   ~Singular();
00082 };
00083 
00084 } /* namespace table */
00085 } /* namespace drizzled */
00086