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 namespace generator {
00027
00028 class Table
00029 {
00030 Session &session;
00031
00032 identifier::table::vector table_names;
00033 identifier::table::vector::const_iterator table_iterator;
00034
00035 public:
00036
00037 Table(Session &arg, const identifier::Schema &schema_identifier);
00038
00039 operator const drizzled::message::table::shared_ptr()
00040 {
00041 while (table_iterator != table_names.end())
00042 {
00043 message::table::shared_ptr table;
00044 table= plugin::StorageEngine::getTableMessage(session, *table_iterator);
00045 table_iterator++;
00046
00047 if (table)
00048 return table;
00049 }
00050
00051 return message::table::shared_ptr();
00052 }
00053
00054 operator const drizzled::identifier::Table*()
00055 {
00056 while (table_iterator != table_names.end())
00057 {
00058 const drizzled::identifier::Table *_ptr= &(*table_iterator);
00059 table_iterator++;
00060
00061 return _ptr;
00062 }
00063
00064 return NULL;
00065 }
00066 };
00067
00068 }
00069 }
00070