00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #pragma once
00022
00023 #include <drizzled/plugin/storage_engine.h>
00024
00025 namespace drizzled {
00026
00027 class Session;
00028
00029 namespace generator {
00030
00031 class Table
00032 {
00033 Session &session;
00034
00035 identifier::Table::vector table_names;
00036 identifier::Table::vector::const_iterator table_iterator;
00037
00038 public:
00039
00040 Table(Session &arg, const identifier::Schema &schema_identifier);
00041
00042 operator const drizzled::message::table::shared_ptr()
00043 {
00044 while (table_iterator != table_names.end())
00045 {
00046 message::table::shared_ptr table;
00047 table= plugin::StorageEngine::getTableMessage(session, *table_iterator);
00048 table_iterator++;
00049
00050 if (table)
00051 return table;
00052 }
00053
00054 return message::table::shared_ptr();
00055 }
00056
00057 operator const drizzled::identifier::Table*()
00058 {
00059 while (table_iterator != table_names.end())
00060 {
00061 const drizzled::identifier::Table *_ptr= &(*table_iterator);
00062 table_iterator++;
00063
00064 return _ptr;
00065 }
00066
00067 return NULL;
00068 }
00069 };
00070
00071 }
00072 }
00073